Wrong answer when using the SOLVE function using SYMS variables

Following is the code I am using:
syms a b c d
assume([a b c d],'real')
c1 = a + 1i*b;
c2 = c + 1i*d;
eqn = 2*c1 + 1i*3*c2;
solve(eqn==0,a)
The correct answer is 3d/2. While I do get this answer with the correct condition:
The solutions are valid under the following conditions: in(-b*1i - (c*3i)/2, 'real').
it is mathematically impossible for the given condition to be valid under the given assumption.
Is this a bug in the symbolic engine or is there something that can be done to get the correct answer?

3 comentarios

What if b=-1.5*c ?
Best wishes
Torsten.
Thanks for the reply. Even if b = -1.5*c, shouldn't the answer still be 3*d/2? This is because a is assumed to be real...
I thought you meant that you get the answer
a = 3*d/2
from MATLAB under the condition that
-b*1i - (c*3i)/2 is 'real'
and that you think this answer is wrong.
If this is not your question, please try to formulate it more clearly.
Best wishes
Torsten.

Iniciar sesión para comentar.

Respuestas (0)

Preguntada:

el 16 de Dic. de 2016

Comentada:

el 16 de Dic. de 2016

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by