This example shows the usage of function Modelica_LinearSystems2.StateSpace.reduceSystem which compute a controllable and observable state space realization of a given state space realization.
function transformationToIrreducibleForm extends Modelica.Icons.Function; import Modelica_LinearSystems2.StateSpace; input String fileName = DataDir + "abcd_siso2.mat" "file where matrix [A, B; C, D] is stored" annotation( Dialog(group = "system data definition", loadSelector(filter = "MAT files (*.mat);; All files (*.*)", caption = "state space system data file"), enable = systemOnFile)); input String matrixName = "ABCD" "Name of the state space system matrix" annotation( Dialog(group = "system data definition", enable = systemOnFile)); input Real A[:, :] = fill(0, 0, 0); input Real B[:, :] = fill(0, 0, 1); input Real C[:, :] = fill(0, 1, 0); input Real D[:, :] = fill(0, 1, 1); output Boolean ok; end transformationToIrreducibleForm;