Solving 3 equations with 3 unknowns

4 Ansichten (letzte 30 Tage)
Kristine
Kristine am 2 Okt. 2022
Bearbeitet: Torsten am 2 Okt. 2022
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);

Akzeptierte Antwort

Torsten
Torsten am 2 Okt. 2022
Bearbeitet: Torsten am 2 Okt. 2022
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

Weitere Antworten (0)

Produkte


Version

R2022a

Community Treasure Hunt

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

Start Hunting!

Translated by