.Modelica_LinearSystems2.Utilities.Streams.readSystemDimension

Information

Syntax

xuy = Streams.readSystemDimension(fileName, matrixName);

Description

Opens the given MATLAB MAT file and reads the dimensions of state matrix matrixName. Returns the order nx of the matrix and the numbers nu and ny of inputs and outputs, ordered as

xuy[3] = {nx, nu, ny};

Example

// Generate dslin.mat of the double pendulum example first
Modelica_LinearSystems2.Utilities.Import.linearize(
  "Modelica_LinearSystems2.Utilities.Plants.DoublePendulum", 1.0);

// Read dimensions of state matrix of the linearized system
readSystemDimension("dslin.mat", "ABCD")
//   = {6, 1, 8}

Interface

function readSystemDimension
  extends Modelica.Icons.Function;
  import Modelica.Utilities.Streams;
  input String fileName = "stateSpace.mat" "File containing the matrix matrixName, e.g. A.mat, dsin.txt" annotation(
    Dialog(loadSelector(filter = "MAT files (*.mat);; All files (*.*)", caption = "State space system data file")));
  input String matrixName = "ABCD" "Name of the generalized state space system matrix";
  output Integer xuy[3] "Order of matrixName; size of u; size of y";
end readSystemDimension;

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