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?

12 views (last 30 days)
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)

Answers (0)

Tags

Community Treasure Hunt

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

Start Hunting!