.Modelica_LinearSystems2.StateSpace.Analysis.initialResponse

Information

Syntax

(y, t, x) = StateSpace.Analysis.initialResponse(ss, 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.

StateSpace.Analysis.initialResponse(x0,ss, dt, tSpan)

gives the same result as

StateSpace.Analysis.timeResponse(ss, dt, tSpan, response=Types.TimeResponse.Initial, x0=x0).

Example

   Modelica_LinearSystems2.StateSpace ss=Modelica_LinearSystems2.StateSpace(
      A=[-1],
      B=[1],
      C=[2],
      D=[0]);
  Real Ts=0.1;
  Real tSpan= 0.4;
  Real x0[2] = {1};

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

algorithm
  (y,t,x):=StateSpace.Analysis.initialResponse(x0,ss,Ts,tSpan);
//  y[:,1,1]={2, 1.809, 1.637, 1.4812, 1.3402}
//         t={0, 0.1, 0.2, 0.3, 0.4}
//  x[:,1,1]={1, 0.9048, 0.8186, 0.7406, 0.6701}

See also

StateSpace.Analysis.timeResponse

Interface

encapsulated function initialResponse
  import Modelica;
  import Modelica_LinearSystems2;
  input Real x0[:] = fill(0, 0) "Initial state vector";
  extends Modelica_LinearSystems2.Internal.timeResponseMask2(redeclare Real y[:, size(sc.C, 1), 1], redeclare Real x_continuous[:, size(sc.A, 1), 1]);
end initialResponse;

Revisions

Date Author Comment
2010-05-31 Marcus Baur, DLR-RM Realization

Generated at 2024-03-28T19:15:55Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos