Solving 3 equations with 3 unknowns

1 次查看(过去 30 天)
Hi! I am trying to see if Matlab would help me solve 3 equations with 3 unknowns. Thank you in advance!
52.11=2*[(sqrt(x*44.4)]
52.89=2*[(sqrt(x*34)+(sqrt(y*3.92)+(sqrt(z*57.4)]
46.71=2*[(sqrt(x*21.8)+(sqrt(y*25.5)+(sqrt(z*25.5)]
For the first equation, y and z=0.
Would something like this work:
syms x y z
E1 = 2*sqrt(x*44.4) == 52.11;
E2 = 2*((sqrt(x*34))+(sqrt(y*3.92))+(sqrt(z*57.4))) == 52.89;
E3 = 2*((sqrt(x*21.8))+(sqrt(y*25.5))+(sqrt(z*25.5))) == 46.71;
result = solve(E1,E2,E3);

采纳的回答

Torsten
Torsten 2022-10-2
编辑:Torsten 2022-10-2
No problem.
A = [2*sqrt(44.4) 0 0; 2*sqrt(34) 2*sqrt(3.92) 2*sqrt(57.4);2*sqrt(21.8) 2*sqrt(25.5) 2*sqrt(25.5)];
b = [52.11;52.89;46.71];
sol = A\b
sol = 3×1
3.9102 0.7155 0.2941
x = sol(1)^2
x = 15.2897
y = sol(2)^2
y = 0.5119
z = sol(3)^2
z = 0.0865
A*sqrt([x;y;z])-b
ans = 3×1
0 0 0

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Symbolic Math Toolbox 的更多信息

产品


版本

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by