ss = StateSpace.'constructor'.fromABCDMatrices(A, B, C, D)
This function constructs a StateSpace record ss with
ss.A = A; ss.B = B; ss.C = C; ss.D = D;
Real A[1,1] = [1]; Real B[1,1] = [1]; Real C[1,1] = [1]; Real D[1,1] = [0]; public StateSpace ss; algorithm ss := 'constructor'.fromABCDMatrices(A, B, C, D); // ss.A = [1] // ss.B = [1] // ss.C = [1] // ss.D = [0]
function fromABCDMatrices import Modelica; import Modelica_LinearSystems2; import Modelica_LinearSystems2.StateSpace; input Real A[:, size(A, 1)] "System matrix"; input Real B[size(A, 1), :] = fill(0.0, size(A, 1), 0) "Input matrix"; input Real C[:, size(A, 1)] = fill(0.0, 0, size(A, 1)) "Output matrix"; input Real D[size(C, 1), size(B, 2)] = fill(0.0, 0, 0) "Feedforward matrix"; input String uNames[size(B, 2)] = fill("", size(B, 2)) "Names of the input signals"; input String yNames[size(C, 1)] = fill("", size(C, 1)) "Names of the output signals"; input String xNames[size(A, 2)] = fill("", size(A, 2)) "Names of the states"; output StateSpace result(redeclare Real A[size(A, 1), size(A, 2)], redeclare Real B[size(B, 1), size(B, 2)], redeclare Real C[size(C, 1), size(C, 2)], redeclare Real D[size(D, 1), size(D, 2)], redeclare String uNames[size(B, 2)], redeclare String yNames[size(C, 1)], redeclare String xNames[size(A, 2)]) "State space record"; end fromABCDMatrices;