(y) = DiscreteStateSpace.Analysis.stepResponse(dss)
(y, t, x) = DiscreteStateSpace.Analysis.stepResponse(dss, tSpan)
Function stepResponse calculates the step response of a discrete state space system. Starting at x(t=0)=0 and y(t=0)=C*x0 + D*u0, the outputs y and the states x are calculated for each time step t=k*dss.Ts. The function call
DiscreteStateSpace.Analysis.stepResponse(dss, tSpan)
gives the same result as
DiscreteStateSpace.Analysis.timeResponse(response=Types.TimeResponse.Step, dss, tSpan, x0=fill(0,size(ss.A,1))).
Note that an appropriate step response of a discrete system that is comparable to the step response of the corresponding continuous system requires the "StepExact" conversion from continuous system to discrete system.
Modelica_LinearSystems2.DiscreteStateSpace dss=Modelica_LinearSystems2.DiscreteStateSpace(
A=[0.904837418036 ],
B=[0.095162581964],
C=[2],
D=[0],
B2=[0],
Ts=0.1,
method = Modelica_LinearSystems2Types.Method.StepExact);
Real tSpan= 0.4;
Real y[5,1,1];
Real t[5];
Real x[5,1,1]
algorithm
(y,t,x) := Modelica_LinearSystems2.DiscreteStateSpace.Analysis.stepResponse(dss,tSpan);
// y[:,1,1]={0, 0.19, 0.3625, 0.518, 0.659}
// t={0, 0.1, 0.2, 0.3, 0.4}
// x[:,1,1]={0, 0.0952, 0.1813, 0.2592, 0.33}
DiscreteStateSpace.Analysis.timeResponse, StateSpace.Analysis.stepResponse
encapsulated function stepResponse import Modelica; import Modelica_LinearSystems2; import Modelica_LinearSystems2.DiscreteStateSpace; extends Modelica_LinearSystems2.Internal.timeResponseMask_discrete; end stepResponse;