same = StateSpace.'=='(ss1, ss2)
This operator function returns true, if all appropriate matrices of two state space systems ss1 and ss2 are identical. False is returned in any other case.
The operator is used by writing just the following command:
same := ss1 == ss2;
StateSpace ss1 = StateSpace(A=[-1, 0; 0, -2], B=[1; 2], C=[0, 1], D=[0]); StateSpace ss2 = StateSpace(A=[-3, 0; 0, -4], B=[3; 4], C=[0, 2], D=[0.2]); StateSpace ss3 = StateSpace(A=[-3, 0; 0, -4], B=[3; 4], C=[0, 2], D=[0.2]); ss1 == ss2; // false ss2 == ss3; // true
encapsulated operator function '==' import Modelica.Math.Matrices.isEqual; import Modelica_LinearSystems2.StateSpace; input StateSpace ss1 "State space system 1"; input StateSpace ss2 "State space system 2"; input Real eps(min = 0) = 0 "Two elements e1 and e2 of the two systems are identical if abs(e1-e2) <= eps"; output Boolean same "=true, if the two systems are identical"; end '==';