how to solve non-linear equations in a nozzle
4 views (last 30 days)
Show older comments
Dear friends
I want to solve these non-linear equations for inlet of a de-laval nozzle(8 equations and 8 variables). All the equations are both non-linear and parametric. I tried to use fsolve to solve them but I got many errors. Thank you for guiding me in this regard.
inputs:
di = 0.04; % k
alpha = 12.67; % degree
Ti = 291.65; % K
Pi = 90; % bar
Vi = 43.5; % m/s
Ci = 443.8; % m/s
Mi = 0.098;
Zi = 1;
rhoi = 60.17; % kg/m^3
k = 1.32;
R = 8.3114; % kj/kmol.K
Ai = 0.0013; % m^2
equations:
F(1) = Pt/rhot - Zt*R*Tt;
F(2) = sqrt(k*R*Zt*Tt) - Vt;
F(3) = (k*R*Zt*Tt) - (Vi^2+((2*k)/(k-1))*(Zi*R*Ti-Zt*R*Tt));
F(4) = ((Zi*Ti)/(Zt*Tt)) - (rhoi/rhot)^(k-1);
F(5) = (rhoi/rhot)^(k-1) - (Pi/Pt)^((k-1)/k);
F(6) = Ai*(rhoi/rhot)*(Vi/Vt) - At;
F(7) = (Ai^0.5 - At^0.5)/((pi^0.5)*tand(alpha)) - xt;
output:
[ Pt , Tt , rhot , Zt , Vt , At , xt ]
0 Comments
Accepted Answer
Torsten
on 24 Nov 2022
Maybe you can give better initial guesses in x0 for the solution than I can ...
x0 = 10*rand(7,1);
options = optimset('MaxFunEvals',1000000,'MaxIter',1000000);
norm(fun(x0))
x = fsolve(@fun,x0,options)
norm(fun(x))
function F = fun(x)
Pt = x(1);
Tt = x(2);
rhot = x(3);
Zt = x(4);
Vt = x(5);
At = x(6);
xt = x(7);
di = 0.04; % k
alpha = 12.67; % degree
Ti = 291.65; % K
Pi = 90; % bar
Vi = 43.5; % m/s
Ci = 443.8; % m/s
Mi = 0.098;
Zi = 1;
rhoi = 60.17; % kg/m^3
k = 1.32;
R = 8.3114; % kj/kmol.K
Ai = 0.0013; % m^2
%equations:
F(1) = Pt/rhot - Zt*R*Tt;
F(2) = sqrt(k*R*Zt*Tt) - Vt;
F(3) = (k*R*Zt*Tt) - (Vi^2+((2*k)/(k-1))*(Zi*R*Ti-Zt*R*Tt));
F(4) = ((Zi*Ti)/(Zt*Tt)) - (rhoi/rhot)^(k-1);
F(5) = (rhoi/rhot)^(k-1) - (Pi/Pt)^((k-1)/k);
F(6) = Ai*(rhoi/rhot)*(Vi/Vt) - At;
F(7) = (Ai^0.5 - At^0.5)/((pi^0.5)*tand(alpha)) - xt;
end
3 Comments
Alex Sha
on 27 Nov 2022
I think Torsten is right, there is no exact numerical solution, the approximate solution is:
pt: 596435.381381668
tt: -21.0901443320853
rhot: 260.748232462543
zt: -13.0493323055227
vt: 54.9487704256482
at: 0.000237481729284569
xt: 0.00968011270311718
More Answers (0)
See Also
Categories
Find more on Systems of Nonlinear 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!