.Modelica_LinearSystems2.Examples.StateSpace.analysisTimeResponse

Information

Computes the time response of the system StateSpace sc = StateSpace(A=[-1,1;0,-2],B=[1, 0;0, 1],C=[1,0; 0,1],D=[0, 0; 0, 0]), sampled at Ts=0.01 with inititial state x0=[0;0] subject to the system input u = ones(samples,2), (samples is set to 30).

Interface

function analysisTimeResponse
  extends Modelica.Icons.Function;
  import Modelica_LinearSystems2.StateSpace;
  import Modelica_LinearSystems2.Utilities.Types.TimeResponse;
  import Modelica_LinearSystems2.Utilities.Plot;
  input StateSpace sc = StateSpace(A = [-1, 1; 0, -2], B = [1, 0; 0, 1], C = [1, 0; 0, 1], D = [0, 0; 0, 0]);
  input TimeResponse response = TimeResponse.Step;
  input Real dt = 0.01;
  input Real span = 5;
  output Real y[samples, 2, 2] "System response (dimension: (input samples) x (number of outputs))";
  output Real t[samples] "Time vector used for simulation";
  output Real x[samples, 2, 2] "State trajectories (dimension: (input samples) x (number of states)";
end analysisTimeResponse;

Generated at 2024-11-23T19:25:52Z by OpenModelicaOpenModelica 1.24.2 using GenerateDoc.mos