Wrong answer when using the SOLVE function using SYMS variables
Ältere Kommentare anzeigen
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 Kommentare
Torsten
am 16 Dez. 2016
What if b=-1.5*c ?
Best wishes
Torsten.
Harini Hapuarachchi
am 16 Dez. 2016
Torsten
am 16 Dez. 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.
Antworten (0)
Kategorien
Mehr zu Numeric Solvers finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!