What is the best way to solve 3 equations and 3 unknowns

1 次查看(过去 30 天)
I have 3 equations and 3 unknowns. This is the code I have right now to solve them-
///
syms w0 w1 S
a1= (-8.84*((w0+w1)/(2*H))^-0.38) + (0.89*T/H)^0.95;
b1= ((S/H)+0.78)^-1.85;
c1= (9.5*((w0+w1)/(2*H)))^-0.34;
d1= ((S/H)+0.807)^-1.0;
a2= (-1.02*(w0/H)^-0.38) + (1.24*(T/H)^0.052);
b2= exp(-2.86*S/H);
c2= ((0.563*(w0/H)^0.071) + (1.96*(T/H)^1.23))^-1.0;
a3= (-1.02*(w1/H)^-0.38) + (1.24*(T/H)^0.052);
b3= exp(-2.86*S/H);
c3= ((0.563*(w1/H)^0.071) + (1.96*(T/H)^1.23))^-1.0;
solve(C01_Eo_sqrtEre==(a1*b1)+(c1*d1),C0_Eo_sqrtEre==a2+(b2*c2),C1_Eo_sqrtEre==a3+(b3*c3),w0,w1,S)
///
So I know all the other values in the equations except w0,w1, and S. When I run this code, it takes a really long time. I havent seen any result. When I terminate it, I see this error- "Operation terminated by user during mupadengine/evalin (line 97)" What is the best way to solve this? Thank you

回答(1 个)

Andrew Schenk
Andrew Schenk 2015-6-15
I am not able to reproduce the same behavior because I am not sure what the specific constants are in your equations. However, as Walter mentioned, if a numeric (as opposed to symbolic) answer is acceptable, use the following code instead:
vpasolve(C01_Eo_sqrtEre==(a1*b1)+(c1*d1),C0_Eo_sqrtEre==a2+(b2*c2),C1_Eo_sqrtEre==a3+(b3*c3),w0,w1,S)
  2 个评论
Walter Roberson
Walter Roberson 2015-6-15
At the moment you have 3 equations in 6 unknowns, S, w0, w1, C01_Eo_sqrtEre, C0_Eo_sqrtEre, C1_Eo_sqrtEre. Are there specific values for the C* variables?

请先登录,再进行评论。

Community Treasure Hunt

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

Start Hunting!

Translated by