Solving 3 equations with 3 unknowns

3 ビュー (過去 30 日間)
Kristine
Kristine 2022 年 10 月 2 日
編集済み: Torsten 2022 年 10 月 2 日
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 Center および File ExchangeMathematics についてさらに検索

製品


リリース

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by