From 5362fbef0f76ff07bd858ead1c98168c9841db11 Mon Sep 17 00:00:00 2001 From: tobolar Date: Fri, 10 May 2024 10:59:35 +0200 Subject: [PATCH] Use imports consequently in Examples.DiscreteStateSpace --- .../DiscreteStateSpace/analysisTimeResponse.mo | 15 +++++---------- .../Examples/DiscreteStateSpace/plotBodeSISO.mo | 4 ++-- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/Modelica_LinearSystems2/Examples/DiscreteStateSpace/analysisTimeResponse.mo b/Modelica_LinearSystems2/Examples/DiscreteStateSpace/analysisTimeResponse.mo index e28a5f55..b905cf80 100644 --- a/Modelica_LinearSystems2/Examples/DiscreteStateSpace/analysisTimeResponse.mo +++ b/Modelica_LinearSystems2/Examples/DiscreteStateSpace/analysisTimeResponse.mo @@ -4,6 +4,7 @@ function analysisTimeResponse extends Modelica.Icons.Function; import Modelica_LinearSystems2.DiscreteStateSpace; + import Modelica_LinearSystems2.Utilities.Plot; input Real u[:,2]=ones(300, 2); protected @@ -30,17 +31,11 @@ algorithm t := 0:dss.Ts:(samples*dss.Ts - dss.Ts); (y,x) := DiscreteStateSpace.timeResponse(dss, u, x0); - Modelica_LinearSystems2.Utilities.Plot.diagram( - Modelica_LinearSystems2.Utilities.Plot.Records.Diagram( + Plot.diagram( + Plot.Records.Diagram( curve={ - Modelica_LinearSystems2.Utilities.Plot.Records.Curve( - x=t, - y=y[:,1], - legend="y1"), - Modelica_LinearSystems2.Utilities.Plot.Records.Curve( - x=t, - y=y[:,2], - legend="y2")}, + Plot.Records.Curve(x=t, y=y[:,1], legend="y1"), + Plot.Records.Curve(x=t, y=y[:,2], legend="y2")}, heading="Step response to synchronous step of u1 and u2", xLabel="time [s]", yLabel="y1, y2")); diff --git a/Modelica_LinearSystems2/Examples/DiscreteStateSpace/plotBodeSISO.mo b/Modelica_LinearSystems2/Examples/DiscreteStateSpace/plotBodeSISO.mo index d9d8c451..18764546 100644 --- a/Modelica_LinearSystems2/Examples/DiscreteStateSpace/plotBodeSISO.mo +++ b/Modelica_LinearSystems2/Examples/DiscreteStateSpace/plotBodeSISO.mo @@ -3,7 +3,7 @@ function plotBodeSISO "Bode plot of a discrete state space system" extends Modelica.Icons.Function; import Modelica_LinearSystems2.DiscreteStateSpace; - input DiscreteStateSpace dss=Modelica_LinearSystems2.DiscreteStateSpace( + input DiscreteStateSpace dss = DiscreteStateSpace( A=[0.995166584721977,0.0950040833529266,0.0,0.0,0.0,0.0; -0.0950040833529266, 0.90016250136905,0.0,0.0,0.0,0.0; 0.00676921321653657,0.00700084602310958, 0.98598654522888,0.0901824307998049,0.0,0.0; 0.128272800176598,0.135042013393134, @@ -28,7 +28,7 @@ algorithm assert(iy <= size(dss.C, 1) and iy > 0, "index for output is " + String(iy) + " which is not in [1, " + String(size(dss.C, 1)) + "]."); - Modelica_LinearSystems2.DiscreteStateSpace.Plot.bodeSISO(dss, iu, iy); + DiscreteStateSpace.Plot.bodeSISO(dss, iu, iy); ok := true; annotation (__Dymola_interactive=true, Documentation(info="