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?

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)

回答(0 个)

类别

帮助中心File Exchange 中查找有关 Numerical Integration and Differential Equations 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by