DiscreteStateSpace.Plot.timeResponse(dss); or DiscreteStateSpace.Plot.timeResponse( dss, tSpan, response, x0, defaultDiagram=Modelica_LinearSystems2.Internal.DefaultDiagramTimeResponse(), device=Modelica_LinearSystems2.Utilities.Plot.Records.Device())
This function plots the time response of a discrete state space system. The character of the time response if defined by the input response, i.e. Impulse, Step, Ramp, or Initial.
import Modelica_LinearSystems2.DiscreteStateSpace; Modelica_LinearSystems2.StateSpace ss=Modelica_LinearSystems2.StateSpace( A=[-1.0,0.0,0.0; 0.0,-2.0,3.0; 0.0,-2.0,-3.0], B=[1.0; 1.0; 0.0], C=[0.0,1.0,1.0], D=[0.0]) Real Ts = 0.1; Modelica_LinearSystems2.Types.Method method=Modelica_LinearSystems2.Types.Method.StepExact; DiscreteStateSpace dss=DiscreteStateSpace(ss,Ts,method); Types.TimeResponse response=Modelica_LinearSystems2.Types.TimeResponse.Step; algorithm DiscreteStateSpace.Plot.timeResponse(dss, response=response);
impulse, step, ramp, initialResponse
encapsulated function timeResponse import Modelica_LinearSystems2; import Modelica_LinearSystems2.DiscreteStateSpace; import Modelica_LinearSystems2.Utilities.Types.TimeResponse; import Modelica_LinearSystems2.Utilities.Plot; input DiscreteStateSpace dss; input Real tSpan = 0 "Simulation time span [s]"; input TimeResponse response = TimeResponse.Step; input Real x0[size(dss.A, 1)] = zeros(size(dss.A, 1)) "Initial state vector"; input Boolean subPlots = true "True, if all subsystem time responses are plotted in one window with subplots" annotation( choices(checkBox = true)); extends Modelica_LinearSystems2.Internal.PartialPlotFunctionMIMO(defaultDiagram = Modelica_LinearSystems2.Internal.DefaultDiagramTimeResponse(heading = "Time response")); end timeResponse;