Wrong answer when using the SOLVE function using SYMS variables
Show older comments
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 Comments
Torsten
on 16 Dec 2016
What if b=-1.5*c ?
Best wishes
Torsten.
Harini Hapuarachchi
on 16 Dec 2016
Torsten
on 16 Dec 2016
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.
Answers (0)
Categories
Find more on Numeric Solvers in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!