Info

此问题已关闭。 请重新打开它进行编辑或回答。

Solving multiple algebraic equation

1 次查看(过去 30 天)
Aqmar Azlan
Aqmar Azlan 2019-7-31
关闭: MATLAB Answer Bot 2021-8-20
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
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
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:

此问题已关闭。

产品


版本

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by