Simulation of Multi Agent Solution for Smart Grids using Matlab/Simulink and Modelit Webserver Toolbox

Tobias Linnenberg
Graduate of Helmut Schmidt University in Hamburg, Germany

March 2011

Problem Area

Due to a rapidly growing amount of decentralized renewable energy injection into the power grid it is key to find new control solutions to manage a vast number of little energy sinks and sources in such a manner that the demand will adapt to the actual power available.

Smart Grid Control Solution

A Smart Grid expands the traditional electrical grid with a decentralized control system that influences both supply and demand in an optimal manner. The current study proposes a Multi Agent control that is made up of different agents based in all kinds of consumers and producers of electricity (e.g. a computer, a fridge, a wind power plant or a nuclear power plant), called PROSUMER agents. These agents tell some superior agent that they want to use or produce a certain amount of energy. Every grid connection point has one of these superior agents called HOUSEKEEPER. These HOUSEKEEPERS will bundle the energy which shall be produced or used up internally. With the extra amount of energy they will then go to a third agent, a local MARKETPLACE. There they will offer or request energy for certain prices, based on the criticality of their energy needs. If there shouldn’t be enough energy vendors or buyers to satisfy all of them a fourth agent, the AMBASSADOR will go to a higher market place and negotiate with other ambassadors whether they may want to buy or sell some energy. This procedure is repeated for each level of the grid aka low, medium and high voltage levels. At the end there will be a balanced configuration in the grid. Because for each energy sink there will be an energy source.

Webserver Solution

After an analysis of possible communication solutions to address the real-world prosumers web services were found to be the most universal tool. By means of web services it is possible to design a scalable communication protocol between agents and real-life machinery.


Due to the early stage of the development a test bed representing a number of electricity generators and consumers had to be defined. MATLAB was selected as it comprises several flexible and powerful toolboxes and offers good coding support. Sadly one of the down points in MATLAB is the internal http webserver.

Modelit Webserver Toolbox for Matlab

To overcome this the Modelit Webserver Toolbox for Matlab has been used. During the test runs the following prosumers were simulated in MATLAB Simulink, which were all based upon real world datasets: One wind power plant, two domestic homes, one refrigerated warehouse, one solar power plant and finally one combined heat and power plant. To evaluate the control solution the MATLAB model did determine the grid frequency as a quality factor and send it back to the control as well. As the control runs in cycles of less than half a second the webserver did process several requests in parallel each 0.5 seconds running on an elderly 1.8GHz Pentium M processor. Even during intensive testing the webserver was found to be very stable and responsive. At no point the inter control-simulation communication was a bottleneck.