I'm getting only complex solutions for an numerically solved (vpasolve) equation, but when plotting the equations I do find a real solution. How can I tell MATLAB to give me that real solution?
Afficher commentaires plus anciens
Code:
%inputs
k = 1.2;
P2 = 12.55; %psi
P3 = 12.55;
F = 50; %N
A2 = 0.000594389; %m2
At = 0.000253514; %m2
%variables
a = (P2*6894.757)^((k-1)/k)
b = (k+1)/k
c = ((F+2*6894.757*(P3-P2)*A2)/(At*sqrt((2*(k^2)/(k-1))*((2/(k+1))^((k+1)/(k-1))))))^2
%Plot Graphs
syms x clear
eqnLeft = x^2-a*(x^b);
eqnRight = c;
fplot([eqnLeft eqnRight])
xlim([-1000000 1000000])
ylim([-100 10*(10^9)])
%solve
sol = vpasolve(eqnLeft == eqnRight,x)
2 commentaires
Walter Roberson
le 24 Août 2019
sol = vpasolve(eqnLeft == eqnRight,x,[2.2e5 2.4e5])
Roy Ramirez
le 24 Août 2019
Réponses (0)
Catégories
En savoir plus sur Numerical Integration and Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!