SMIBPartial model. Remember that this model is located in the following path: SMIB.BaseModels.BaseNetwork.
. From the package tree select OpenIPSL.Electrical.Loads.PSSE.BaseClasses.baseLoad as shown in the figure below.
Experiments package, create a new model by duplicating SMIB and name it SMIBVarLoad.
SMIBVarLoad model and change the class to PSS/E Load with variation as indicated in the following picture:
SMIBVarLoad model to the GeneratorTurbGovAVRPSS model. You will find it as "Machine with Turbine, Governor, Excitation System and PSS".
We would like to automatically simulate the SMIB and SMIBVarLoad models and plot their results for comparative purposes. For this to be done we are going to create and call a Modelica function that includes the right sequence of steps.
Experiments package. For this to be done you can go to File > New > Function after selecting the package, or alternatively, you can right-click the package and then click on New > Function. Name the function RunAndCompare. The Experiments package should now look like this:
RunAndCompare function and create 6 input variables as indicated below:
function RunAndCompare
"Runs different instances of the SMIB model to compare their results"
// INPUTS TO THE FUNCTION
input Modelica.Units.SI.Time tsim=100 "Simulation time";
input Integer numberOfIntervalsin=10000 "No. of intervals";
input String methodin = "Dassl" "Solver";
input Real fixedstepsizein= 1e-3 "Time step - needed only for fixed time step solvers";
// MODELS TO SIMULATE
input String modelA="SMIB.Experiments.SMIB";
input String modelB="SMIB.Experiments.SMIBVarLoad";
...
algorithm
simulateModel(
modelA,
stopTime=tsim,
numberOfIntervals=numberOfIntervalsin,
method = methodin,
fixedstepsize=fixedstepsizein,
resultFile="res_casea");
simulateModel(
modelB,
stopTime=tsim,
numberOfIntervals=numberOfIntervalsin,
method = methodin,
fixedstepsize=fixedstepsizein,
resultFile="res_caseb");
removePlots(true);
Advanced.FilesToKeep :=10;
createPlot(id=1, position={15, 15, 678, 703}, y={"B01.V"},
range={0.0, 10.0, 0.4, 1.4}, grid=true, filename="res_casea.mat",
colors={{28,108,200}}, displayUnits={"1"});
createPlot(id=1, position={15, 15, 678, 703}, y={"genunit.P"},
range={0.0, 10.0, -1.5, 2.0}, grid=true, subPlot=102,
colors={{28,108,200}}, displayUnits={"1"});
createPlot(id=1, position={15, 15, 678, 703}, y={"genunit.Q"},
range={0.0, 10.0, -0.5, 2.0}, grid=true, subPlot=103,
colors={{28,108,200}}, displayUnits={"1"});
createPlot(id=1, position={15, 15, 678, 703}, y={"B01.V"},
range={0.0, 10.0, 0.4, 1.4}, erase=false, grid=true,
filename="res_caseb.mat", colors={{238,46,47}}, displayUnits={"1"},
axes={2});
createPlot(id=1, position={15, 15, 678, 703}, y={"genunit.P"},
range={0.0, 10.0, -1.5, 2.0}, erase=false, grid=true, subPlot=102,
colors={{238,46,47}}, displayUnits={"1"},
axes={2});
createPlot(id=1, position={15, 15, 678, 703}, y={"genunit.Q"},
range={0.0, 10.0, -0.5, 2.0}, erase=false, grid=true, subPlot=103,
colors={{238,46,47}}, displayUnits={"1"},
axes={2});
end RunAndCompare;
RunAndCompare function, select the Call Function... option and then press OK. If everything goes well you will get the plots shown below.