ss = StateSpace.'-'.negate(ss1)
This operator function negates the state space system, i.e. the output ss is the negation of the state space input ss1.
The operator is used by writing just the following command:
ss := -ss1;
StateSpace ss1 = StateSpace(A=[-1, 3; 0, -2], B=[1; 2], C=[0.2, 1], D=[0.17]); StateSpace ss; algorithm ss := -ss1; // ss.A = [-1, 3; 0, -2], // ss.B = [1; 2], // ss.C = [-0.2, -1], // ss.D = [-0.17],
function negate import Modelica; import Modelica_LinearSystems2.StateSpace; input StateSpace ss "State-space system"; output StateSpace result(redeclare Real A[size(ss.A, 1), size(ss.A, 2)], redeclare Real B[size(ss.B, 1), size(ss.B, 2)], redeclare Real C[size(ss.C, 1), size(ss.C, 2)], redeclare Real D[size(ss.D, 1), size(ss.D, 2)]) "= -ss"; end negate;