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?
Show older comments
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 Comments
Walter Roberson
on 24 Aug 2019
sol = vpasolve(eqnLeft == eqnRight,x,[2.2e5 2.4e5])
Roy Ramirez
on 24 Aug 2019
Answers (0)
Categories
Find more on Numerical Integration and Differential Equations in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!