.Modelica_LinearSystems2.ZerosAndPoles.Analysis.initialResponse

Information

Syntax

(y, t, x) = ZerosAndPoles.Analysis.initialResponse(zp, dt, tSpan, x0)

Description

Function initialResponse calculates the time response of a state space system for given initial condition and zero inputs. 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.initialResponse(x0,zp, dt, tSpan)

gives the same result as

ZerosAndPoles.Analysis.timeResponse(zp, dt, tSpan, response=Types.TimeResponse.Initial, x0=x0).

Example

  Modelica_LinearSystems2.ZerosAndPoles zp=zp=1/(p^2 + p + 1)
  Real 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.ZerosAndPoles.Analysis.initialResponse(x0,zp,Ts,tSpan);
//  y[:,1,1]={1, 1.0903, 1.1616, 1.2151, 1.252}
//         t={0, 0.1, 0.2, 0.3, 0.4}
//  x[:,1,1]={1, 1.0903, 1.1616, 1.2151, 1.252}

See also

ZerosAndPoles.Analysis.timeResponse

Interface

encapsulated function initialResponse
  import Modelica;
  import Modelica_LinearSystems2;
  import Modelica_LinearSystems2.ZerosAndPoles;
  input Real x0[:] = fill(0, 0) "Initial state vector";
  extends Modelica_LinearSystems2.Internal.timeResponseMask2_zp;
end initialResponse;

Generated at 2024-04-24T18:15:52Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos