- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Simple product of matrixes of complex...
Simple product of matrixes of complex numbers in equations
Simple product of matrixes of complex numbers in equations
Hi everyone,
while I was trying to work with matrixes of complex numbers, I encountered some troubles to make the simple product of a matrix A with a matrix B.
Indeed, in the first case, when I implement the following code, it works without any problem:
Code:
model tset
import Modelica.ComplexMath.*;
Complex A[2,2] = [Complex(0,0), Complex(2,3);Complex(2,2),Complex(1,3)];
Complex B[2,2] = [Complex(2,1), Complex(2,3);Complex(2,2),Complex(1,3)];
Complex C[2,2];
equation
A*B = C;
end tset;
However, this piece of code gives an error, even before the compilation:
Code:
model tset
import Modelica.ComplexMath.*;
Complex A[2,2] = [Complex(0,0), Complex(2,3);Complex(2,2),Complex(1,3)];
Complex B[2,2] = [Complex(2,1), Complex(2,3);Complex(2,2),Complex(1,3)];
Complex C[2,2];
equation
C = A*B;
end tset;
I don't know what causes this problem. I even verified if the problem persists with matrixes of reals, and the thing is with matrixes of reals, it works fine in both ways.
Would you have an idea on what causes this trouble and how to solve it?
Thanks,
WilliamEnergy
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Simple product of matrixes of complex...