how can I solve non polynomial equations.

12 views (last 30 days)
R=0.082
a=4.225
b=0.037
T=320
eqn1 : P+(a/v1^2) - RT/(v1-b)=0
eqn2 : P+(a/v2^2) - RT/(v2-b)=0
eqn3 : P(v1-v2)-RTln(v1-b/v2-b)-a(1/v1 -1/v2)=0

Accepted Answer

Star Strider
Star Strider on 15 Oct 2019
FIRST: see Getting Started. What you posted is not valid MATLAB code.
There may be many solutions, depending on the initial estimates:
R = 0.082;
a = 4.225;
b = 0.037;
T = 320;
eqn1 = @(v1,v2,P) P+(a./v1^2) - R*T/(v1-b);
eqn2 = @(v1,v2,P) P+(a./v2^2) - R*T/(v2-b);
eqn3 = @(v1,v2,P) P*(v1-v2)-R*T*log(v1-b./v2-b)-a*(1./v1 -1./v2);
[Vv,fval] = fsolve(@(b) [eqn1(b(1),b(2),b(3)); eqn2(b(1),b(2),b(3)); eqn3(b(1),b(2),b(3))], ones(3,1))
producing:
Vv =
1.071530062473936
1.071530062474078
21.684426220811453
fval =
1.0e-11 *
-0.252597942562716
-0.001776356839400
-0.189449129302390
Experiment to get the result you want.
  4 Comments

Sign in to comment.

More Answers (0)

Categories

Find more on Programming 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!