.Modelica_LinearSystems2.StateSpace.Internal.read_dslin

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,          -2.26,    0.08,     1.95,   -0.45;
            0.0,   0.0,           0.0,            1.0,      0.0,     0.0;
            0.0,   0.0,          -3.09,   -1.38,     7.70,   -3.01;
            0.0,   0.0,           0.0,            0.0,      0.0,     1.0;
            0.0,   0.0,          -6.47,    1.637,   -2.90,    1.29],

// ss.B=[0.0; 0.13; 0.0; -0.014; 0.0; -0.1],
// ss.C=identity(6),
// ss.D=[0; 0; 0; 0; 0; 0]

Interface

function read_dslin
  import Modelica;
  import DymolaCommands;
  import Modelica_LinearSystems2.StateSpace;
  input String fileName = "dslin" "Name of the result file";
  output StateSpace result(redeclare Real A[nx, nx], redeclare Real B[nx, nu], redeclare Real C[ny, nx], redeclare Real D[ny, nu]) "Outputs model linearized at initial point";
end read_dslin;

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