Clear Filters
Clear Filters

How can I automate PowerGui Load Flow simulations to change the value of variables in the model and record the Load Flow Data?

1 view (last 30 days)
I have created a model of a LV Electrical Residential Network in Simulink. I have created variables using the InitFcn Callback to set the parameters values of each block used in the model (house load values, generator values, line parameters etc). For the load values I have created a vector with varying values representing the fluctuation of the load throughout a standard day. I have been performing Load Flow simulations using the powergui, for each of these different load values. The process I have been using is as follows:
1. Open Model Properties -> InitFcn
2. Set the value for the load by setting the load variable to equal the desired load value from the load vector using vector indexing e.g. Load = LoadVector(1)
3. Apply InitFcn to model -> Open Powergui -> Open Load Flow -> Perform Load Flow Simulation -> Copy data into excel spreadsheet
4. Repeat from step 1 and increment vector index.
As you can see this is quite a tedious process, considering I have 24 load values in the vector. For this reason, I am now trying to find a way to automate this process so I only have to run the Load Flow Simulation once. This would have to allow the Vector index to be automatically increased, load flow to be performed for each index and data recorded for each index.
I cannot use the power_loadflow('-v2',sys,'solve','ExcelReport',fname) function as it is only compatible with positive-sequence load flow.
I am thinking I may be able to do this if there is a Simulink feature which operates similar to the MS Excel Macro Recorder, but haven't had much luck. Either that or somehow using other types of callbacks but I have little experience with this area.
Any help would be greatly appreciated.
Regards James

Answers (0)

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!