Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

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;

https://framapic.org/g8PSlKYV9O4f/xX3zkhly65Nv.PNG

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

There are 0 guests and 0 other users also viewing this topic
You are here: