functionrampResponse
Calculate the ramp time response
Extends from Modelica_LinearSystems2.Internal.timeResponseMask2_zp (Declares the common structure for the set of response functions).
Information
Syntax
(y, t, x) = ZerosAndPoles.Analysis.rampResponse(zp, dt, tSpan)
Description
Function rampResponse calculates the time response of a transfer function for ramp imput u = t. The state space system is transformed to a appropriate discrete state space system and, starting at x(t=0)=0 and y(t=0)=C*x0 + D*u0, the outputs y and x are calculated for each time step t=k*dt.
ZerosAndPoles.Analysis.rampResponse(zp, dt, tSpan)
gives the same result as
ZerosAndPoles.Analysis.timeResponse(zp, dt, tSpan, response=Types.TimeResponse.Ramp, x0=fill(0,ZerosAndPoles.Analysis.denominatorDegree(zp))).
Example
Modelica_LinearSystems2.ZerosAndPoles zp=zp=1/(p^2 + p + 1)
Real 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.ZerosAndPoles.Analysis.rampResponse(zp,Ts,tSpan);
// y[:,1,1]={0, 0.0002, 0.0012, 0.0042, 0.0096}
// t={0, 0.1, 0.2, 0.3, 0.4}
// x[:,1,1]={0, 0.0002, 0.0012, 0.0042, 0.0096}
See also
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] |
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) |