Closed pkroenert closed 4 years ago
This is by design since complex conjugation is not algebraic. If your model involves a variable and their complex conjugate, then you need to introduce two separate variables and an additional constraint linking the two together.
Thank you very much for the fast reply!
By the way, a very nice package!
I am struggling to find an additional constraints between the the complex number z
and it's complex conjugate \bar{z}
.
I'm not sure if it is even possible to establish a constraint, when only +,-,*,/ is allowed.
Do you have an additional advice for me?
Can you describe me a small example of the kind of problem you like to solve?
Of course:
Define a vector of complex variables:
vec=[b1,b2,b3]
matrices=[mat1,mat2,mat3]
Calculate the bilinear product:
f1 = adjoint(vec) * matrices[1] * vec - 12
f2 = adjoint(vec) * matrices[2] * vec - 45
f3 = adjoint(vec) * matrices[3] * vec - 38
sys = System([f1,f2,f3])
solve(sys)
You can attack problems involving conjugations like this as follows:
Define variables x1, x2, x3
andy1, y2, y3
and define b1 = x1 + im * y1
etc. Then, f1,f2,f3
are polynomials of the form f1 = g1 + im * h1
with g1
and h1
real polynomials etc.
Your problem is then translated to solving for the real solutions of [f1, f2, f3, g1, g2, g3]
.
Thank you so much, it works now! Great Job, thanks for the support! Once our paper is ready, we will cite your package!
Hi folks,
when I calculate the complex conjugate I get the wrong solution:
@var b1 b2
subs(conj(b1)*b2, b1=>2+im, b2=>3)
Output: 6 + 3*im
where it should be
Output: 6 - 3*im
Do I have to explicitly declare my variables as complex?
Thanks for your help!