.Modelica_LinearSystems2.Utilities.Streams.readMatrixD2

Information

Syntax

D = Streams.readMatrixD2(fileName, matrixName, nx, nu, ny);

Description

Opens the given MATLAB MAT file and returns the submatrix D of the matrix matrixName given as

D[ny, nu] = ABCD[nx+1:nx+ny, nx+1:nx+nu];

Example

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

// Read D matrix of the linearized system
readMatrixD2("dslin.mat", "ABCD", 6, 1, 8)
//  = 
// [0.0;
// 0.0;
// 0.0;
// 0.0;
// 0.0;
// 0.0;
// 0.0;
// 0.0]

Interface

function readMatrixD2
  extends Modelica.Icons.Function;
  input String fileName = DataDir + "abcd.mat" 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";
  input Integer nx "System order";
  input Integer nu "Number of inputs";
  input Integer ny "Number of outputs";
  output Real D[ny, nu] = ABCD[nx + 1:nx + ny, nx + 1:nx + nu];
end readMatrixD2;

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