functiontimeResponse
Calculate the time response of a zeros-and-poles transfer function
Extends from Modelica_LinearSystems2.Internal.timeResponseMask2_zp (Declares the common structure for the set of response functions).
Information
Syntax
(y, t, x) = ZerosAndPoles.Analysis.timeResponse(zp, dt, tSpan, responseType, x0)
Description
First, the ZerosAndPoles record is transformed into state space representation which is given to StateSpace.Analysis.timeResponse to calculate the time response of the state space system. The type of the time response is defined by the input responseType, i.e.
Impulse "Impulse response", Step "Step response", Ramp "Ramp response", Initial "Initial condition response"
The state space system is transformed to a appropriate discrete state space system and, starting at x(t=0)=x0 and y(t=0)=C*x0 + D*u0, the outputs y and x are calculated for each time step t=k*dt.
Example
p=Modelica_LinearSystems2.ZerosAndPoles.p();
Modelica_LinearSystems2.ZerosAndPoles zp=1/(p^2 + p + 1)
Real Ts=0.1;
Real tSpan= 0.4;
Modelica_LinearSystems2.Types.TimeResponse response=Modelica_LinearSystems2.Types.TimeResponse.Step;
Real x0[2]={0,0};
Real y[5,1,1];
Real t[5];
Real x[5,1,1]
algorithm
(y,t,x):=Modelica_LinearSystems2.ZerosAndPoles.Analysis.timeResponse(zp,Ts,tSpan,response,x0);
// y[:,1,1]={0, 0.0048, 0.0187, 0.04, 0.0694}
// t={0, 0.1, 0.2, 0.3, 0.4}
// x[:,1,1]={0, 0.0048, 0.0187, 0.04, 0.0694}
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| Modelica_LinearSystems2.ZerosAndPoles | zp (from timeResponseMask2_zp) | ||
| Real | dt (from timeResponseMask2_zp) | 0 | Sample time [s] |
| Real | tSpan (from timeResponseMask2_zp) | 0 | Simulation time span [s] |
| Modelica_LinearSystems2.Utilities.Types.TimeResponse | response | Modelica_LinearSystems2.Utilities.Types.TimeResponse.Step | |
| Real[Modelica_LinearSystems2.ZerosAndPoles.Analysis.denominatorDegree(zp)] | x0 | zeros(Modelica_LinearSystems2.ZerosAndPoles.Analysis.denominatorDegree(zp)) | Initial state vector |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Real[:,1,1] | y (from timeResponseMask2_zp) | Output response: (number of samples) x (number of outputs) x (number of inputs) | |
| Real[:] | t (from timeResponseMask2_zp) | Time vector: (number of samples) | |
| Real[:,Modelica_LinearSystems2.ZerosAndPoles.Analysis.denominatorDegree(zp),1] | x_continuous (from timeResponseMask2_zp) | State trajectories: (number of samples) x (number of states) x (number of inputs) |