functionimpulseResponse
Calculate the impulse time response of a discrete state space system
Extends from Modelica_LinearSystems2.Internal.timeResponseMask_discrete (Declares the common structure for the set of response functions).
Information
Syntax
(y) = DiscreteStateSpace.Analysis.impulseResponse(dss)
(y, t, x) = DiscreteStateSpace.Analysis.impulseResponse(dss, tSpan)
Description
Starting at x(t=0)=0 and y(t=0)=C*x0 + D*u0, the outputs y and states x are calculated for each time step t=k*dss.Ts. The function call
DiscreteStateSpace.Analysis.impulseResponse(dss, tSpan)
gives the same result as
DiscreteStateSpace.Analysis.timeResponse(dss, tSpan, response=Types.TimeResponse.Impulse, x0=fill(0,size(ss.A,1))).
Note that an appropriate impulse response of a discrete system that is comparable to the impulse response of the corresponding continuous system requires the "ImpulseExact" conversion from continuous system to discrete system.
Example
Modelica_LinearSystems2.DiscreteStateSpace dss=Modelica_LinearSystems2.DiscreteStateSpace(
A=[0.904837418036 ],
B=[0.095162581964],
C=[2],
D=[0],
B2=[0],
Ts=0.1,
method = Modelica_LinearSystems2.Types.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.impulseResponse(dss,tSpan);
// y[:,1,1] = {0, 0.190, 0.1722, 0.1558, 0.1410}
// t = {0, 0.1, 0.2, 0.3, 0.4}
// x[:,1,1] = = {0, 0.0952, 0.08611, 0.0779, 0.07050}
See also
DiscreteStateSpace.Analysis.timeResponse, StateSpace.Analysis.impulseResponse
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| DiscreteStateSpace | dss (from timeResponseMask_discrete) | Discrete state space system | |
| Real | tSpan (from timeResponseMask_discrete) | 0 | Simulation time span [s] |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,size(dss.C, 1),size(dss.B, 2)] | y (from timeResponseMask_discrete) | Output response: (number of samples) x (number of outputs) x (number of inputs) | |
| Real[:] | t (from timeResponseMask_discrete) | Time vector: (number of samples) | |
| Real[:,size(dss.A, 1),size(dss.B, 2)] | x_discrete (from timeResponseMask_discrete) | State trajectories: (number of samples) x (number of states) x (number of inputs) |