#2900 closed defect (duplicate)
Assign Value to A Complex Parameter
Reported by: | Owned by: | MJ | |
---|---|---|---|
Priority: | high | Milestone: | never |
Component: | Frontend | Version: | trunk |
Keywords: | Complex | Cc: | Willi Braun |
Description
Hi,
Does anyone know why the complex math operator doesn't work in the parameter declaration ?
I want to compute C as a product of two complex parameters. The code is following :
parameter Complex A(re = 1, im = 2) ;
parameter Complex B(re = 1, im = 2) ;
parameter Complex C= A * B ;
But the value for C wouldn't be A*B in this case.
There are warning shows up as following:
Warning: Parameter C.im has no value, and is fixed during initialization (fixed=true), using available start value (start=0.0) as default value.
Warning: Parameter C.re has no value, and is fixed during initialization (fixed=true), using available start value (start=0.0) as default value.
I have tried to build the operator as math function inside the model like ComplexDivide. But still it didn't work. The warning was still there.
parameter Complex C= ComplexDivide(A, B);
Change History (4)
comment:1 by , 10 years ago
comment:2 by , 10 years ago
It's also working fine for me. (1.9.1+dev (r22778) (Bootstrapping version))
I just run the following script:
loadModel(Complex); getErrorString(); loadString(" model foo parameter Complex A(re = 1, im = 2); parameter Complex B(re = 1, im = 2); parameter Complex C= A * B; end foo; "); getErrorString(); instantiateModel(foo); getErrorString(); simulate(foo); getErrorString();
comment:3 by , 10 years ago
Cc: | added; removed |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
Is related to #2902, so duplicate.
comment:4 by , 9 years ago
Milestone: | Future → never |
---|
Sorting away the closed as invalid, won't fix and duplicate tickets from Future.
Which version of OpenModelica are you running? I get: