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!