with B and C are symmetric matrices. They holdT X = A*B*A + C.
where Bu and Cu withB = Bu + Bl and C = Cu + Cl,
are upper triangular matrices. Furthermore, the matrices are defined such that i.e.,T T Bu = Bl and Cu = Cl
and cu,ij respectively.| bij/2 for i = j bu,ij = | | bij else
Since, X also has to be symmetric, only the upper triangle of X is computed by calculatiing the upper triangle of matrix E and adding the upper trinagle of E'.T T T T T T T X = A*(Bu+Bl)*A + (Cu+Cl) = A*Bu*A + A*Bl*A + (Cu+Cl) = A*Bu*A + Cu + (A*Bu*A + Cu) = E + E
In contrast to function symMatMul this function is implemented in C-codeX := symmetric(X)
function symMatMul_C extends Modelica.Icons.Function; import Modelica; import Modelica_LinearSystems2; import Modelica_LinearSystems2.Math.Matrices.LAPACK; input Real A[:, :]; input Real B[size(A, 2), size(A, 2)]; input Real C[size(A, 1), size(A, 1)]; input Boolean add = true "Value is true if a==1, false if a==0"; output Real M[size(A, 1), size(A, 1)] = C; end symMatMul_C;
Date | Author | Comment |
---|---|---|
2010-05-31 | Marcus Baur, DLR-RM | Realization |