POLYMATH Report          NLE 
 Nonlinear Equations 2016-May-31 

Calculated values of NLE variables
    Variable Value f(x) Initial Guess Initial f(x)
1 n1 2.99218 -9.3E-15 1.5 -1.0E00
2 n10 14.3564 -3.6E-14 5 -1.1E00
3 n2 3.89158 5.4E-12 2 -2.4E01
4 n3 79.4133 -9.1E-14 35 -3.9E00
5 n4 0.007823 1.7E-11 0.5 -9.0E01
6 n5 0.001964 1.9E-14 0.05 1.2E-01
7 n6 0.000418 -3.0E-15 0.005 -3.2E-03
8 n7 0.212494 7.6E-13 0.04 -2.1E-02
9 n8 0.017558 2.9E-14 0.003 -1.3E-03
10 n9 1.17331 3.1E-12 0.02 -7.6E-03

    Variable Value Initial Value
1 K10 3.85E-05 3.85E-05
2 K5 0.193 0.193
3 K6 0.002597 0.002597
4 K7 0.003448 0.003448
5 K8 1.8E-05 1.8E-05
6 K9 0.000216 0.000216
7 nt 102.067 44.118
8 p 40 40
9 R 40 40

Nonlinear equations
1 f(n1) = n1+n4-3 = 0
2 f(n2) = 2*n1+n2+n4+n7+n8+n9+2*n10-R = 0
3 f(n3) = 2*n2+2*n5+n6+n7-8 = 0
4 f(n4) = 2*n3+n9-4*R = 0
5 f(n5) = K5*n2*n4-n1*n5 = 0
6 f(n6) = K6*sqrt(n2*n4)-sqrt(n1)*n6*sqrt(p/nt) = 0
7 f(n7) = K7*sqrt(n1*n2)-sqrt(n4)*n7*sqrt(p/nt) = 0
8 f(n8) = K8*n1-n4*n8*(p/nt) = 0
9 f(n9) = K9*n1*sqrt(n3)-n4*n9*sqrt(p/nt) = 0
10 f(n10) = K10*n1^2-n4^2*n10*(p/nt) = 0

Explicit equations
1 nt = n1+n2+n3+n4+n5+n6+n7+n8+n9+n10
2 K5 = 0.193
3 K6 = 2.597e-3
4 K7 = 3.448e-3
5 K8 = 1.799e-5
6 K9 = 2.155e-4
7 K10 = 3.846e-5
8 R = 40
9 p = 40

Problem source text
# S. 20* - NLE System
# Combustion of Propane
# Verified Solution: n1=2.99218, n2=3.89158, n3 =79.4133
# n4 =0.007823, n5 = 0.001964, n6 = 0.000418, n7=0.212494
# n8 = 0.017558, n9 = 1.17331, n10 = 14.3564
# Ref.: Comp. chem. Engng. 26, 547 (2002)
f(n1) = n1+n4-3
f(n2) = 2*n1+n2+n4+n7+n8+n9+2*n10-R
f(n3) = 2*n2+2*n5+n6+n7-8
f(n4) = 2*n3+n9-4*R
f(n5) = K5*n2*n4-n1*n5
f(n6) = K6*sqrt(n2*n4)-sqrt(n1)*n6*sqrt(p/nt)
f(n7) = K7*sqrt(n1*n2)-sqrt(n4)*n7*sqrt(p/nt)
f(n8) = K8*n1-n4*n8*(p/nt)
f(n9) = K9*n1*sqrt(n3)-n4*n9*sqrt(p/nt)
f(n10) = K10*n1^2-n4^2*n10*(p/nt)
nt = n1+n2+n3+n4+n5+n6+n7+n8+n9+n10
K5 = 0.193
K6 = 2.597e-3
K7 = 3.448e-3
K8 = 1.799e-5
K9 = 2.155e-4
K10 = 3.846e-5
R = 40
p = 40
n1(0)=1.5
n2(0)=2
n3(0)=35
n4(0)=0.5
n5(0)=0.05
n6(0)=0.005
n7(0)=0.04
n8(0)=0.003
n9(0)=0.02
n10(0)=5

Matlab formatted problem
Create m file called PolyNles.m and paste the following text into it.
% S. 20* - NLE System
% Combustion of Propane
% Verified Solution: n1=2.99218, n2=3.89158, n3 =79.4133
% n4 =0.007823, n5 = 0.001964, n6 = 0.000418, n7=0.212494
% n8 = 0.017558, n9 = 1.17331, n10 = 14.3564
% Ref.: Comp. chem. Engng. 26, 547 (2002)
function PolyNles
   xguess = [1.5 2 35 0.5 0.05 0.005 0.04 0.003 0.02 5]; % initial guess vector
   x = fsolve(@MNLEfun, xguess);
   fprintf('The NLEs solution is:\n');
   fprintf('n1 = %g\n',x(1));
   fprintf('n2 = %g\n',x(2));
   fprintf('n3 = %g\n',x(3));
   fprintf('n4 = %g\n',x(4));
   fprintf('n5 = %g\n',x(5));
   fprintf('n6 = %g\n',x(6));
   fprintf('n7 = %g\n',x(7));
   fprintf('n8 = %g\n',x(8));
   fprintf('n9 = %g\n',x(9));
   fprintf('n10 = %g\n',x(10));
end

function fvec = MNLEfun(IndepVarsVec)
   n1 = IndepVarsVec(1);
   n2 = IndepVarsVec(2);
   n3 = IndepVarsVec(3);
   n4 = IndepVarsVec(4);
   n5 = IndepVarsVec(5);
   n6 = IndepVarsVec(6);
   n7 = IndepVarsVec(7);
   n8 = IndepVarsVec(8);
   n9 = IndepVarsVec(9);
   n10 = IndepVarsVec(10);
   nt = n1 + n2 + n3 + n4 + n5 + n6 + n7 + n8 + n9 + n10;
   K5 = 0.193;
   K6 = 0.002597;
   K7 = 0.003448;
   K8 = 1.799E-05;
   K9 = 0.0002155;
   K10 = 3.846E-05;
   R = 40;
   p = 40;
   fvec(1,1) = n1 + n4 - 3;
   fvec(2,1) = 2 * n1 + n2 + n4 + n7 + n8 + n9 + 2 * n10 - R;
   fvec(3,1) = 2 * n2 + 2 * n5 + n6 + n7 - 8;
   fvec(4,1) = 2 * n3 + n9 - (4 * R);
   fvec(5,1) = K5 * n2 * n4 - (n1 * n5);
   fvec(6,1) = K6 * sqrt(n2 * n4) - (sqrt(n1) * n6 * sqrt(p / nt));
   fvec(7,1) = K7 * sqrt(n1 * n2) - (sqrt(n4) * n7 * sqrt(p / nt));
   fvec(8,1) = K8 * n1 - (n4 * n8 * p / nt);
   fvec(9,1) = K9 * n1 * sqrt(n3) - (n4 * n9 * sqrt(p / nt));
   fvec(10,1) = K10 * n1 ^ 2 - (n4 ^ 2 * n10 * p / nt);
end

General Settings
Total number of equations 19
Number of implicit equations 10
Number of explicit equations 9
Elapsed time 0.05 sec
Reporting digits 8
Solution method safenewt
Max iterations 150
Tolerance F 1E-07
Tolerance X 1E-07
Tolerance min 1E-07