Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Rigorous Distillation Calculation for a Three-Component, Five-Stage

Separation Tower
Maricarmen López Alvarez
Summary.

The following investigation consists of carrying out complete mass and energy
balances for a 3-component, 5-stage distillation tower. This balance is carried out by
means of the MESH equations to obtain the temperatures of the stages and of the
condensate, as well as the composition within the column, making use of Polymath
6.10 by means of the system of Nonlinear Equations and of Mathlab by means of the
NLEQ and FSOLVER methods.

Introduction

Until 1950, the calculations corresponding to the problems of rectification of distillation towers, had to be done
"by hand". Although rigorous methods were available, they were difficult to apply.

The final design of the multi-stage equipment requires a rigorous determination of the temperature, pressure,
flow rates and compositions of the streams and heat transfer rates for each stage. Given the high non-linearity
of the equations that describe the process, it is necessary to solve the general problem by the use of iterative
procedures and the various methods differ in the selection of the set of independent variables.

The first attempts to solve this problem were by means of a system of equations formed by the material
balances, the equilibrium relations, the summation of mole fractions and the enthalpy balances, these
balances are known as MESH equations.

The MESH equations (M = mass balance, E = equilibrium, S = sum of molar or mass fractions, and H =
enthalpy balance) are described below.

The MESH equations for an equilibrium stage are:

1. Mole balances of component j (M-equations, n c equations for


each stage)
V
( ¿¿ j + W j) and i, j

L j - 1 x i, j - 1+ F j z i, j + V j + 1 and i, j + 1 = ( L j + OR j) x i, j + ¿

2. Vapor-liquid equilibrium (E-equations, n c equations for each stage:

and i, j = k i, j x i, j

3. Sum of mole fractions (S-equations)

nc

∑ and i, j = 1
i=1

nc

∑ x i, j = 1
i=1

4. Enthalpy balance (H-equations)

V
( ¿¿ j + W j) H j

Q + L j - 1 h j - 1+ F j h Fj + V j + 1 H j + 1 = ( L j + OR j) h j + ¿

One of the S-equations can be replaced by the equation for the balance of total moles

L j - 1+ F j + V j + 1 = L j + OR j + V j + W j

Equilibrium stage variables and column of MESH equations

n Total number of stages Fj Speed of flow of


feeding in stage j
j Stage number k i, j Equilibrium ratio for
component i in state j
nc Number of components H F, j Enthalpy of current
feed j
x i, j Liquid mole fraction hj Enthalpy of the current
liquid leaving state j
and i, j Molar fraction of vapor for Lj Liquid flow rate
component i leaving state from stage j to stage
j j+1
z i, j Component mole fraction Wj Speed of flow of the

i entering state j steam part current


from stage j
Tj State j temperature Vj Steam flow rate
from stage j to stage
j-1
B Column bottom product OR j Speed of flow of the

current of the liquid part


from stage j
D Distillate product Hj Enthalpy of the liquid stream
leaving stage j
Qj Heat transfer from the
plate j
Table 1 . Nomenclature of MESH equations

This system of equations results from applying component by component methods. This usually results in a
matrix of coefficients in the form of a tridiagonal matrix, and they are solved using a progressive elimination
method called the Thomas algorithm.

Currently it is possible to perform more quickly and efficiently thanks to different programs capable of solving
number analysis techniques.

Next we will present a problem of a distillation tower, where we will use the MESH equations and different
methods to solve this problem. The use of 2 different programs Polymath 6 and Mathlab will be used

Methodology

A simple distillation column with 5 stages was considered to separate Propane (1). n-Butane (2), and i-Butane
(3). The supply current was considered as Z 1 = 0.10, Z 2 = 0.70, Z 3 = 0.20 respectively. The amount of heat supplied
to the boiler is 9183 BTU / h The distillate is extracted at a rate of 0.36 lbmol / h and the product from the
bottom of the column is

0.64lbmol / h.

First, the MESH equations were developed for the mole per component balance and the enthalpy balance.

In appendix B of the book Fundamentals of Multicomponent Distillation by Charles D. Holland the


equilibrium constant for the components is found and also for the calculation of liquid and vapor enthalpy.
Resolution via Polymath

The 4 component balance and energy balance equations were developed for each of the 3 components and
for each stage. The equations were entered in Nonlinear Equations, the way the equations were entered, we
can see it in Appendix A, which is at the end of the article. Here the order of the equations does not affect the
iteration of the equations.

Resolution via Matlab

Through the MAtlab program, 2 different methods NLEQ and FSolve were developed to solve the problem.

The development of the equations used in these two methods were exactly the same as in the Polymath
program. The only difference is that a different programming language is used here and the format needs to
be changed a bit.

The order in which the commands are appended if they affect the execution of the method, first the command
must be written according to the method to be used, then the energy balance and component equations must
be entered, at the end the equations of the implicit variables of temperature and steam flow velocity for each
stage.

The more detailed description of these commands can be seen in appendix B for the NLEQ method and
appendix C for the Fsolve method.

NLEQ method in Matlab

It is a method that performs non-linear numerical solution (NL) equations (EQ) Specially designed for
numerically sensitive problems.

A more detailed description of the commands entered and how the energy and component balances were
written are described in Appendix B.

FSOLVE method in Matlab

The Fsolve method implements three different algorithms: trust region dogleg, trust region reflective, and
Levenberg-Marquardt
X = fsolve (FUN, X0) starts at matrix X0 and tries to solve the equations in FUN. FUN accepts the input X and
returns a vector (matrix) of the equation F values evaluated at X.

X = fsolve (FUN, X0, OPTIONS) solves the equations with the default optimization parameters replaced by
the option values, an argument created with the OPTIMOPTIONS function. See OPTIMOPTIONS for more
details. Use the Jacobian option to specify that fun also returns a second output argument that J is the
Jacobian matrix at point X. If FUN returns a vector F of the components of M when X has length n, then J is a
matrix of m by n where J (i, j) is the partial derivative of F (i) with respect to x (j). (Note that the Jacobian J is
the transpose of the slope of F.)

X = fsolve (PROBLEM) solves defined in the system problem. PROBLEM is a structure with the FUN
function in PROBLEM.objective, the starting point in PROBLEM.x0, the options structure in
PROBLEM.options, and the solver name 'fsolve' in PROBLEM.solver. Use this syntax to solve a problem
exported from OPTIMTOOL on the command line. The PROBLEM structure must have all the fields.

A more detailed description of the commands entered and how the energy and component balances were
written are described in Appendix C.

In this method, a notable modification was made when entering the enthalpy balance equations since with the
second technique that Fsolve uses, it was not possible to iterate the results correctly, apart from the fact that it
took a long time to execute the results. As we know, this method occupies the Jacobian option for the
representation of the data and the results of the Jacobian matrix were very large values compared to others
that were too small, so we chose to divide it by 1000, so that at the time of iteration it would not take long so
much.

Results

The results obtained by the 2 programs with the different methods Nonlinear Equations, NLEQ, FSolve
were compiled in the following tables.
x11 x21 x31 x12 x22 x32
Polymat 0.10619 0.20914 0.09053 0.70699 0.20246
0.6846589
h6 12 99 85 19 96
NLEQ 0.1062 0.6847 0.2091 0.0905 0.707 0.2025
Solver 1 0.1062 0.6847 0.2091 0.0905 0.707 0.2025
Solver 2 0.1062 0.6847 0.2091 0.0905 0.707 0.2025
Solver
3 0.1062 0.6847 0.2091 0.0905 0.707 0.2025
Table 2 Composition of the three components in the
stage 1 and 2

x13 x23 x33 x14 x24 x34


Polymat 0.07770 0.20256 0.06190 0.73875 0.19934
0.7197357
h6 14 29 76 04 2
NLEQ 0.0777 0.7197 0.2026 0.0619 0.7388 0.1993
Solver 1 0.0777 0.7197 0.2026 0.0619 0.7388 0.1993
Solver 2 0.0777 0.7197 0.2026 0.0619 0.7388 0.1993
Solver
3 0.0777 0.7197 0.2026 0.0619 0.7388 0.1993
Table 3. Composition of the three components in the
stage 3 and 4

x15 x25 x35


Polymat 0.04294 0.18851
0.7685406
h6 09 85
NLEQ 0.0429 0.7685 0.1885
Solver 1 0.0429 0.7685 0.1885
Solver 2 0.0429 0.7685 0.1885
Solver
0.0429 0.7685 0.1885
3
Table 4 Composition of the three components
in stage 5

tf t0 t1 t2 t3 t4 t5
Polymat 681,981 680,899 683,199 684,954 687,229 690,193
668.2417
h6 5 9 9 9 4 9
681,981 680,899 683,199 684,954 687,229 690.19 9
NLEQ 5 668.2417 9 9 4 39
681,981 680,899 683,199 684,954 687,229 690.19 9
Solver 1 5 668.2417 9 9 4 39
681,981 680,899 683,199 684,954 687,229 690.19
Solver 2 5 668.2417 9 9 9 4 39
Solver 681,981 680,899 683,199 684,954 687,229 690.19
3 5 668.2417 9 9 9 4 39
Table 5. Temperature of each stage
of the column

Conclusions

As we can see in the tables of results, the values obtained by the 5 different methods were exactly the same,
so we can ensure that any of these techniques are sufficiently accurate to report the data obtained from the
temperatures and compositions of each stage.

References

P. Deuflhard:
Newton Methods for Nonlinear Problems. - Affine Invariance
and Adaptive Algorithms.
Computational Mathematics Series 35, Springer (2004)

U. Nowak, L. Weimann:
A Family of Newton Codes for Systems of Highly Nonlinear Equations - Algorithm,
Implementation, Application. ZIB, Technical Report TR 90-10 (December 1990)

APPENDIX A

# General specifications

F = 1 # Feed Flow Rate


z1 = 0.10 # mole fraction of component 1 in feed z2 = 0.70 # mole fraction of
component 2 in feed z3 = 0.20 # mole fraction of component 3 in feed B =
0.64 # Bottom Flow Rate

D = 0.36 # Flow Rate in the Distillate Q = 9183 # Heat


contributed to the Boiler

# Vapor-liquid equilibrium relationships for each component in each stage

k1f = tf * (-14.512474e-2 + 53.638924e-5 * tf -5.3051604e-8 * tf ^ 2̂ -173.58329e-12 * tf ^ 3̂) ^ 3̂ k10 = t0 * (-14.512474e-2


+53.638924 e-5 * t0 -5.3051604e-8 * t0 ^ 2̂ -173.58329e-12 * t0 ^ 3̂) ^ 3̂
k11 = t1 * (-14.512474e-2 + 53.638924e-5 * t1 -5.3051604e-8 * t1 ^ 2̂ -173.58329e-12 * t1 ^ 3̂) ^ 3̂ k12 = t2 *
(-14.512474e-2 +53.638924 e-5 * t2 -5.3051604e-8 * t2 ^ 2̂ -173.58329e-12 * t2 ^ 3̂) ^ 3̂ k13 = t3 * (-14.512474e-2 +
53.638924e-5 * t3 -5.3051604e-8 * t3 ^ 2̂ -173.58329e-12 * t3 ^ 3̂) ^ 3̂ k14 = t4 * (-14.512474e-2 + 53.638924e-5 * t4
-5.3051604e-8 * t4 ^ 2̂ -173.58329e-12 * t4 ^ 3̂) ^ 3̂ k15 = t5 * (-14.512474e-2 + 53.638924e-5 * t5 -5.3051604e-8 * t5 ^ 2̂
-173.58329e-12 * t5 ^ 3̂) ^ 3̂

k2f = tf * (-14.181715e-2 + 36.866353e-5 * tf + 16.521412e-8 * tf ^ 2̂ -248.23843e-12 * tf ^ 3̂) ^ 3̂


k20 = t0 * (-14.181715e-2 + 36.866353e-5 * t0 + 16.521412e-8 * t0 ^ 2̂ -248.23843e-12 * t0 ^ 3̂) ^ 3̂ k21 = t1 *
(-14.181715e-2 +36.866353 e-5 * t1 + 16.521412e-8 * t1 ^ 2̂ -248.23843e-12 * t1 ^ 3̂) ^ 3̂ k22 = t2 * (-14.181715e-2 +
36.866353e-5 * t2 + 16.521412e-8 * t2 ^ 2̂ -248.23843e-12 * t2 ^ 3̂) ^ 3̂ k23 = t3 * (-14.181715e-2 + 36.866353e-5 * t3 +
16.521412e-8 * t3 ^ 2̂ -248.23843e-12 * t3 ^ 3̂) ^ 3̂ k24 = t4 * (-14.181715e-2 + 36.866353e-5 * t4 + 16.521412e-8 * t4 ^ 2̂
-248.23843e-12 * t4 ^ 3̂) ^ 3̂ k25 = t5 * (-14.181715e-2 + 36.866353e-5 * t5 + 16.521412e-8 * t5 ^ 2̂ -248.23843e-12 * t5 ^ 3̂)
^ 3̂

k3f = tf * (-18.967651e-2 + 61.239667e-5 * tf -17.891649e-8 * tf ^ 2̂ -90.855512e-12 * tf ^ 3̂) ^ 3̂ k30 = t0 * (-18.967651e-2


+61.239667 e-5 * t0 -17.891649e-8 * t0 ^ 2̂ -90.855512e-12 * t0 ^ 3̂) ^ 3̂ k31 = t1 * (-18.967651e-2 + 61.239667e-5 * t1
-17.891649e-8 * t1 ^ 2̂ -90.855512e-12 * t1 ^ 3̂) ^ 3̂ k32 = t2 * (-18.967651e-2 + 61.239667e-5 * t2 -17.891649e-8 * t2 ^ 2̂
-90.855512e-12 * t2 ^ 3̂) ^ 3̂ k33 = t3 * (-18.967651e-2 + 61.239667e-5 * t3 -17.891649e-8 * t3 ^ 2̂ -90.855512e-12 * t3 ^ 3̂)
^ 3̂ k34 = t4 * (-18.967651e-2 + 61.239667e-5 * t4 -17.891649e-8 * t4 ^ 2̂ -90.855512e-12 * t4 ^ 3̂) ^ 3̂ k35 = t5 *
(-18.967651e-2 + 61.239667e-5 * t5 -17.891649e-8 * t5 ^ 2̂ -90.855512e-12 * t5 ^ 3̂) ^ 3̂

# Molar enthalpies of the vapor of each component in each stage

hv11 = (81.795910 + 389.81919e-4 * t1 + 36.470900e-6 * t1 ^ 2̂) ^ 2̂ hv12 =


(81.795910 + 389.81919e-4 * t2 + 36.470900e-6 * t2 ^ 2̂) ^ 2̂ hv13 = (81.795910 +
389.81919e-4 * t3 + 36.470900e-6 * t3 ^ 2̂) ^ 2̂ hv14 = (81.795910 + 389.81919e-4 *
t4 + 36.470900e-6 * t4 ^ 2̂) ^ 2̂ hv15 = (81.795910 + 389.81919e- 4 * t5 +
36.470900e-6 * t5 ^ 2̂) ^ 2̂

hv21 = (152.66798 -1153.4842e-4 * t1 + 146.64125e-6 * t1 ^ 2̂) ^ 2̂ hv22 =


(152.66798 -1153.4842e-4 * t2 + 146.64125e-6 * t2 ^ 2̂) ^ 2̂ hv23 = (152.66798
-1153.4842e-4 * t3 + 146.64125e-6 * t3 ^ 2̂) ^ 2̂ hv24 = (152.66798 -1153.4842e-4 *
t4 + 146.64125e-6 * t4 ^ 2̂) ^ 2̂ hv25 = (152.66798 -1153.4842e- 4 * t5 +
146.64125e-6 * t5 ^ 2̂) ^ 2̂

hv31 = (147.65414 -1185.2942e-4 * t1 + 152.87778e-6 * t1 ^ 2̂) ^ 2̂ hv32 =


(147.65414 -1185.2942e-4 * t2 + 152.87778e-6 * t2 ^ 2̂) ^ 2̂ hv33 = (147.65414
-1185.2942e-4 * t3 + 152.87778e-6 * t3 ^ 2̂) ^ 2̂ hv34 = (147.65414 -1185.2942e-4 *
t4 + 152.87778e-6 * t4 ^ 2̂) ^ 2̂ hv35 = (147.65414 -1185.2942e- 4 * t5 +
152.87778e-6 * t5 ^ 2̂) ^ 2̂

# Molar enthalpies of the liquid of each component in each stage

h1f = (- 14.500060 + 1.9802223e-01 * tf + -2.9048837e-4 * tf ^ 2̂) ^ 2̂ hl10 = (-


14.500060 + 1.9802223e-01 * t0 -2.9048837e-4 * t0 ^ 2̂) ^ 2̂ hl11 = (-14.500060 +
1.9802223e-01 * t1 -2.9048837e-4 * t1 ^ 2̂) ^ 2̂ hl12 = (- 14.500060 + 1.9802223e-01 *
t2 -2.9048837e-4 * t2 ^ 2̂) ^ 2̂ hl13 = (- 14.500060 + 1.9802223e-01 * t3 -2.9048837e-4
* t3 ^ 2̂) ^ 2̂ hl14 = (- 14.500060 + 1.9802223e-01 * t4 -2.9048837e-4 * t4 ^ 2̂) ^ 2̂ hl15 =
(-14.500060 + 1.9802223e-01 * t5 -2.9048837e-4 * t5 ^ 2̂) ^ 2̂

h2f = (-20.298110 + 2.3005743e-1 * tf -3.8663417e-4 * tf ^ 2̂) ^ 2̂ hl20 = (- 20.298110


+ 2.3005743e-1 * t0 -3.8663417e-4 * t0 ^ 2̂) ^ 2̂ hl21 = (-20.298110 + 2.3005743e-1 *
t1 -3.8663417e-4 * t1 ^ 2̂) ^ 2̂ hl22 = (- 20.298110 + 2.3005743e-1 * t2
-3.8663417e-4 * t2 ^ 2̂) ^ 2̂
hl23 = (- 20.298110 + 2.3005743e-1 * t3 -3.8663417e-4 * t3 ^ 2̂) ^ 2̂
hl24 = (- 20.298110 + 2.3005743e-1 * t4 -3.8663417e-4 * t4 ^ 2̂) ^ 2̂
hl25 = (- 20.298110 + 2.3005743e-1 * t5 -3.8663417e-4 * t5 ^ 2̂) ^ 2̂

h3f = (-16.5534050 + 2.1618650e-1 * tf -3.1476209e-4 * tf ^ 2̂) ^ 2̂


hl30 = (-16.5534050 + 2.1618650e-1 * t0 -3.1476209e-4 * t0 ^ 2̂) ^ 2̂ = (-16.5534050
hl31 + 2.1618650e-1 * t1 -3.1476209e-4 * t1 ^ 2̂) ^ 2̂ = (-16.5534050 + 2.1618650e-1
hl32 * t2 -3.1476209e-4 * t2 ^ 2̂) ^ 2̂ = (-16.5534050 + 2.1618650e-1 * t3
hl33 -3.1476209e-4 * t3 ^ 2̂) ^ 2̂ = (-16.5534050 + 2.1618650e- 1 * t4 -3.1476209e-4
hl34 * t4 ^ 2̂) ^ 2̂ = (-16.5534050 + 2.1618650e-1 * t5 -3.1476209e-4 * t5 ^ 2̂) ^ 2̂
hl35

# Calculation of bubble point temperature

f (tf) = k1f * z1 + k2f * z2 + k3f * z3 -1


f (t0) = k10 * x10 + k20 * x20 + k30 * x30 -1 f (t1) = k11
* x11 + k21 * x21 + k31 * x31 -1 f (t2) = k12 * x12 + k22
* x22 + k32 * x32 -1 f (t3) = k13 * x13 + k23 * x23 + k33
* x33 -1 f (t4) = k14 * x14 + k24 * x24 + k34 * x34 -1 f
(t5) = k15 * x15 + k25 * x25 + k35 * x35 -1

# Molar balance of components by stages

f (x11) = - ((V1-L0) * k11 + L1) * x11 + V2 * k12 * x12 f (x21) = -


((V1-L0) * k21 + L1) * x21 + V2 * k22 * x22 f (x31) = - ((V1-L0) *
k31 + L1) * x31 + V2 * k32 * x32

f (x12) = L1 * x11 - (V2 * k12 + L2) * x12 + V3 * k13 * x13 + z1 * F f (x22) = L1 *


x21 - (V2 * k22 + L2) * x22 + V3 * k23 * x23 + z2 * F f (x32) = L1 * x31 - (V2 * k32 +
L2) * x32 + V3 * k33 * x33 + z3 * F

f (x13) = L2 * x12 - (V3 * k13 + L3) * x13 + V4 * k14 * x14 f (x23) = L2 *


x22 - (V3 * k23 + L3) * x23 + V4 * k24 * x24 f ( x33) = L2 * x32 - (V3 *
k33 + L3) * x33 + V4 * k34 * x34

f (x14) = L3 * x13 - (V4 * k14 + L4) * x14 + V5 * k15 * x15 f (x24) = L3 *


x23 - (V4 * k24 + L4) * x24 + V5 * k25 * x25 f ( x34) = L3 * x33 - (V4 *
k34 + L4) * x34 + V5 * k35 * x35

f (x15) = L4 * x14 - (V5 * k15 + B) * x15 f (x25) =


L4 * x24 - (V5 * k25 + B) * x25 f (x35) = L4 * x34 -
(V5 * k35 + B) * x35

# Enthalpy Balance

f (V1) = -V1 * hv1 + V2 * hv2 f (V2) = - L1 * hl1 + L0 * h0


-V2 * hv2 + V3 * hv3 f (V3) = -V3 * + L1 * hl1 - L2 * hl2 + hf * F
hv3 + V4 * hv4 f (V4) = -V4 * hv4 + + L2 * hl2 - L3 * hl3
V5 * hv5 f (V5) = -V5 * hv5 + + L3 * hl3 - L4 * hl4
Q + L4 * hl4 - L5 * hl5

# Total Matter Balance

L0 = V1 - D # Liquid returning from the condenser L1 = V2 - D #


Liquid flow rate from stage 1
L2 = V3 + F -D # Stage 2 L3 =
V4 + F -D # Stage 2 L4 = V5 + F
-D # Stage 2 L5 = B # Stage 3

# Molar enthalpy of steam by number of stages.

hv1 = k11 * x11 * hv11 + k21 * x21 * hv21 + k31 * x31 * hv31 hv2 = k12 * x12
* hv12 + k22 * x22 * hv22 + k32 * x32 * hv32 hv3 = k13 * x13 * hv13 + k23 *
x23 * hv23 + k33 * x33 * hv33 hv4 = k14 * x14 * hv14 + k24 * x24 * hv24 +
k34 * x34 * hv34 hv5 = k15 * x15 * hv15 + k25 * x25 * hv25 + k35 * x35 *
hv35

# Molar enthalpy of the liquid by number of stages.

hf = z1 * h1f + z2 * h2f + z3 * h3f


h0 = x10 * hl10 + x20 * hl20 + x30 * hl30 hl1 = x11 *
hl11 + x21 * hl21 + x31 * hl31 hl2 = x12 * hl12 + x22
* hl22 + x32 * hl32 hl3 = x13 * hl13 + x23 * hl23 +
x33 * hl33 hl4 = x14 * hl14 + x24 * hl24 + x34 * hl34
hl5 = x15 * hl15 + x25 * hl25 + x35 * hl35

# Composition of the liquid in the condensate

x10 = k11 * x11


x20 = k21 * x21
x30 = k31 * x31

# Initial values for solving the equations

x11 (0) = 0.2


x21 (0) = 0.6
x31 (0) = 0.2

x12 (0) = 0.15


x22 (0) = 0.15
x32 (0) = 0.15

x13 (0) = 0.15


x23 (0) = 0.5177
x33 (0) = 0.177

x14 (0) = 0.085


x24 (0) = 0.61912
x34 (0) = 0.12912

x15 (0) = 0.05


x25 (0) = 0.76
x35 (0) = 0.2

V1 (0) = 1.1
V2 (0) = 1.136
V3 (0) = 1.135
V4 (0) = 1.143
V5 (0) = 1.6149

tf (0) = 520
t0 (0) = 670
t1 (0) = 674
t2 (0) = 678
t3 (0) = 682
t4 (0) = 686
t5 (0) = 690

APPENDIX B

Matlab

function tresycin conleq


iopt.nonlin = 4; % The problem is mildly nonlinear
iopt.mprmon = 2; % We want to see summary of the iteration monitor. % Number of Newton-iterations.
wk.niter = 30;
x0 = [0.2; 0.6 ; 0.2; 0.15; 0.15; 0.15; 0.15; 0.5177; 0.177; ...
0.085; 0.6191 2; 0.12912; 0.05; 0.76; 0.2; ...
1.1; 1,136; 1. 135; 1,143; 1.6149; 520; 670; 674; 678; 682; 686; 690];
% x0 must be a co lumn vector. To get other solutions% modify this variable.

xscal = [0 0 0 0 even 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0];


= []; % The function (myfun) has no extra parameters. % The required tolerance.
TOL = 1e-5;
% Actual call to solver.
[x, info, wk] = nleq1 (@ myfun, x0, xscal, TOL, iopt, par, wk)

function [fun fail] = myfun (xin, flag, par)


%
%
global fail
% separating variables
F = 1; z1 = 0.10; z2 = 0.70; z3 = 0.20; B = 0.64; D = 0.36; Q = 9183;

% assignment of variables
x11 = xin (1);
x21 = xin (2);
x31 = xin (3);

x12 = xin (4);


x22 = xin (5);
x32 = xin (6);

x13 = xin (7);


x23 = xin (8);
x33 = xin (9);

x14 = xin (10);


x24 = xin (11);
x34 = xin (12);

x15 = xin (13);


x25 = xin (14);
x35 = xin (15);

V1 = xin (16);
V2 = xin (17);
V3 = xin (18);
V4 = xin (19);
V5 = xin (20);

tf = xin (21);
t0 = xin (22);
t1 = xin (23);
t2 = xin (24);
t3 = xin (25);
t4 = xin (26);
t5 = xin (27);
%
k1f = tf * (-14.512474e-2 + 53.638924e-5 * tf 12 * tf ^ 3) ^ 3; - 5.3051604e-8 * tf ^ 2 - 173.58329e-

k10 = t0 * (-14.512474e-2 + 53.638924e-5 * t0 12 * t0 ^ 3) ^ 3; - 5.3051604e-8 * t0 ^ 2 - 173.58329e-

k11 = t1 * (-14.512474e-2 + 53.638924e-5 * t1 12 * t1 ^ 3) ^ 3; - 5.3051604e-8 * t1 ^ 2 - 173.58329e-

k12 = t2 * (-14.512474e-2 + 53.638924e-5 * t2 12 * t2 ^ 3) ^ 3; - 5.3051604e-8 * t2 ^ 2 - 173.58329e-

k13 = t3 * (-14.512474e-2 + 53.638924e-5 * t3 12 * t3 ^ 3) ^ 3; - 5.3051604e-8 * t3 ^ 2 - 173.58329e-


k14 = t4 * (-14.512474e-2 + 53.638924e-5 * t4 12 * t4 ^ 3) ^ 3; - 5.3051604e-8 * t4 ^ 2 - 173.58329e-

k15 = t5 * (-14.512474e-2 + 53.638924e-5 * t5 12 * t5 ^ 3) ^ 3; - 5.3051604e-8 * t5 ^ 2 - 173.58329e-

k2f = tf * (-14.181715e-2 + 36.866353e-5 * tf 12 * tf ^ 3) ^ 3; + 16.521412e-8 * tf ^ 2 - 248.23843e-

k20 = t0 * (-14.181715e-2 + 36.866353e-5 * t0 12 * t0 ^ 3) ^ 3; + 16.521412e-8 * t0 ^ 2 - 248.23843e-

k21 = t1 * (-14.181715e-2 + 36.866353e-5 * t1 12 * t1 ^ 3) ^ 3; + 16.521412e-8 * t1 ^ 2 - 248.23843e-

k22 = t2 * (-14.181715e-2 + 36.866353e-5 * t2 12 * t2 ^ 3) ^ 3; + 16.521412e-8 * t2 ^ 2 - 248.23843e-

k23 = t3 * (-14.181715e-2 + 36.866353e-5 * t3 12 * t3 ^ 3) ^ 3; + 16.521412e-8 * t3 ^ 2 - 248.23843e-

k24 = t4 * (-14.181715e-2 + 36.866353e-5 * t4 12 * t4 ^ 3) ^ 3; + 16.521412e-8 * t4 ^ 2 - 248.23843e-

k25 = t5 * (-14.181715e-2 + 36.866353e-5 * t5 12 * t5 ^ 3) ^ 3; + 16.521412e-8 * t5 ^ 2 - 248.23843e-

k3f = tf * (-18.967651e-2 + 61.239667e-5 * tf 12 * tf ^ 3) ^ 3; - 17.891649e-8 * tf ^ 2 - 90.855512e-

k30 = t0 * (-18.967651e-2 + 61.239667e-5 * t0 12 * t0 ^ 3) ^ 3; - 17.891649e-8 * t0 ^ 2 - 90.855512e-

k31 = t1 * (-18.967651e-2 + 61.239667e-5 * t1 12 * t1 ^ 3) ^ 3; - 17.891649e-8 * t1 ^ 2 - 90.855512e-

k32 = t2 * (-18.967651e-2 + 61.239667e-5 * t2 12 * t2 ^ 3) ^ 3; - 17.891649e-8 * t2 ^ 2 - 90.855512e-

k33 = t3 * (-18.967651e-2 + 61.239667e-5 * t3 12 * t3 ^ 3) ^ 3; - 17.891649e-8 * t3 ^ 2 - 90.855512e-

k34 = t4 * (-18.967651e-2 + 61.239667e-5 * t4 12 * t4 ^ 3) ^ 3; - 17.891649e-8 * t4 ^ 2 - 90.855512e-

k35 = t5 * (-18.967651e-2 + 61.239667e-5 * t5 12 * t5 ^ 3) ^ 3; - 17.891649e-8 * t5 ^ 2 - 90.855512e-

hv11 = (81.795910 + 389.81919e-4 * t1 +36.470 hv12 = (81.795910 + 900e-6 * t1 ^ 2) ^ 2;


389.81919e-4 * t2 +36.470 hv13 = (81.795910 + 389.81919e-4 * t3 900e-6 * t2 ^ 2) ^ 2;
+36.470 hv14 = (81.795910 + 4 * t19419e- +36.470 hv15 = (81.795910 900e-6 * t3 ^ 2) ^ 2;
+ 389.81919e-4 * t5 +36.470 900e-6 * t4 ^ 2) ^ 2;
900e-6 * t5 ^ 2) ^ 2;

hv21 = (152.66798 -1153.4842e-4 * t1 +146.64 hv22 = (152.66798 125e-6 * t1 ^ 2) ^ 2;


-1153.4842e-4 * t2 +146.64 hv23 = (152.66798 -1153.4842e-4 * t3 125e-6 * t2 ^ 2) ^ 2;
+146.64 hv24 = (152.66798 -1153.4842e-4 * +146.64 hv25 = 125e-6 * t3 ^ 2) ^ 2;
(152.66798 -1153.4842e-4 * t5 +146.64 125e-6 * t4 ^ 2) ^ 2;
125e-6 * t5 ^ 2) ^ 2;

hv31 = (147.65414 -1185.2942e-4 * t1 +152.87 hv32 = (147.65414 778e-6 * t1 ^ 2) ^ 2;


-1185.2942e-4 * t2 +152.87 hv33 = (147.65414 -1185.2942e-4 * t3 778e-6 * t2 ^ 2) ^ 2;
+152.87 hv34 = (147.65414 -1185.2942e-4 * +152.87 hv35 = 778e-6 * t3 ^ 2) ^ 2;
(147.65414 -1185.2942e-4 * t5 +152.87 778e-6 * t4 ^ 2) ^ 2;
778e-6 * t5 ^ 2) ^ 2;

h1f = (- 14.500060 + 1.9802223e-01 * tf + -2.9 048837e-4 * tf ^ 2) ^ 2;


hl10 = (- 14.500060 + 1.9802223e-01 * t0 -2.9 hl11 = (- 14.500060 + 048837e-4 * t0 ^ 2) ^ 2;
1.9802223e-01 * t1 -2.9 048837e-4 * t1 ^ 2) ^ 2;
hl12 = (- 14.500060 + 1.9802223e-01 * t2 - 2.9048837e-4 * t2 ^ 2) ^ 2;
hl13 = (- 14.500060 + 1.9802223e-01 * t3 - 2.9048837e-4 * t3 ^ 2) ^ 2;
hl14 = (- 14.500060 + 1.9802223e-01 * t4 - 2.9048837e-4 * t4 ^ 2) ^ 2;
hl15 = (-14.500060 + 1.9802223e-01 * t5 - 2.9048837e-4 * t5 ^ 2) ^ 2;

h2f = (-20.298110 + 2.3005743e-1 * tf - 3.8663417e-4 * tf ^ 2) ^ 2;


hl20 = (- 20.298110 + 2.3005743e-1 * t0 - 3.8663417e-4 * t0 ^ 2) ^ 2;
hl21 = (- 20.298110 + 2.3005743e-1 * t1 - 3.8663417e-4 * t1 ^ 2) ^ 2;
hl22 = (- 20.298110 + 2.3005743e-1 * t2 - 3.8663417e-4 * t2 ^ 2) ^ 2;
hl23 = (- 20.298110 + 2.3005743e-1 * t3 - 3.8663417e-4 * t3 ^ 2) ^ 2;
hl24 = (- 20.298110 + 2.3005743e-1 * t4 - 3.8663417e-4 * t4 ^ 2) ^ 2;
hl25 = (- 20.298110 + 2.3005743e-1 * t5 - 3.8663417e-4 * t5 ^ 2) ^ 2;

h3f = (-16.5534050 + 2.1618650e-1 * t F - 3.1476209e-4 * tf ^ 2) ^ 2;


hl30 = (-16.5534050 + 2.1618650e-1 * t 0 - 3.1476209e-4 * t0 ^ 2) ^ 2;
hl31 = (-16.5534050 + 2.1618650e-1 * t 1 - 3.1476209e-4 * t1 ^ 2) ^ 2;
hl32 = (-16.5534050 + 2.1618650e-1 * t 2 - 3.1476209e-4 * t2 ^ 2) ^ 2;
hl33 = (-16.5534050 + 2.1618650e-1 * t 3 - 3.1476209e-4 * t3 ^ 2) ^ 2;
hl34 = (-16.5534050 + 2.1618650e-1 * t 4 - 3.1476209e-4 * t4 ^ 2) ^ 2;
hl35 = (-16.5534050 + 2.1618650e-1 * t 5 - 3.1476209e-4 * t5 ^ 2) ^ 2;

hv1 = k11 * x11 * hv11 + k21 * x21 * hv21 + k31 *x 31 * hv31;


hv2 = k12 * x12 * hv12 + k22 * x22 * hv22 + k32 *x 32 * hv32;
hv3 = k13 * x13 * hv13 + k23 * x23 * hv23 + k33 *x 33 * hv33;
hv4 = k14 * x14 * hv14 + k24 * x24 * hv24 + k34 *x 34 * hv34;
hv5 = k15 * x15 * hv15 + k25 * x25 * hv25 + k35 *x 35 * hv35;

x10 = k 11 * x11;
x20 = k 21 * x21;
x30 = k 31 * x31;

hf = z1 * h1f + z2 * h2f + z3 * h3f;


h0 = x10 * hl10 + x20 * hl20 + x30 * hl30;
hl1 = x11 * hl11 + x21 * hl21 + x31 * hl31;
hl2 = x12 * hl12 + x22 * hl22 + x32 * hl32;
hl3 = x13 * hl13 + x23 * hl23 + x33 * hl33;
hl4 = x14 * hl14 + x24 * hl24 + x34 * hl34;
hl5 = x15 * hl15 + x25 * hl25 + x35 * hl35;

L0 = V1 - D;
L1 = V2 - D;
L2 = V3 + F-D; L3 = V4 +
F-D; L4 = V5 + F-D; L5 = B;

% The system of nonlinear equations


fun (1) = - ((V1-L0) * k11 + L1) * x11 + V2 * k12 * x12; fun (2) = - ((V1-L0) * k21 + L1) * x21 +
V2 * k22 * x22; fun (3) = - ((V1-L0) * k31 + L1) * x31 + V2 * k32 * x32;

fun (4) = L1 * x11 - (V2 * k12 + L2) * x12 + V3 * k13 * x13 + z1 * F; fun (5) = L1 * x21 - (V2 * k22 + L2) * x22 + V3 *
k23 * x23 + z2 * F;
fun (6) = L1 * x31 - (V2 * k32 + L2) * x32 + V3 * k33 * x33 + z3 * F;

fun (7) = L2 * x12 - (V3 * k13 + L3) * x13 + V4 * k14 * x14; fun (8) = L2 * x22 - (V3 * k23 + L3) * x23
+ V4 * k24 * x24; fun (9) = L2 * x32 - (V3 * k33 + L3) * x33 + V4 * k34 * x34;

fun (10) = L3 * x13 - (V4 * k14 + L4) * x14 + V5 * k15 * x15; fun (11) = L3 * x23 - (V4 * k24 + L4) * x24
+ V5 * k25 * x25; fun (12) = L3 * x33 - (V4 * k34 + L4) * x34 + V5 * k35 * x35;

fun (13) = L4 * x14 - (V5 * k15 + B) * x15; fun (14) = L4 * x24 - (V5 * k25
+ B) * x25; fun (15) = L4 * x34 - (V5 * k35 + B) * x35;

fun (16) = -V1 * hv1 + V2 * hv2 - L1 * hl1 + L0 * h0;


fun (17) = -V2 * hv2 + V3 * hv3 + L1 * hl1 - L2 * hl2 + hf * F;
fun (18) = -V3 * hv3 + V4 * hv4 + L2 * hl2 - L3 * hl3;
fun (19) = -V4 * hv4 + V5 * hv5 + L3 * hl3 - L4 * hl4;
fun (20) = -V5 * hv5 + Q + L4 * hl4 - L5 * hl5;

fun (21) = k1f * z1 + k2f * z2 + k3f * z3 - 1;


fun (22) = k10 * x10 + k20 * x20 + k30 * x30 - 1;
fun (23) = k11 * x11 + k21 * x21 + k31 * x31 - 1;
fun (24) = k12 * x12 + k22 * x22 + k32 * x32 - 1;
fun (25) = k13 * x13 + k23 * x23 + k33 * x33 - 1;
fun (26) = k14 * x14 + k24 * x24 + k34 * x34 - 1;
fun (27) = k15 * x15 + k25 * x25 + k35 * x35 - 1;

% NLEQ1 requires that myfun returns a column vector...


fun = fun ';

APPENDIX C

FSOLVE method through Matlab.

%
function tresycincofsolve
% three components five phases fsolve

xin = [0.2; 0.6; 0.2; 0.15; 0.15; 0.15; 0.15; 0.5177; 0.177; ...
0.085, 0.61912; 0.12912; 0.05; 0.76; 0.2; ...
1.1; 1,136; 1,135; 1,143; 1.6149; 520; 670; 674; 678; 682; 686; 690];
% Make a starting guess at the solution

options = optimset ( 'Display' , 'iter' ); % Option to display output


[x, ~, exitflag, ~, ~] = fsolve (@ myfun, xin, options)

options = optimset ( 'Display' , 'iter' , 'TolFun' , 1e-10, ...


'TolX' , 1e-10, 'MaxIter' , 50000, 'MaxFunEvals' , 200000, ...
'Algorithm' , 'Levenberg-Marquardt' );
[x, ~, exitflag, ~, ~] = fsolve (@ myfun, xin, options)

options = optimset ( 'Display' , 'iter' , 'Algorithm' , 'Levenberg-Marquardt' ); [x, ~, exitflag, ~, ~] = fsolve (@ myfun, xin, options)

end

function [fun] = myfun (xin)

% separating variables
F = 1; z1 = 0.10; z2 = 0.70; z3 = 0.20; B = 0.64; D = 0.36; Q = 9183;

% assignment of variables
x11 = xin (1);
x21 = xin (2);
x31 = xin (3);

x12 = xin (4);


x22 = xin (5);
x32 = xin (6);

x13 = xin (7);


x23 = xin (8);
x33 = xin (9);

x14 = xin (10);


x24 = xin (11);
x34 = xin (12);

x15 = xin (13);


x25 = xin (14);
x35 = xin (15);

V1 = xin (16);
V2 = xin (17);
V3 = xin (18);
V4 = xin (19);
V5 = xin (20);

tf = xin (21);
t0 = xin (22);
t1 = xin (23);
t2 = xin (24);
t3 = xin (25);
t4 = xin (26);
t5 = xin (27);
%
k1f = tf * (-14.512474e-2 + 53.638924e-5 * tf k10 = t0 * - 5.3051604e-8 * tf ^ 2 - 173.58329e-12 * tf ^ 3) ^ 3;
(-14.512474e-2 + 53.638924e-5 * t0 k11 = t1 * (-14.512474e-2 + - 5.3051604e-8 * t0 ^ 2 - 173.58329e-12 * t0 ^ 3) ^ 3;
53.638924e-5 * t1 k12 = t2 * (-14.512474e-2 + 53.638924e-5 * t2 k13 - 5.3051604e-8 * t1 ^ 2 - 173.58329e-12 * t1 ^ 3) ^ 3;
= t3 * (-14.512474e-2 + 53.638924e-5 * t3 k14 = t4 * (-14.512474e-2 - 5.3051604e-8 * t2 ^ 2 - 173.58329e-12 * t2 ^ 3) ^ 3;
+ 53.638924e-5 * t4 k15 = t5 * (-14.512474e-2 + 53.638924e-5 * t5 - 5.3051604e-8 * t3 ^ 2 - 173.58329e-12 * t3 ^ 3) ^ 3;
- 5.3051604e-8 * t4 ^ 2 - 173.58329e-12 * t4 ^ 3) ^ 3;
- 5.3051604e-8 * t5 ^ 2 - 173.58329e-12 * t5 ^ 3) ^ 3;
k2f = tf * (-14.181715e-2 + 36.866353e-5 * tf k20 = t0 * + 16.521412e-8 * tf ^ 2 - 248.23843e-12 * tf ^ 3) ^ 3;
(-14.181715e-2 + 36.866353e-5 * t0 k21 = t1 * (-14.181715e-2 + + 16.521412e-8 * t0 ^ 2 - 248.23843e-12 * t0 ^ 3) ^ 3;
36.866353e-5 * t1 k22 = t2 * (-14.181715e-2 + 36.866353e-5 * t2 k23 + 16.521412e-8 * t1 ^ 2 - 248.23843e-12 * t1 ^ 3) ^ 3;
= t3 * (-14.181715e-2 + 36.866353e-5 * t3 k24 = t4 * (-14.181715e-2 + 16.521412e-8 * t2 ^ 2 - 248.23843e-12 * t2 ^ 3) ^ 3;
+ 36.866353e-5 * t4 k25 = t5 * (-14.181715e-2 + 36.866353e-5 * t5 + 16.521412e-8 * t3 ^ 2 - 248.23843e-12 * t3 ^ 3) ^ 3;
+ 16.521412e-8 * t4 ^ 2 - 248.23843e-12 * t4 ^ 3) ^ 3;
+ 16.521412e-8 * t5 ^ 2 - 248.23843e-12 * t5 ^ 3) ^ 3;

k3f = tf * (-18.967651e-2 + 61.239667e-5 * tf k30 = t0 * (-18.967651e-2 + - 17.891649e-8 * tf ^ 2 - 90.855512e-12 * tf ^ 3) ^ 3;


61.239667e-5 * t0 k31 = t1 * (-18.967651e-2 + 61.239667e-5 * t1 k32 = t2 - 17.891649e-8 * t0 ^ 2 - 90.855512e-12 * t0 ^ 3) ^ 3;
* (-18.967651e-2 + 61.239667e-5 * t2 k33 = t3 * (-18.967651e-2 + - 17.891649e-8 * t1 ^ 2 - 90.855512e-12 * t1 ^ 3) ^ 3;
61.239667e-5 * t3 k34 = t4 * (-18.967651e-2 + 61.239667e-5 * t4 k35 = t5 - 17.891649e-8 * t2 ^ 2 - 90.855512e-12 * t2 ^ 3) ^ 3;
* (-18.967651e-2 + 61.239667e-5 * t5 - 17.891649e-8 * t3 ^ 2 - 90.855512e-12 * t3 ^ 3) ^ 3;
- 17.891649e-8 * t4 ^ 2 - 90.855512e-12 * t4 ^ 3) ^ 3;
- 17.891649e-8 * t5 ^ 2 - 90.855512e-12 * t5 ^ 3) ^ 3;

hv11 = (81.795910 + 389.81919e-4 * t1 + 36.470900e-6 * t1 ^ 2) ^ 2;


hv12 = (81.795910 + 389.81919e-4 * t2 + 36.470900e-6 * t2 ^ 2) ^ 2;
hv13 = (81.795910 + 389.81919e-4 * t3 + 36.470900e-6 * t3 ^ 2) ^ 2;
hv14 = (81.795910 + 389.81919e-4 * t4 + 36.470900e-6 * t4 ^ 2) ^ 2;
hv15 = (81.795910 + 389.81919e-4 * t5 + 36.470900e-6 * t5 ^ 2) ^ 2;

hv21 = (152.66798 -1153.4842e-4 * t1 + 146.64125e-6 * t1 ^ 2) ^ 2;


hv22 = (152.66798 -1153.4842e-4 * t2 + 146.64125e-6 * t2 ^ 2) ^ 2;
hv23 = (152.66798 -1153.4842e-4 * t3 + 146.64125e-6 * t3 ^ 2) ^ 2;
hv24 = (152.66798 -1153.4842e-4 * t4 + 146.64125e-6 * t4 ^ 2) ^ 2;
hv25 = (152.66798 -1153.4842e-4 * t5 + 146.64125e-6 * t5 ^ 2) ^ 2;

hv31 = (147.65414 -1185.2942e-4 * t1 + 152.87778e-6 * t1 ^ 2) ^ 2;


hv32 = (147.65414 -1185.2942e-4 * t2 + 152.87778e-6 * t2 ^ 2) ^ 2;
hv33 = (147.65414 -1185.2942e-4 * t3 + 152.87778e-6 * t3 ^ 2) ^ 2;
hv34 = (147.65414 -1185.2942e-4 * t4 + 152.87778e-6 * t4 ^ 2) ^ 2;
hv35 = (147.65414 -1185.2942e-4 * t5 + 152.87778e-6 * t5 ^ 2) ^ 2;

h1f = (- 14.500060 + 1.9802223e-01 * tf + -2.9048837e-4 * tf ^ 2) ^ 2;


hl10 = (- 14.500060 + 1.9802223e-01 * t0 -2.9048837e-4 * t0 ^ 2) ^ 2;
hl11 = (- 14.500060 + 1.9802223e-01 * t1 -2.9048837e-4 * t1 ^ 2) ^ 2;
hl12 = (- 14.500060 + 1.9802223e-01 * t2 -2.9048837e-4 * t2 ^ 2) ^ 2;
hl13 = (- 14.500060 + 1.9802223e-01 * t3 -2.9048837e-4 * t3 ^ 2) ^ 2;
hl14 = (- 14.500060 + 1.9802223e-01 * t4 -2.9048837e-4 * t4 ^ 2) ^ 2;
hl15 = (-14.500060 + 1.9802223e-01 * t5 -2.9048837e-4 * t5 ^ 2) ^ 2;

h2f = (-20.298110 + 2.3005743e-1 * tf -3.8663417e-4 * tf ^ 2) ^ 2;


hl20 = (- 20.298110 + 2.3005743e-1 * t0 -3.8663417e-4 * t0 ^ 2) ^ 2;
hl21 = (- 20.298110 + 2.3005743e-1 * t1 -3.8663417e-4 * t1 ^ 2) ^ 2;
hl22 = (- 20.298110 + 2.3005743e-1 * t2 -3.8663417e-4 * t2 ^ 2) ^ 2;
hl23 = (- 20.298110 + 2.3005743e-1 * t3 -3.8663417e-4 * t3 ^ 2) ^ 2;
hl24 = (- 20.298110 + 2.3005743e-1 * t4 -3.8663417e-4 * t4 ^ 2) ^ 2;
hl25 = (- 20.298110 + 2.3005743e-1 * t5 -3.8663417e-4 * t5 ^ 2) ^ 2;

h3f = (-16.5534050 + 2.1618650e- 1*t F - 3.1476209e-4 * tf ^ 2) ^ 2;


hl30 = (-16.5534050 + 2.1618650e- 1*t 0 - 3.1476209e-4 * t0 ^ 2) ^ 2;
hl31 = (-16.5534050 + 2.1618650e- 1*t 1 - 3.1476209e-4 * t1 ^ 2) ^ 2;
hl32 = (-16.5534050 + 2.1618650e- 1*t 2 - 3.1476209e-4 * t2 ^ 2) ^ 2;
hl33 = (-16.5534050 + 2.1618650e- 1*t 3 - 3.1476209e-4 * t3 ^ 2) ^ 2;
hl34 = (-16.5534050 + 2.1618650e- 1*t 4 - 3.1476209e-4 * t4 ^ 2) ^ 2;
hl35 = (-16.5534050 + 2.1618650e- 1*t 5 - 3.1476209e-4 * t5 ^ 2) ^ 2;
hv1 = k11 * x11 * hv11 + k21 * x21 * hv21 + k31 * x31 * hv31; hv2 = k12 * x12 *
hv12 + k22 * x22 * hv22 + k32 * x32 * hv32; hv3 = k13 * x13 * hv13 + k23 * x23
* hv23 + k33 * x33 * hv33; hv4 = k14 * x14 * hv14 + k24 * x24 * hv24 + k34 *
x34 * hv34; hv5 = k15 * x15 * hv15 + k25 * x25 * hv25 + k35 * x35 * hv35;

x10 = k11 * x11;


x20 = k21 * x21;
x30 = k31 * x31;

hf = z1 * h1f + z2 * h2f + z3 * h3f;


h0 = x10 * hl10 + x20 * hl20 hl1 = x11 * + x30 * hl30;
hl11 + x21 * hl21 + x31 * hl31;
hl2 = x12 * hl12 + x22 * hl22 + x32 * hl32;
hl3 = x13 * hl13 + x23 * hl23 + x33 * hl33;
hl4 = x14 * hl14 + x24 * hl24 + x34 * hl34;
hl5 = x15 * hl15 + x25 * hl25 + x35 * hl35;

L0 = V1 - D;
L1 = V2 - D;
L2 = V3 + F-D; L3 = V4 +
F-D; L4 = V5 + F-D; L5 = B;

% The system of nonlinea r equations


fun (1) = - ((V1-L0) * k fun (2) = - 11 + L1) * x11 + V2 * k12 * x12; 21 + L1) * x21 + V2 *
((V1-L0) * k fun (3) = - ((V1-L0) * k3 k22 * x22; 1 + L1) * x31 + V2 * k32 * x32;

fun (4) = L1 * x11 - (V2 fun (5) = L1 * * k12 + L2) * x12 + V3 * k13 * x13 + z1 * F;
x21 - (V2 fun (6) = L1 * x31 - (V2 * k22 + L2) * x22 + V3 * k23 * x23 + z2 * F;
* k32 + L2) * x32 + V3 * k33 * x33 + z3 * F;

fun (7) = L2 * x12 - (V3 fun (8) = L2 * * k13 + L3) * x13 + V4 * k14 * x14;
x22 - (V3 fun (9) = L2 * x32 - (V3 * k23 + L3) * x23 + V4 * k24 * x24;
* k33 + L3) * x33 + V4 * k34 * x34;

fun (10) = L3 * x13 - (V4 fun (11) = L3 * * k14 + L4) * x14 + V5 * k15 * x15;
x23 - (V4 fun (12) = L3 * x33 - (V4 * k24 + L4) * x24 + V5 * k25 * x25;
* k34 + L4) * x34 + V5 * k35 * x35;

fun (13) = L4 * x14 - (V5 fun (14) = L4 * * k15 + B) * x15;


x24 - (V5 fun (15) = L4 * x34 - (V5 * k25 + B) * x25;
* k35 + B) * x35;

fun (16) = (-V1 * hv1 + fun (17) = (-V2 * V2 * hv2 - L1 * hl1 + L0 * h0) / 1e4;
hv2 + V fun (18) = (-V3 * hv3 + V fun (19)3 * hv3 + L1 * hl1 - L2 * hl2 + hf * F) / 1e4;
= (-V4 * hv4 + V fun (20) ) = (-V5 * hv5 + 4 * hv4 + L2 * hl2 - L3 * hl3) / 1e4;
5 * hv5 + L3 * hl3 - L4 * hl4) / 1e4;
Q + L4 * hl4 - L5 * hl5) / 1e4;

fun (21) = k1f * z1 +k 2f * z2 + k3f * z3 -1;


fun (22) = k10 * x10 + k 20 * x20 + k30 * x30 -1;
fun (23) = k11 * x11 fun (24) = + k21 * x21 + k31 * x31 - 1;
k12 * x12 fun (25) = k13 * x13 + k22 * x22 + k32 * x32 - 1;
fun (26) = k14 * x14 fun (27) = + k23 * x23 + k33 * x33 - 1;
k15 * x15 + k24 * x24 + k34 * x34 - 1;
+ k25 * x25 + k35 * x35 - 1;
%
End

You might also like