diff --git a/OpenIPSL/Examples/ModelPredictiveControl.mo b/OpenIPSL/Examples/ModelPredictiveControl.mo index 5c5ca566f..8edc4a4e5 100644 --- a/OpenIPSL/Examples/ModelPredictiveControl.mo +++ b/OpenIPSL/Examples/ModelPredictiveControl.mo @@ -6643,9 +6643,11 @@ package ModelPredictiveControl d_t=1000) annotation (Placement(transformation(extent={{100,-30},{120,-10}}))); - inner Modelica.Blocks.Noise.GlobalSeed globalSeed(useAutomaticSeed=false, + inner Modelica.Blocks.Noise.GlobalSeed globalSeed( + enableNoise=true, + useAutomaticSeed=false, fixedSeed=10000) - annotation (Placement(transformation(extent={{-42,102},{-22,122}}))); + annotation (Placement(transformation(extent={{-44,102},{-24,122}}))); Modelica.Blocks.Sources.Sine sine( amplitude=0.01, f=1/260, @@ -6735,7 +6737,7 @@ package ModelPredictiveControl annotation (Placement(transformation(extent={{184,50},{204,70}}))); Modelica.Blocks.Interfaces.RealOutput OUT23 annotation (Placement(transformation(extent={{184,30},{204,50}}))); - Modelica.Blocks.Interfaces.RealOutput OUT24 + Modelica.Blocks.Interfaces.RealOutput OUT24 annotation (Placement(transformation(extent={{184,10},{204,30}}))); Modelica.Blocks.Interfaces.RealOutput OUT25 annotation (Placement(transformation(extent={{184,-10},{204,10}}))); @@ -6803,11 +6805,21 @@ package ModelPredictiveControl G=0, B=0) annotation (Placement(transformation(extent={{38,-94}, {50,-86}}))); - Electrical.Loads.NoiseInjections.WhiteNoiseInjection whiteNoiseInjection( - active_sigma=0.001, samplePeriod=0.01) - annotation (Placement(transformation(extent={{68,-18},{80,-6}}))); Modelica.Blocks.Math.Add add - annotation (Placement(transformation(extent={{86,-18},{94,-10}}))); + annotation (Placement(transformation(extent={{84,-18},{92,-10}}))); + Modelica.Blocks.Sources.RealExpression realExpression(y=Bus5.v) + annotation (Placement(transformation(extent={{22,-160},{42,-140}}))); + NonElectrical.Continuous.SimpleLag simpleLag( + K=1, + T=0.1, + y_start=powerFlow.powerflow.bus.V5) + annotation (Placement(transformation(extent={{60,-160},{80,-140}}))); + Modelica.Blocks.Interfaces.RealOutput V5filtered + "Connector of Real output signal" + annotation (Placement(transformation(extent={{96,-160},{116,-140}}))); + Electrical.Loads.NoiseInjections.WhiteNoiseInjection whiteNoiseInjection( + active_sigma=0.0002, samplePeriod=0.5) + annotation (Placement(transformation(extent={{64,-18},{76,-6}}))); equation OUT1 = G2.gen.w; @@ -6936,12 +6948,17 @@ package ModelPredictiveControl 10},{80,16}}, color={0,0,255})); connect(Bus7.p, L4.p) annotation (Line(points={{30,10},{34.3,10},{34.3,10},{38.6, 10}}, color={0,0,255})); - connect(sine.y, add.u2) annotation (Line(points={{80.5,-31},{85.2,-31},{85.2,-16.4}}, - color={0,0,127})); - connect(whiteNoiseInjection.y, add.u1) annotation (Line(points={{80.54,-12.06}, - {82.87,-12.06},{82.87,-11.6},{85.2,-11.6}}, color={0,0,127})); - connect(add.y, Load2.u) annotation (Line(points={{94.4,-14},{98.15,-14},{98.15, - -14.5},{101.9,-14.5}}, color={0,0,127})); + connect(add.y, Load2.u) annotation (Line(points={{92.4,-14},{97.15,-14}, + {97.15,-14.5},{101.9,-14.5}}, color={0,0,127})); + connect(add.u2, sine.y) annotation (Line(points={{83.2,-16.4},{83.2,-22}, + {80.5,-22},{80.5,-31}}, color={0,0,127})); + connect(realExpression.y, simpleLag.u) + annotation (Line(points={{43,-150},{58,-150}}, color={0,0,127})); + connect(simpleLag.y, V5filtered) + annotation (Line(points={{81,-150},{106,-150}}, color={0,0,127})); + connect(whiteNoiseInjection.y, add.u1) annotation (Line(points={{76.54, + -12.06},{79.87,-12.06},{79.87,-11.6},{83.2,-11.6}}, color={0,0, + 127})); annotation (Placement(transformation(extent={{140,-20},{160,0}})), Placement(transformation(extent={{140,-40},{160,-20}})), Placement(transformation(extent={{140,-60},{160,-40}})), @@ -6987,8 +7004,8 @@ package ModelPredictiveControl
Note the behavior of those variables before and after the connection of generator G2 to the main grid.