Matlab returns answer with another variable z. What does this mean?

9 vues (au cours des 30 derniers jours)
clayton holmes
clayton holmes le 9 Mar 2022
gamma = 1.4;
U2b = 1000;
U2a = 800;
T2a = 300;
A2a = sqrt(gamma*R*T2a);
syms gamma Usb A2a U2a U2b
eqn = (((gamma+1)*((Usb/A2a)^2))/((gamma-1)*((Usb/A2a)^2)+2)) - ((Usb-U2a)/(Usb-U2b))==0;
SolUsb = solve(eqn,Usb)
Returns
ans =
root(A2a^2*U2a - A2a^2*z - (z^2*(U2a + U2b - U2a*gamma + U2b*gamma))/2 + z^3, z, 1)
root(A2a^2*U2a - A2a^2*z - (z^2*(U2a + U2b - U2a*gamma + U2b*gamma))/2 + z^3, z, 2)
root(A2a^2*U2a - A2a^2*z - (z^2*(U2a + U2b - U2a*gamma + U2b*gamma))/2 + z^3, z, 3)

Réponses (2)

Torsten
Torsten le 9 Mar 2022
Use
SolUsb = solve(eqn, Usb, 'MaxDegree', 3)
instead.

Star Strider
Star Strider le 9 Mar 2022
Put the syms declaration first and use vpasolve
syms gamma Usb A2a U2a U2b
R = 8;
gamma = 1.4;
U2b = 1000;
U2a = 800;
T2a = 300;
A2a = sqrt(gamma*R*T2a);
eqn = (((gamma+1)*((Usb/A2a)^2))/((gamma-1)*((Usb/A2a)^2)+2)) - ((Usb-U2a)/(Usb-U2b))==0;
SolUsb = vpasolve(eqn,Usb)
SolUsb = 
.

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by