functionimpulseResponse
Calculate the impulse time response of a discrete zeros-and-poles transfer function
Extends from Modelica_LinearSystems2.Internal.timeResponseMask_zp_discrete (Declares the common structure for the set of discrete response functions).
Information
Syntax
(y, t, x)=DiscreteZerosAndPoles.Analysis.impulseResponse(dzp, tSpan, x0)
Description
Function impulseResponse calculates the time response of a DiscreteZerosAndPoles transfer function with impulse imput. After transforming the DiscreteZerosAndPoles representation to DiscreteStateSpace the values of the impulse response are calculated starting from x(t=0)=0 and y(t=0)=C*x0 + D*u0 for each time step t=k*dt.
DiscreteZerosAndPoles.Analysis.impulseResponse(dzp, tSpan)
gives the same result as
DiscreteZerosAndPoles.Analysis.timeResponse(dzp, tSpan, response=Types.TimeResponse.Impulse, x0=fill(0,DiscreteZerosAndPoles.Analysis.denominatorDegree(dzp))).
Example
Modelica_LinearSystems2.DiscreteZerosAndPoles dzp=dzp=1/(q^2 + q + 1)
dzp.Ts=0.1;
Real tSpan= 0.4;
Real y[5,1,1];
Real t[5];
Real x[5,1,1]
algorithm
(y,t,x):=Modelica_LinearSystems2.DiscreteZerosAndPoles.Analysis.impulseResponse(dzp,tSpan);
// y[:,1,1]={0, 0, 1, -1.0, 2.96059473233375E-016}
// t={0, 0.1, 0.2, 0.3, 0.4}
// x[:,1,1]={0, 0, 3.0, -3.0, 8.88178419700125E-016}
See also
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica_LinearSystems2.DiscreteZerosAndPoles | dzp (from timeResponseMask_zp_discrete) | ||
| Real | tSpan (from timeResponseMask_zp_discrete) | 0 | Simulation time span [s] |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,1,1] | y (from timeResponseMask_zp_discrete) | Output response: (number of samples) x (number of outputs) x (number of inputs) | |
| Real[:] | t (from timeResponseMask_zp_discrete) | Time vector: (number of samples) | |
| Real[:,Modelica_LinearSystems2.DiscreteZerosAndPoles.Analysis.denominatorDegree(dzp),1] | x_discrete (from timeResponseMask_zp_discrete) | State trajectories: (number of samples) x (number of states) x (number of inputs) |