Why does SOLVE return an incorrect result?
이전 댓글 표시
Why does SOLVE return an incorrect result?
Specifically,
> syms I01 I1 V R ts tau I2 I02 V1 V2 di1 di2 L
> f1=R*I1+L*di1-V1;
> f2=R*I2+L*di2-V2;
> [R,L]=solve(f1,f2,'R,L');
> Rsym=simple(R);
> Lsym=simple(L);
After checked by hand, the solution for R and L is exchanged, and thus incorrect although the answer is correct had the it not been exchanged.
Is this a bug?
채택된 답변
추가 답변 (1개)
pham lam
2020년 12월 9일
syms x
syms x2A
% 함수식 f %
f = (2*x^2 + 4*x -3)/(x^2 + x - 4)
% 항등식 풀기, 대입 %
x1 = solve((2*x^2 + 4*x -3)/(x^2 + x - 4))
y1 = subs(f,x ,x1)
% 좌극한, 우극한 %
x2 = sym(sqrt(17)/2 - 1/2)
lim_left = limit(f,x,x2,'left')
lim_right = limit(f,x,x2,'right')
카테고리
도움말 센터 및 File Exchange에서 Equation Solving에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!