Hello all,
I am a mechanical engineering student working on some Applied Thermodynamics homework and am having trouble getting the values I need to plot a nonlinear equation. I have (on paper) determined that my nonlinear equation is as follow:
2*sqrt(P)*((x)^1.5) + .10905*x- 0.0363 = 0
where P is a pressure and x happens to be a molecular concentration in this case. So, I can solve the above equation for set values of P using the following function file (when P = 1).
function [x,P] = myfun(x)F = 2*sqrt(1)*((x)^1.5) + .10905*x- 0.03635;end
and the commands:
x0 = 0.5;[x,fval] = fsolve(@myfun,x0)
But what I want is to define P as an array like [0.1:0.1:100] and be able to solve all of those values at once instead of having to get each one individually. I was wondering if this was possible using the above approach or if I should be looking at another method. Thank you in advance for any guidance you can give me. Still kind of a Matlab novice if you couldn't already tell.
Best Answer