Info
이 질문은 마감되었습니다. 편집하거나 답변을 올리려면 질문을 다시 여십시오.
Solving multiple algebraic equation
조회 수: 1 (최근 30일)
이전 댓글 표시
I am trying to solve 3 unknown using the following code. Am I doing this right ?
>> clear all
>> syms x y z
>> eqns=[x==(0.134+0.01*sin(z))/0.464189, 0.134*z==0.01*cos(z), y==z/x];
>> S=solve(eqns,[x y z])
Warning: Cannot solve symbolically. Returning a numeric approximation instead.
> In solve (line 303)
S =
struct with fields:
x: [1×1 sym]
y: [1×1 sym]
z: [1×1 sym]
>> S.x
ans =
0.29027727131273067299254520400093
>> S.y
ans =
0.25637661763413173595586063384135
>> S.z
ans =
0.074420304995223068940034251420538
댓글 수: 2
Walter Roberson
2019년 7월 31일
Yes, provided you want to restrict to reals.
However in this situation, you only need to solve the second equation. The z you get from that defines what x must be, and then the third equation defines y in terms of the x and z.
답변 (1개)
Mahesh Taparia
2019년 8월 5일
Hi,
Your solution is correct.
Use ‘S=vpasolve(eqns,[x y z]) ‘ instead of using ‘solve’ command, to avoid warning. Your solution is an approximate to your exact solution. By default, ‘vpa’ uses 32 significant decimal digits of precision, you can change the precision using digits command. For further information, you can refer the following link:
댓글 수: 0
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!