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 个评论
Torsten
2016-12-16
What if b=-1.5*c ?
Best wishes
Torsten.
Harini Hapuarachchi
2016-12-16
Torsten
2016-12-16
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.
回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 Numeric Solvers 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!