.Modelica_LinearSystems2.StateSpace.Import.fromModel

Generate a StateSpace data record by linearization of a model

Information

Syntax

ss = StateSpace.Import.fromModel(modelName, T_linearize, fileName)

Description

Generate a StateSpace data record by linearization of a model defined by modelName. The linearization is performed at time T_linearize of the simulation. The result of linearization is transformed into a StateSpace record.

Example

  String modelName = "Modelica_LinearSystems2.Utilities.Plants.DoublePendulum";
  Real T_linearize = 5;

algorithm
  ss = Modelica_LinearSystems2.StateSpace.Import.fromModel(modelName, T_linearize);

// ss.A = [ 0.0,  1.0,    0.0  ,   0.0      0.0     0.0  ;
//          0.0,  0.0,    3.715,  -1.299   -3.374   0.116;
//          0.0,  0.0,    0.0  ,   1.0      0.0     0.0  ;
//          0.0,  0.0,  -12.738,   2.064  -23.625   4.437;
//          0.0,  0.0,    0.0  ,   0.0      0.0     1.0  ;
//          0.0,  0.0,   26.720,   4.435   36.990  -6.370 ],
// ss.B = [ 0,  0.157,  0, -0.167,  0,  0.285 ],
// ss.C = identity(6),
// ss.D = [ 0; 0; 0; 0; 0; 0 ]

Interface

function fromModel
  import Modelica;
  import DymolaCommands;
  import Simulator = DymolaCommands.SimulatorAPI;
  import Modelica_LinearSystems2.StateSpace;
  input String modelName "Name of the model" annotation(
    Dialog(__Dymola_translatedModel(translate = true)));
  input Real T_linearize = 0 "Simulate until T_linearize and then linearize the model";
  input String fileName = "dslin" "Name of the result file";
  input String method = "Dassl" "Integration method";
  output StateSpace result(redeclare Real A[nx, nx], redeclare Real B[nx, nu], redeclare Real C[ny, nx], redeclare Real D[ny, nu]) "State space description of model linearized at initial point";
end fromModel;

Revisions

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

Generated at 2025-12-13T19:13:59Z by OpenModelicaOpenModelica 1.25.7 using GenerateDoc.mos