functioninitialResponse

Calculate the initial 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.initialResponse(zp, tSpan, x0)

Description

Function initialResponse calculates the time response of a state space system for given initial condition and zero inputs. The system is transformed 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.

DiscreteZerosAndPoles.Analysis.initialResponse(x0, dzp, tSpan)

gives the same result as

DiscreteZerosAndPoles.Analysis.timeResponse(dzp, tSpan, response=Types.TimeResponse.Initial, x0=x0).

Example

  Modelica_LinearSystems2.DiscreteZerosAndPoles dzp=dzp=1/(p^2 + p + 1)
  dzp.Ts=0.1;
  Real tSpan= 0.4;
  Real x0[2] = {1,1};

  Real y[5,1,1];
  Real t[5];
  Real x[5,1,1]

algorithm
  (y,t,x):=Modelica_LinearSystems2.DiscreteZerosAndPoles.Analysis.initialResponse(x0,dzp,tSpan);
//  y[:,1,1 = {0.333333333333, 0.333333333333, -0.666666666667, 0.333333333333,  0.333333333333}
//         t={0, 0.1, 0.2, 0.3, 0.4}
//  x[:,1,1] = {1, 1, -2.0, 1.0, 1}

See also

DiscreteZerosAndPoles.Analysis.timeResponse

Inputs

TypeNameDefaultDescription
Real[:]x0fill(0, 0)Initial state vector
Modelica_LinearSystems2.DiscreteZerosAndPolesdzp (from timeResponseMask_zp_discrete)
RealtSpan (from timeResponseMask_zp_discrete)0Simulation time span [s]

Outputs

TypeNameDefaultDescription
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)