how can I solve non polynomial equations.

8 visualizzazioni (ultimi 30 giorni)
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

Risposta accettata

Star Strider
Star Strider il 15 Ott 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 Commenti
Star Strider
Star Strider il 15 Ott 2019
As always, my pleasure!

Accedi per commentare.

Più risposte (0)

Categorie

Scopri di più su Programming in Help Center e File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by