Sie sind auf Seite 1von 13

Genetic Algorithm for the Determination of Binodal

Curves in Ternary Systems Polymer–Liquid(1)–Liquid(2)


and Polymer(1)–Polymer(2)–Solvent

G. MILANI,1 F. MILANI2
1
Department of Engineering, University of Ferrara, Via Saragat 1, 44100 Ferrara, Italy
2
CHEM.CO Consultant, Via J.F. Kennedy 2, 45030 Occhiobello, Rovigo, Italy

Received 2 October 2006; Revised 1 February 2007; Accepted 23 February 2007


DOI 10.1002/jcc.20735
Published online 20 April 2007 in Wiley InterScience (www.interscience.wiley.com).

Abstract: A simple genetic algorithm for the numerical evaluation of binodal curves in ternary systems polymer–
liquid (1)–liquid (2) and polymer (1)–polymer (2)–solvent is presented. The technique exploits a specifically devel-
oped restarting technique based on a combined elitist and zooming strategy on the last population at each iteration.
The objective function (fitness) is represented by the weighted sum of the squared differences of chemical potentials
of the two phases of each component, obtained evaluating first derivatives of Gibbs free energy of the mixture with
respect to the number of moles of the components. The method proposed (a) is numerically stable since it does not
require the evaluation of first derivatives of the objective function and (b) can be applied in a wide range of cases
changing the equation of state. Several comparisons with simplified iterative procedures presented in the past in the
technical literature both for mixtures of two polymers with identical characteristics in a solvent and for mixtures of
solvent–nonsolvent–polymer with solvent–polymer interaction parameter equal to zero are reported. Finally, a com-
parison between present results and the ‘‘alternating tangent approach’’ is reported for two technically meaningful
binary systems, when a simplified PC-SAFT equation of state is adopted. The comparisons show that reliable results
can be obtained by means of the algorithm proposed and suggest that the procedure presented can be used for practi-
cal purposes.
q 2007 Wiley Periodicals, Inc. J Comput Chem 28: 2203–2215, 2007

Key words: genetic algorithms; ternary systems; phase diagrams; calculations; thermodynamics

Introduction guarantee stability when input parameters and governing equa-


tions are changed in a wide range.
The numerical determination of binodal curves for a generic bi- At this aim, in the present paper, a novel genetic algorithm
nary polymer–polymer system and ternary polymer–liquid (1)– based on a specifically developed restarting algorithm is pre-
liquid (2) and polymer (1)–polymer (2)–solvent system is, at sented and applied for the evaluation of binodal curves for gen-
present, an issue that deserves consideration. eral ternary systems polymer–liquid (1)–liquid (2) and polymer
In particular, some technical papers have been recently pre- (1)–polymer (2)–solvent.
sented in order to put at disposal to the practitioners both new For the sake of simplicity, the approach presented assumes,
analytical strategies (see refs. [1,2]) and refined numerical tools for the first examples, the general expression of Gibbs free
(see ref. [3]). The base is essentially an equation of state, that energy of a mixture derived from the well-known Flory–Hug-
could be chosen, for instance, into the SAFT family,3 for a nu- gins theory6–11; then, the procedure is applied to real mixtures
merical evaluation of the liquid–liquid phase equilibrium in making use of the simplified PC-SAFT equation of state.
polymer systems. At a first attempt, with the sole aim of testing As a rule, differentiation of Gibbs free energy with respect to
algorithms reliability, the Flory–Huggins theory can be used for number of moles of the ith component gives the i corresponding
the evaluation of the Gibbs free energy,4 despite the fact that chemical potential. Thus, binodal curves can be obtained imposing
case studies presented in the technical literature (see, for liquid–liquid phase equilibrium at a specified temperature and pres-
instance, ref. [5]), showed that the validity of this approach can sure, i.e. equating chemical potentials of each component between
be limited and that Flory–Huggins equation to liquid mixtures two phases, say  and . This yields to a nonlinear and, generally,
needs corrective parameters to fit well experimental data. In any nonconvex system of equations that should be solved resorting to
case, a general algorithm (a) sufficiently robust and (b) fast and
efficient for reproducing binodal curves in polymer mixtures
seems still of interest, especially if the numerical tool is able to Correspondence to: G. Milani; e-mail: gmilani@ing.unife.it

q 2007 Wiley Periodicals, Inc.


2204 Milani and Milani • Vol. 28, No. 13 • Journal of Computational Chemistry

numerical methods. It is worth underlining here that the algorithm feature consisting in a ‘‘restarting technique’’ is implemented.
proposed can be applied with any analytical expression of the Gibbs Such approach may be summarized in the following two steps.
free energy and that the classical Flory–Huggins theory is utilized In step 1, a first ‘‘trial’’ optimization is performed and from the
here in the first examples only with the aim of comparing the results last generation the individual with the best fitness is selected
obtained with consolidated solutions from the literature. Other nu- (IB ). In step 2, a new first generation is randomly reselected
merical approaches are, of course, at disposal to the practitioners; with new individuals collected in a zoomed domain fixed case
nevertheless, authors experienced that commercial packages based by case, but in which the individual IB selected from the previ-
on Newton–Raphson schemes12,13: (a) depend on the particular ous iteration is inserted. In this way, fitness of the best individ-
choice of the Gibbs free energy, since information on derivatives is ual in the first generation of iteration i is better (or at least
required; and (b) their convergence is strongly influenced by the equal) of that of the best individual of the last generation of iter-
starting point chosen at the first iteration. Furthermore, Newton– ation i  1. Since fitness function is zero in correspondence of
Raphson algorithms require particular care in the multidimensional the solution, step 2 is repeated until a fixed small tolerance (say
case and, for them, a strict monotony of the first partial derivatives TOL) is reached. Obviously, in each iteration, classic generation,
is recommended in order to guarantee the unconditioned success mutation, and crossover operators are suitably introduced. Fur-
of the method. Recent algorithms proposed, for instance, by thermore, step 2 combines an elitist strategy applied from itera-
von Solmes et al.3 are usually based on the so-called ‘‘alternating tan- tion i  1 to iteration i and a zooming technique, which at each
gent method,’’ a modification of a well-known Newton–Raphson iteration restricts the domain of random selection near the solu-
family procedure used in many technical applications. Contrary tion found in correspondence of the previous iteration.
to the schemes based on first derivatives, the approach here As authors experienced, a reliable evaluation of the solution
proposed is intended to avoid typical Newton–Raphson numerical point for a given concentration of one phase of one of the
instabilities and limitations, since, at least in principle, (a) the components is obtained with a very limited computational
calculation of Gibbs free energy second derivatives is not effort.
needed (neither analytically or numerically), (b) the method does In the following section, theoretical background of the prob-
not require particular properties of smoothness of the objective func- lem is briefly recalled, whereas in next section the genetic algo-
tion, and (c) is particularly efficient and less time-consuming rithm with restarting is presented in detail. In the Examples sec-
(because only a repeated evaluation of the objective function is per- tion, the numerical model is applied for several cases of techni-
formed). cal interest and compared with already presented solutions at
On the other hand, for simple cases in which, for instance, disposal, in order to test its reliability. Finally, two real exam-
two components behave in the same way with respect to the ples of bicomponent systems are treated in A Real Case Binary
third, robust iterative procedures or at hand simplified solutions Example section, making use of the simplified PC-SAFT method
in which only one unknown variable has to be determined have for the calculation of governing equations parameters.
been at disposal for decades.14–16 Nevertheless, the general prob-
lem remains an open issue and algorithms at disposal are not Theoretical Background
able to guarantee convergence without limitations.
In this framework, an approach based on genetic algorithms Flory–Huggins theory6 is the base to describe the phase behavior
seems particularly attractive. Such schemes, in fact, are based of a ternary system composed of liquid (1)–liquid (2)–polymer
solely on trivial algebraic operators (crossover and mutation) and polymer (1)–polymer (2)–solvent.
directly applied on random (sufficiently large) initial populations. For liquid (1)–liquid (2)–polymer systems, the Gibbs free
Fitness function, i.e. the function to be minimized, is repre- energy of mixing Gm for the solution can be evaluated,
sented by the weighted sum of the squared differences of chemi- according to ref. [17], as follows:
cal potentials of phases of each component. Once that a concen-
tration vi of one of the phases of one of the components in the
Gm ¼ RT½n1 ln 1 þ n2 ln 2 þ n3 ln 3 þ 12 n1 2 þ 13 n1 3
ternary systems is fixed, e.g. v1 , the minimization of the fitness
function is guessed on a three variables domain, being v2 , v01 , þ 23 n2 3 þ T n1 2 3  ð1Þ
and v02 the unknown concentrations.
In general, genetic algorithms require a sufficiently large where R is a constant; T is the temperature; ni and i are number
starting population to be reliable. Since for the present minimi- of moles and volume fraction of component i, respectively (i ¼ 1:
zation problem three unknown variables are involved (v2 , v01 , and liquid; i ¼ 2: liquid; i ¼ 3: polymer); ij is a binary interaction
v02 ), many points of evaluation of the objective function should parameter between component i and component j; T is a ternary
be used. Obviously, from a computational point of view, this interaction parameter introduced by some authors in order to fit
could represent a practical impossibility of application of the better experimental data in ternary systems.17,18
method or at least a strong limitation, especially if standard per- It is worth noting that Tompa14,16 (see also ref. [19]) calcu-
sonal computers nowadays at disposal are used. lated binodal curves for the case of nonsolvent (liquid (1))–sol-
For this reason, a specifically developed algorithm (GAR_ vent (liquid (2))–polymer with T ¼ 23 ¼ 12 ¼ 13 by means
TER) which avoids this key drawback is here presented. of a recursive algorithm based on at-hand calculations.
GAR_TER works with small initial populations (from 100 to Furthermore, Scott20 and Tompa16 were the first to apply
1000 points) and small total number of generations (from 60 to Flory–Huggins theory of polymer solutions to mixtures of poly-
600). In order to handle efficiently small populations, a special mers, with or without added solvent.

Journal of Computational Chemistry DOI 10.1002/jcc


Genetic Algorithm for the Determination of Binodal Curves in Ternary Systems 2205

In particular, Scott obtained the following expression for the where x1, x2, and x3 are the number of segments in component
Gibbs free energy of mixing of a total volume V of two polymers: 1, 2, and 3 respectively.
It is stressed that Eq. (4) is obtained by taking as the general-
Gm ¼ RTV=Vr ½A =xA ln A þ B =xB ln B þ AB A B  (2) ized expression for the entropy and for the heat of mixing in a
polycomponent system the following expressions:
where Vr is a reference volume which is taken as close as possible 8  P P
to the molar volume of the smallest polymer repeat unit; A and >
> Sm ¼ k ni ln vi ¼ kðn1 ln v1 þ ni ln vi Þ
>
<
B are the volume fractions of polymer A and B respectively; xA P
Hm ¼ z xi ni vi wij
and xB are the degrees of polymerization of polymer A and B >
>
>
:
respectively, in terms of the reference volume Vr ; AB is the inter- Gm ¼ Hm  T Sm ð5Þ
action parameter between polymer A and B and is related to the
enthalpy of interaction of the polymer repeat unit, each of molar
volume Vr. where Sm is the entropy of mixing calculated from external
In presence of a solvent, i.e. for polymer (1)–polymer (2)– configurational considerations neglecting first neighbor interac-
solvent ternary systems, Scott20 derived from Eq. (2) the follow- tions; Hm is the heat of mixing; z is the number of primary
ing expression for the Gibbs free energy of mixing: molecules combined in a given nonlinear molecule; k is the
Bolzmann’s constant; xi is the number of segments in a species
Gm ¼ RTV=Vs ½s ln s þ ðA =xA Þ ln A þ ðB =xB Þ ln B i; ni is the number of polymer molecules of species i in a solu-
tion; wij represents the interaction free energy change associ-
þ AB A B þ AS A S þ BS B S  ð3Þ ated with the formation of a contact between a pair of segments
of molecules i and j.
where index s refers to the solvent; Vs is the reference volume A geometrical representation of equilibrium of chemical
and equal to the molar volume of the solvent; AS and BS are potentials for a 2D problem in given in Figure 1, where the
the interaction parameters between polymer A and B respec- Gibbs free energy of a system in the bidimensional case is
tively, and the solvent. reported. Since chemical potentials are, by definition, the first
It is worth noting that xA, AB, AS, and BS must be consid- derivatives of the Gibbs free energy with respect to the number
ered in terms of reference volume Vs. of moles of the ith component, phases  and  can be evaluated
Scott calculated some binodals for special cases, as for instance, exploiting geometrical considerations, i.e. searching a line with
varying AB and assuming AS ¼ BS ¼ 0 with x ¼ xA ¼ xB. double tangency with respect to Gm . Such procedure is com-
In the general case studied here, see ref. [6], binodal curves can monly referred to as ‘‘common tangent algorithm.’’
be obtained evaluating chemical potentials of each component.
Differentiation of Gibbs free energy given both by (1) and (3) with
respect to number of moles of the ith component gives the corre- The Numerical Procedure:
sponding i chemical potential. Then liquid–liquid phase equilib- The GAR_TER Algorithm
rium at a specified temperature and pressure is imposed, i.e. chemi-
cal potentials of each component between two phases, say  and , In this section, a genetic algorithm with restarting tool
are equated. This yields to recover point by point binodal curves, (GAR_TER) specifically developed for reproducing binodal
by means of nonlinear and, generally, nonconvex system of equa- curves of polymeric ternary systems is presented.
tions that should be solved resorting to numerical methods. Denot- It is stressed that the reproduction of binodal curves for ter-
ing with v1, v2, v3 and v01 , v02 , v03 the concentrations of components nary systems of polymers is, from a numerical point of view, a
1, 2, 3 in phase one and phase two respectively, such system of very difficult task, at least in the general case of application of
equations can be written as follows: the Flory–Huggins theory. In fact, a system of nonlinear equa-
tions should be managed and, due to the strong nonconvexity of
the problem, the final success of the iterative procedure is not
0 0
h 1 ¼ 1 , F1 ¼ x1  1 x
guaranteed if derivatives methods are applied, as already dis-
1 1 cussed in ref. [12].
1  01 ¼ RT ln v1 þ ð1  v1 Þ  v2  v3 þ ð12 v2 þ 13 v3 Þ
x2 x3 i For this reason, a genetic scheme is adopted in this paper, so
x1
ðv2 þ v3 Þ  23 v2 v3 avoiding procedures based on derivatives evaluation.
x2 In general, a Genetic Algorithm (GA) is a stochastic global
0 0
h  2 ¼  2 , F 2 ¼ 2   2 search method that mimics the metaphor of natural biological
x2 x2
2  02 ¼ RT ln v2 þ ð1  v2 Þ  v1  v3 evolution. At a first attempt, see ref. [21], GAR_TER classically
x1 x3 i
x2 operates on a population of potential solutions applying the prin-
þð21 v1 þ 23 v3 Þðv1 þ v3 Þ  13 v1 v3 ciple of survival of the fittest to produce better and better
x1
0 0
h  3 ¼  3 , F 3 ¼ 3   3
approximations to a solution. At each generation, a new set of
x3 x3 approximations is created by the process of selecting individuals
3  03 ¼ RT ln v3 þ ð1  v3 Þ  v1  v2
x1 x2 i according to their level of fitness in the problem domain and
x3
þð31 v1 þ 32 v3 Þðv1 þ v2 Þ  12 v1 v2 ð4Þ breeding them together using operators borrowed from natural
x1 genetics. This process leads to the evolution of populations of

Journal of Computational Chemistry DOI 10.1002/jcc


2206 Milani and Milani • Vol. 28, No. 13 • Journal of Computational Chemistry

Figure 1. Determination of a binodal point in a 2D case (a) and corresponding ternary system (b).
[Color figure can be viewed in the online issue, which is available at www.interscience.wiley.com.]

individuals that are better suited to their environment than the Several types of selection operators have been described in
individuals that they were created from. the literature, see Goldberg21 and Young-Doo Kwon et al.,23 for
In particular, the kernel of the GA proposed is a set of tournament selection and proportional selection.
genetic operations consisting of reproduction, crossover, and The present study uses a stochastic sampling with replace-
mutation. In GAR_TER individuals Pi ¼ ½ ðv01 Þi ðv2 Þi ðv02 Þi  ment (roulette wheel). An interval I is determined as the sum of
are encoded as chromosomes strings composed by means of a P fi of all the individuals in the
the inverse of the fitness values
single-level binary string, so that the genotypes (chromosome current population, i.e. I ¼ 1=fi . For each individual i, a sub-
values) are uniquely mapped onto the decision variable (pheno- interval Si corresponding to the inverse of its fitness value inPthe
typic) domain. The use of Gray coding is necessary to avoid a interval ½ 0 I  is determined, i.e. Si ¼ 1=fi , so that I ¼ Si
hidden representational bias in conventional binary representa- and the size of the interval associated to each individual is pro-
tion as the Hamming distance between adjacent values is con- portional to its fitness, i.e. so that a big subinterval corresponds
stant.22 to a highly fit individual. To select an individual, a random
In what follows, the characteristics of the GA algorithm pro- number is generated in the interval ½ 0 I  and the individual
posed in this paper (GAR_TER) are described in detail. It is whose segment subinterval spans the random number is selected,
stressed that the kernel consists of an assemblage of both stand- see Figure 2. This process is repeated until the desired number
ard operators (reproduction, crossing-over, and mutation) and of individuals has been selected.
nonstandard strategies (zooming and restarting). For what con- Furthermore, in the present paper, an elitist strategy is also
cerns standard operators, only a brief description of both the applied, consisting in copying the strongest individual in the
mathematical background and the parameters adopted is reported new generation.
and the reader is referred to Goldberg21 for a detailed discussion
and characterization of the basic aspects of the model.
Crossover
Finally, it is stressed that ad hoc nonstandard strategies
(zooming and restarting) have been implemented in the code in A crossover operator is used to exchange genetic information
order to obtain a considerable improvement of both robustness between pairs, or larger groups, of individuals.
and stability (when applied to polymeric ternary systems) of In the present study, we use a multipoint crossover operator,
classical and generalist GAs at disposal in commercial packages. which works as follows: ki ¼ ½ 1 2    c  1  crossover
points are randomly selected on two individuals (parents) repre-
Reproduction
sented by c chromosomes (bits), as shown in Figure 3. Bits
During the reproduction phase, for each individual a fitness between the crossover points are exchanged between the parents
value derived from its raw performance measure given by the in order to produce two new offsprings.
objective function is assigned. This value is used in the selection
to bias towards more fit individuals. Highly fit individuals, rela-
tively to the whole population, have a high probability of being
selected for mating whereas less fit individuals have a corre-
spondingly low probability of being selected.
Once the individuals have been assigned a fitness value, they
can be chosen from the population, with a probability according
to their relative fitness, and recombined to produce the next
generation. Figure 2. Selection.

Journal of Computational Chemistry DOI 10.1002/jcc


Genetic Algorithm for the Determination of Binodal Curves in Ternary Systems 2207

chromosomal representation of each individual, so that m


depends both on the number of independent variables of the
optimization problem and on the desired encoding length. Once
that matrix P is at disposal, P is resized adding best fitness indi-
ðiÞT ðiÞT
vidual BF vector at the end of P ðPÞ ¼ ½PT BF 2 Þ. In this
way, the elitist strategy preserves the best individual of the pre-
vious iteration in the present iteration, whereas zooming tech-
nique restricts search domain, so improving in any case conver-
gence rate.
Furthermore, at each iteration, the algorithm ensures that the
population remains within the desired ‘‘zoomed’’ region during
the GA dynamics by means of a so-called ‘‘accept/refuse proce-
dure,’’ which consists in checking, for each individual Pi ,
whether Pi belongs to the zooming cube. If Pi does not belong
to the zooming cube (this situation can occur only when muta-
Figure 3. Multipoint crossover.
tion operator is applied, whereas crossing over always generates
Mutation individuals belonging to the admissible region, being crossing
over a linear operator), Pi is substituted by means of a random
Mutation is then applied to the new chromosomes, with a set selection of a new individual.
probability P. Mutation causes the individual genetic representa- The details of the algorithm are summarized by means of the
tion to be changed according to a probabilistic rule. In the bi- pseudocode reported in Table 1.
nary string representation, mutation causes a single bit to change It is stressed that such a zooming strategy consists, from a
its state, i.e. from 0 to 1 or from 1 to 0, see Figure 4. practical point of view, in limiting the so-called input random
Mutation is generally considered to be a background operator variability, i.e. the domain in which random population is gener-
that ensures that the probability of searching a particular sub- ated at each restarting step. In particular a square domain at
space of the problem space is never zero. In the present algo- each iteration
P P (with adding limitations 0  vi  1, 0  v0i  1,
rithm, mutation is applied with low probability fixed to 0.01. vi ¼ v0i ¼ 1) is chosen only for the sake of simplicity,
where the centroid of the domain is always represented by the
Individuals Fitness coordinates of the best fitness individual of the previous iteration
(elitist strategy).
Objective function (i.e. individuals fitness) is chosen as a
In this way, the best fitness individual of the first population in
weighted sum of the squared differences of chemical potentials
the (i + 1)th step presents a fitness value not grater to the fitness of
of the two phases of each component, see Eq. (4), as follows:
the best fitness individual of the last population in the ith step.
TOL_z restricts the random search at each restarting step i
X
3
following a forced behavior in the form TOL zðiÞ ¼ f^ðiÞ where
Fitness ¼ fi ¼ 1=x2i F2i ð6Þ
i¼1
the function f^ can be changed ad libitum by the operator
depending on the problem to solve. Unfortunately, no theorems
Restarting Technique and Zooming Strategy are available for assuring an unconditioned convergence of
the method in any case, as well as no theoretical rules can be
Finally, an ad hoc restarting technique is necessary when at the given in the choice of the f^ function. Even if this limitation
end of the last generation, fitness value of the best individual is could appear a rather important drawback of the method, it is
greater than a tolerance TOL sufficiently small and a priori fixed. always implicitly accepted that statistical/random optimization
Denoting for the problem at hand with v1 specific volume of approaches (such as for instance a genetic algorithm) do not
component 1, phase 1 and assuming v1 known at each iteration assure convergence at the desired solution without limitations.
step, v2 , v01 and v02 are stochastic variables, defined in the first As a consequence, only experience in the numerical simulations
iteration in the range ½ 0 1  and with inequality constraints of specific problems can help in the correct choice of input pa-
0  v3 ¼ 1  v1  v2  1, 0  v03 ¼ 1  v01  v02  1. Further- rameters. In this framework, for the problem at hand, authors
more, it is assumed that each individual ½ v2 v01 v02  is encoded experienced a quite robust behavior of the algorithm when an
using a 64-bit binary string (chromosomal representation). exponential function for f^ is chosen, as shown in Figure 5.
The kernel of the procedure adopted is based on a combined
elitist and zooming strategy, see also refs. [23,24] with fixed
edge length 2TOL_z of the zooming cube. In fact, at each itera-
tion, the new initial population is sampled randomly in the
zooming cube, but preserving the best fitness individual of the
previous iteration (elitist strategy). Form a practical point of
view, this procedure consists simply in the random generation of
a P matrix of the population with size nxm, where n is the total
number of individuals and m is the encoding string length of the Figure 4. Mutation.

Journal of Computational Chemistry DOI 10.1002/jcc


2208 Milani and Milani • Vol. 28, No. 13 • Journal of Computational Chemistry

Table 1. GAR_TER Pseudocode.

Step 0: Fix a value for v1 , TOL and TOL_z


Step 1a: First iteration, solve the unconstrained optimization problem (6) using a genetic algorithm (*) with bounds 0  v2  1  v1 , 0  v01  1,
0  v02  1 and 0  1  v01  v02  1
Step 1b: Select ½v2B v01B v02B  defined as the best individual from the last generation of Step 1a
Step 2:
If fitness of the best individual ½v2B v01B v02B  > TOL Then
Step 2a: Solve problem (6) using a GA (*) within a ‘‘zoomed’’ interval Iz for the population centered in ½v2B v01B v02B , as follows:

8
>
> Pi ¼ ½v01 v2 v02  2 Iz 8 9
>
>
>
> 8 9 >
> P^ ¼ ½^
v01 v^2 v^02 j >
>
>
> >
> >
>
< >
> P^i ¼ ½^ v01 v^2 v^02 j >
> >
> 0 i v^01  1 >
>
< 0 0 0 = < =
^ ^
v1B  TOL z  v1  v1B þ TOL z; ^
0  v2  1  v1
>
> Iz ¼ \
> >
> v2B  TOL z  v^2  v2B þ TOL z; > > > 0  1  v^2  v1  1 >
>
>
> : ; > >
>
>
>
>
>
> v02B  TOL z  v^02  v02B þ TOL z >
> 0  v^02  1 >
>
: : 0 0 ;
0  1  v1  v2  1

Step 2a-1: Check, for each individual Pi in each population and after each GA operation (mutation, crossover) if Pi ¼ ½v01 v2 v02  2 Ic . If 9i j Pi 2 = Ic ,
generate randomly a new individual Pei for each i j Pi 2= Ic , if necessary repeatedly, until all constraints are satisfied. In this way, an admissible individual
Pei 2 Ic is at disposal for index i. Delete the old inadmissible individual and insert the new admissible individual in position i.
Step 2b: At the last population select the best individual ½v01 v2 v02  and put it in vector ½v2B v01B v02B 
Repeat Step 2
End
(*) Reproduction, Crossover, Mutation operators included

Finally, it is worth noting that the algorithm recalled in Table agreement found suggests that the model can be used as a valuable
1 assures the success of the iterative procedure only when two alternative to more traditional Newton–Raphson schemes.
corresponding phases, denoted with symbols vi and v0i , do not
Binary Solvent–Polymer Mixture
coincide. This condition corresponds
  to impose a further numeri-
cal condition in the form vi  v0i  > TOL C 8i, with an a priori In order to test the reliability of the numerical model proposed,
fixed value for the constant TOL_C. let us consider the simple case of a two-component system con-
sisting of a solvent v1 and a homogeneous polymer v2 character-
Examples ized by the parameter x, representing the ratio of the molar vol-
umes of polymer and solvent. At a first attempt and for the sake
In this section, four technically meaningful cases are treated in of simplicity, we assume as governing equation (i.e. objective
detail and binodal curves are reproduced by means of the algo- function) the Flory–Huggins expression for the chemical poten-
rithm proposed. A preliminary example is reported for a binary tials of the two components:
polymer–polymer mixture, in order to test the robustness of the
01 ¼ ln v01 þ ð1  1=xÞv02 þ v0 2
algorithm using only one optimization variable. The results 2

obtained are compared with numerical data collected by Tompa.16


02 ¼ 1=x ln v01 þ ð1  1=xÞv01 þ v0 1
2
In the second example reported, the symmetrical case studied by ð7Þ
Scott20 for a ternary system consisting of two equal polymers
(polymer (1) and (2)) in a solvent is reported. Three different sub- Equating chemical potentials for the two coexisting phases for
cases are reproduced, varying 23 interaction parameter. both components, we obtain after trivial algebra, an optimization
In the third example, a comparison with Tompa16 for a problem in which, e.g. v2 is fixed and, at different values of ,
ternary system of a polymer, a solvent and a nonsolvent is dis- v02 is the sole optimization variable. In this way, it is possible to
cussed. Different subcases are reproduced, varying both x3 poly- plot binodals curves for the binary system in the v2  plane, as
merization degree and 13 . shown in Figure 6a, where a comparison between present results
Finally, in the last example, the basic equation of state is and Tompa data is reported varying the parameter x in a wide
changed making use of the simplified PC-SAFT method and two range. Finally in Figure 6b the best fitness value versus the gen-
technically meaningful subcases concerning binodal solutions pol- eration number for restarting step number 3 and x ¼ 100,
yisobutylene–diisobutyl ketone and polystyrene–methyl cyclohex- v1 ¼ 0:9 is reported. The very low value of the fitness at the end
ane are treated. Both binary liquid–liquid equilibrium systems of the step shows the reliability of the solution reached.
have been numerically reproduced by von Solmes et al.3 using an It is worth underling that, nowadays, this problem can be
‘‘alternating tangent approach.’’ Here, the GAR_ TER numerical solved easily making use both of standard numerical tools based
results are compared with those presented in ref. [3]. The good on Newton–Raphson algorithms and analytical simplified expres-

Journal of Computational Chemistry DOI 10.1002/jcc


Genetic Algorithm for the Determination of Binodal Curves in Ternary Systems 2209

nary Example section the authors present also comparisons


between the algorithm proposed and von Solms et al.3 Newton–
Raphson approach for real mixtures of technical interest (as for
instance polystyrene–methyl cyclohexane for different molecular
weights of polystyrene), when a simplified PC-SAFT equation of
state is adopted instead of the simple Flory–Huggins theory.

Symmetrical Case, Polymer (1)–Polymer


(2)–Solvent Solutions

A symmetrical case for a ternary system of two polymers with


identical characteristics in a solvent is discussed. Polymers are
assumed with the following parameters: x2 ¼ x3 ¼ 1000 and
12 ¼ 13 ¼ 0. For the solvent we assume x1 ¼ 1, whereas for
the polymers we assume three different interaction parameters
23 equal to 4, 8, and 10 respectively.
Figure 5. TOL zðiÞ ¼ TOL z0 f^ðiÞ function used in the simula- Scott solved this problem exploiting symmetry information
tion, where TOL z0 is the cube size in correspondence of the and reducing the problem, for a given concentration v1 , to a sim-
first iteration i. ple non linear equation in one unknown, as shown in Figure 7.
If a general approach is considered, a system of three nonlin-
ear equations in three unknowns should be tackled.
sions. Nevertheless, the example is numerically meaningful In Figure 8, a comparison between numerical results obtained
because (a) it allows us to test the reliability of the results with the algorithm proposed and Scott results is presented for
obtained making use of the genetic algorithm proposed and (b) the case 23 equal to 4.
shows that the approach proposed does not depend on the ana- The same comparisons are reported in Figures 9 and 10 for
lytical expression chosen as state equation, since that it is 23 ¼ 8 and 23 ¼ 20 respectively.
required only the numerical value of the objective function in In each optimization process, a population with 125 individu-
correspondence of an individual. At this aim, in A Real Case Bi- als and a total number of generations equal to 70 were fixed.

Figure 6. Binary solvent–polymer system. (a) Binodal curves in the v2   plane at different values
of the x parameter. (b) Logarithm of the best fitness versus generation for restarting number 3
x ¼ 100, v01 ¼ 0:9.

Journal of Computational Chemistry DOI 10.1002/jcc


2210 Milani and Milani • Vol. 28, No. 13 • Journal of Computational Chemistry

Figure 8. Symmetrical case studied by Scott with 23 equal to 4,


x2 ¼ x3 ¼ 1000, x1 ¼ 1, 12 ¼ 13 ¼ 0. Comparison between
numerical results and solution proposed by Scott.

For an arbitrarily chosen v1 a trial value of v01 is assumed.


Figure 7. Geometrical procedure for the evaluation of binodal
curves in the symmetrical case.
From the first part of Eq. (8), one obtains v03 Pv3 , from the third
v03 =v3 , and hence v03 and v3 . The condition vi ¼ 1 gives v02
and v2 . Their ratio can be compared with that calculated from
the second of Eq. (8). The divergence is used as a guide for a
Finally, in Figure 11 the best fitness value is plotted versus better choice of v01 .
generation for a restarting iteration i equal to 6 and v1 ¼ 0:2 for In Figure 12, a comparison between the iterative procedure
the case 23 ¼ 4. As it is possible to note, fitness value is very proposed by Tompa and the present numerical simulations is
close to zero, meaning that the best individual is near the actual shown assuming 12 ¼ 13 ¼ 0:9, 23 ¼ 0, x1 ¼ x2 ¼ 1, and
solution. Nevertheless, authors experienced that analytical results x3 ¼ 10.
are reproduced with good accuracy enforcing for TOL a value
less than or at least equal to 0.0001.

Liquid (1)–Liquid (2)–Polymer Solutions

The most commonly encountered ternary system containing poly-


mers is that of two non polymeric liquids and a polymeric species.
A simple case of a ternary system of nonsolvent NS or liquid
1 L(1), solvent S, or liquid 2 L(2), and polymer P in which the
interaction constants between one of the liquids and the polymer
equals that between the two liquids ð12 ¼ 13 Þ is here taken
into consideration. For this particular ternary system, an iterative
procedure was proposed by Tompa16 in the special case of
23 ¼ 0 and x1 ¼ x2 ¼ 1, which may be used as a comparison
with the general algorithm here proposed and which can be sum-
marized as follows:

v1  1
2ðv1  v01 Þ  ln ¼  1  ðv3  v03 Þ þ 12 ðv21  v02

v01 x3
v1 v0
2ðv1  v01 Þ  ln 0 ¼ ln 2
v1 v2 Figure 9. Symmetrical case studied by Scott with 23 equal to 8,
v 1 v0 x2 ¼ x3 ¼ 1000, x1 ¼ 1, 12 ¼ 13 ¼ 0. Comparison between
2ðv1  v01 Þ  ln 0 ¼ ln 3
1
ð8Þ
v1 x3 v3 numerical results and solution proposed by Scott.

Journal of Computational Chemistry DOI 10.1002/jcc


Genetic Algorithm for the Determination of Binodal Curves in Ternary Systems 2211

In each optimization process, a population with 600 individu-


als and a total number of generations equal to 100 were fixed.
Finally, in Figure 15 a comparison with Tompa results is
reported assuming 12 ¼ 13 ¼ 1:5 and x3 ¼ 100. As it is possi-
ble to note, in this case a not negligible error is present in the
solution found with GAR_TER with respect to literature results.
This is due to the value of the parameter x3 , which strongly
increases objective function flatness. Nevertheless, as shown in
Figure 16, the error e ½% between GA results   and GA
analytical

data, defined as e ½% ¼ max v1  vGA   
1 ; v2  v2 ; jv3 
vGA
3 jÞ=ð v 1 þ v 2 þ v3 Þ where the superscript ‘‘GA’’ indicates con-
centrations obtained with GAR_TER, does not exceed 4%, dem-
onstrating that, from a technical point of view, numerical results
are satisfactory.
Finally it is stressed that, each point of the equilibrium
curves reported required a processing time extremely low on a
Pentium Intel 3 GHz PC equipped with 2 GB RAM, varying
from 0.01 to 34 s assuming a final success tolerance TOL equal
Figure 10. Symmetrical case studied by Scott with 23 equal to 20, to 106.
x2 ¼ x3 ¼ 1000, x1 ¼ 1, 12 ¼ 13 ¼ 0. Comparison between nu-
merical results and solution proposed by Scott. A Real Case Binary Example

In this section, a comparison between the algorithm proposed


and the ‘‘alternating tangents approach’’ proposed in refs. [3]
Similarly, in Figures 13 and 14 the same comparisons are (see also ref. [25]) and [26] is reported for the determination of
reported assuming 12 ¼ 13 ¼ 1 and 12 ¼ 13 ¼ 1:5 respec- binodal solutions system polyisobutylene–diisopropyl ketone and
tively. polystyrene–methyl cyclohexane at different polymer molecular
The comparisons show that the general procedure here weights.
adopted is able to reproduce with good accuracy previously pre- Following the notation introduced in ref. [25], the governing
sented nongeneral procedures. equations for phase equilibrium can be formulated in a general

Figure 11. Best fitness versus generation for restarting number 6 1 ¼ 0:2, symmetric case 13 ¼ 23
equal to 4.

Journal of Computational Chemistry DOI 10.1002/jcc


2212 Milani and Milani • Vol. 28, No. 13 • Journal of Computational Chemistry

Figure 12. Unsymmetrical case (Tompa) with 12 ¼ 13 ¼ 0:9, Figure 14. Unsymmetrical case (Tompa) with 12 ¼ 13 ¼ 1:5,
23 ¼ 0, x1 ¼ x2 ¼ 1, x3 ¼ 10. Comparison between present nu- 23 ¼ 0, x1 ¼ x2 ¼ 1, x3 ¼ 10. Comparison between present nu-
merical results and iterative algorithm proposed by Tompa.16 merical results and iterative algorithm proposed by Tompa.16

way that applies to the evaluation of both binary and ternary liq- For the binary case, the logarithm of the temperature is an addi-
uid–liquid equilibrium. Denoting with NC the total number of tional variable, that is, a total of seven (3NC + 1) variables are
components, we assume as independent variables the logarithmic obtained.
mole fractions in phases 1 and 2 and the logarithm of the K fac- At equilibrium the fugacities of each component in the two
tors, which are defined as: phases are equal, i.e.
vi
Ki ¼ (9) ^ i ¼ v0 
vi  ^0 0 ^0 ^
v0i i i , Ki ¼ vi =vi ¼ i =i (10)

These variables form the full set of independent variables for where  ^ 0 are the fugacity coefficient in phase (1) and (2)
^ i and 
i
the ternary case, which gives us a total of nine (3NC) variables. respectively.

Figure 13. Unsymmetrical case (Tompa) with 12 ¼ 13 ¼ 1, Figure 15. Unsymmetrical case (Tompa) with 12 ¼ 13 ¼ 1:5,
23 ¼ 0, x1 ¼ x2 ¼ 1, x3 ¼ 10. Comparison between present nu- 23 ¼ 0, x1 ¼ x2 ¼ 1, x3 ¼ 100. Comparison between present
merical results and iterative algorithm proposed by Tompa.16 numerical results and iterative algorithm proposed by Tompa.16

Journal of Computational Chemistry DOI 10.1002/jcc


Genetic Algorithm for the Determination of Binodal Curves in Ternary Systems 2213

Figure 16. Error estimation between GA results and analytical results, Unsymmetrical case (Tompa)
with 12 ¼ 13 ¼ 1:5, 23 ¼ 0, x1 ¼ x2 ¼ 1, x3 ¼ 100.

Equation (10), together with the mass balances provides the rule, for binary systems with simplified PC-SAFT,11 can be sim-
following equations that have to be satisfied at equilibrium: plified to a great extent and, as suggested in refs. [3,26] reduces
to the well known following condition:
^ 0 Þ þ lnð
lnðKi Þ  lnð ^ iÞ ¼ 0 i ¼ 1; :::; NC h
X i ^ 1  lnð1  v1 Þ  ln 
f ¼ ln v1 þ ln  ^ 2  ln v0 þ ln ^0
1 1
0
vi ¼ 1 (11) i
X  lnð1  v01 Þ  ln ^0 ð12Þ
vi ¼ 1 2

where the objective function for the GA is represented by


Obviously, one of the independent parameters have to be F ¼ f 2 and other symbols have been already introduced.
fixed in order to solve the set of Eq. (11). Lindvig et al.25 sug- While composition derivatives of the fugacity coefficients are
gest to add a so-called ‘‘specification equation’’ in the form required using the method of alternating tangents, here only a
ys ¼ S, where y is the vector collecting all the variables, s is the numerical evaluation of fugacities (and not their derivatives with
index of the variable to be specified, that is, the position in the respect to compositions) is needed. Such numerical values are
variable vector y, and S is a fixed input specified value (which obtainable from the simplified PC-SAFT equation of state (see
is changed point by point when binodal curves have to be for further details Gross and Sadowski27–29).
obtained). In order to test the reliability of the numerical method pro-
With this formulation, the total number of equations and var- posed, two examples of technical interest are treated and a com-
iables is 7 for the binary case and 9 for the ternary case. As a

Figure 17. Comparison among experimental data, numerical com-


mon tangent approach and GA approach for polyisobutylene–diiso- Figure 18. Comparison among experimental data, numerical com-
propyl ketone systems. Experimental data are from Shultz and Flory. mon tangent approach and GA approach for polystyrene (1)–methyl
Lines are simplified PC-SAFT correlations with k12 ¼ 0:0053, the cyclohexane (2) solutions. All systems are represented by the binary
same at all three molecular weights. interaction parameters k12 ¼ 0.0065.

Journal of Computational Chemistry DOI 10.1002/jcc


2214 Milani and Milani • Vol. 28, No. 13 • Journal of Computational Chemistry

parison with previously presented numerical results by von Sol- I ¼ numerical interval
mes et al.3 and Kouskoumvekaki26 are reported. m ¼ vectors/matrices dimension
In particular, Figure 17 shows a comparison among present n ¼ vectors/matrices dimension
numerical data, alternating tangent approach3 and experimental ni ¼ number of moles of component i
data for polyisobutylene–diisopropyl ketone binary systems at P ¼ population matrix (size nxm)
different polymer molecular weights. R ¼ constant
PC-SAFT parameters were obtained following the procedure s ¼ index referred to the solvent
adopted in ref. [26] and the reader is referred to refs. [3,26] for Si ¼ sub-interval
further details. Experimental data are from Shultz and Flory.30 A T ¼ temperature
single binary interaction parameter k12 was taken for all the sys- TOL ¼ small numerical tolerance
tems, as suggested in ref. [26]. TOL C ¼ forced numerical condition on phase 1 and phase 2
As it is possible to notice, the numerical procedure gives difference
identical results with respect to the alternating tangent approach. TOL_z ¼ 1/2 edge length of the zooming cube
Each point has been obtained by means of a numerical optimiza- Vr ¼ reference volume
tion which required in the most critical case less then 10 s. Vs ¼ reference volume (equal to the molar volume of the solvent)
While a comparison with experimental evidences is not the x ¼ binary systems, ratio of the molar volumes of polymer and
objective of the paper, experimental values are reported for the solvent
sake of completeness. Here we only remark that the GA xA (xB ) ¼ degrees of polymerization of polymer A (B) in terms
approach proposed seems particularly attractive with respect to of the reference volume Vr
the alternating tangent approach because is, in principle, more xi ¼ the number of segments in a species i;
generalist and does not require analytical/numerical evaluation z ¼ number of primary molecules combined in a given non-lin-
of derivatives. ear molecule
The same comparisons are reported in Figure 18 for the sys- Gm ¼ Gibbs free energy
tem polystyrene–methylcyclohexane for polystyrene molecular Hm ¼ heat of mixing
weights equal to 10,200, 46,400, and 719,000 in order of Sm ¼ entropy of mixing
increasing critical solution temperature. In order to compare i ¼ ith component chemical potential
results with those obtained in refs. [3,26] all systems are repre- 0i ¼ reference chemical potential of the ith component
sented by the binary interaction parameters k12 ¼ 0.0065, vi ¼ ith component concentration of phase 1
whereas experimental data are taken from Dobashi et al.31,32 As v1 , v2 , v3 (v01 , v02 , v03 ) ¼ concentrations of components 1, 2, 3 in
in the previous case, the agreement with von Solmes et al.3 phase one (two)
results is worth noting. i ¼ volume fraction of component i
A (B ) ¼ volume fractions of polymer A (B)
^ i ¼ fugacity coefficient in phase (1).

Conclusions ^ 0 ¼ fugacity coefficient in phase (2).
 i
T ¼ ternary interaction parameter
A genetic algorithm for the numerical evaluation of binodal ij ¼ binary interaction parameter between component i and
curves in ternary systems liquid (1)–liquid (2)–polymer and component j
polymer (1)–polymer (2)–solvent has been presented. The tech- AB ¼ interaction parameter between polymer A and B
nique exploits a specifically developed restarting technique AS (BS ) ¼ interaction parameters between polymer A (B) and
based on a combined elitist and zooming strategy on the last the solvent
population at each iteration. Objective function (fitness) is repre-
k ¼ Bolzmann’s constant
sented by the weighted sum of the squared differences of chemi- ni ¼ number of polymer molecules of species i in a solution
cal potentials of the two phases of each component, obtained wij ¼ interaction free energy change between a pair of seg-
evaluating first derivatives of Gibbs free energy of the mixture ments of molecules i and j
with respect to the number of moles of the components. Equilib-
rium conditions between two phases of the same component
have been derived from the classical Flory–Huggins theory References
(which implies only thermodynamic parameters) or making use
of the simplified PC-SAFT method. The reliability of the 1. Sollich, P.; Warren, P. B.; Cates, M. E. Adv Chem Phys 2001, 116,
approach adopted has been assessed through meaningful compar- 265.
isons with simple cases reported in the technical literature. 2. Sollich, P. J Phys: Condens Matter 2002, 14, R79.
3. von Solms, N.; Kouskoumvekaki, I. A.; Lindvig, T.; Michelsen, M.
L.; Kontogeorgis, G. M. Fluid Phase Equilib 2004, 222/223, 87.
4. Lindvig, T.; Michelsen, M. L.; Kontogeorgis, G. M. Fluid Phase
Nomenclature Equilib 2002, 203, 247.
5. Favre, E.; Nguyen, Q. T.; Clement, R.; Neel, J. Eur Polym J 1996,
fi ¼ fitness valuesPof all the individuals in the current popula- 32, 303.
tion, i.e. I ¼ 1=fi 6. Flory, P. J. Principles of Polymer Chemistry; Cornell University
f^ ¼ TOL_z law of variation Press: Ithaca, NY, 1953.

Journal of Computational Chemistry DOI 10.1002/jcc


Genetic Algorithm for the Determination of Binodal Curves in Ternary Systems 2215

7. Flory, P. J. J Chem Phys 1941, 9, 660. 22. Holstien, R. B. Artificial genetic adaptation in computer control sys-
8. Flory, P. J. J Chem Phys 1942, 10, 51. tems, Ph.D. Thesis, Department of Computer and Communication
9. Huggins, M. L. J Chem Phys 1941, 9, 440. Sciences, University of Michigan, Ann Arbor, 1971.
10. Huggins, M. L. Ann NY Acad Sci 1942, 43, 1. 23. Kwon, Y.-D.; Kwon, S.-B.; Jin, S.-B.; Kim, J.-Y. Comput Struct
11. Huggins, M. L. J Am Chem Soc 1942, 64, 1712. 2003, 81, 1715.
12. Comincioli, V. Numerical Analysis, Methods Models and Applica- 24. Lee, K. S.; Geem, Z. W. Comput Struct 2004, 82, 781.
tions [in Italian]; Mc-Graw Hill: Milan, 1995. 25. Lindvig, T.; Michelsen, M. L.; Kontogeorgis, G. M. Ind Eng Chem
13. Emelianenko, M.; Liu, Z.-K.; Du, Q. Comput Mater Sci 2006, 35, Res 2004, 43, 1125.
61. 26. Kouskoumvekaki, I. A. Modeling of phase equilibria for paint-
14. Tompa, H. Trans Faraday Soc 1949, 45, 1142. related polymer systems, Ph.D. Thesis, Center for Phase Equilibria
15. Bramford, C. H.; Tompa, H. Trans Faraday Soc 1950, 46, 310. and Separation Processes (IVC-SEP), Department of Chemical Engi-
16. Tompa, H.Polymer Solutions; Butter Worths Scientific Publications: neering, Technical University of Denmark, Lyngby, 2004.
London, 1956. 27. Gross, J.; Sadowski, G. Ind Eng Chem Res 2001, 40, 1244.
17. Young, T.-H.; Chuang, W.-Y. J Membr Sci 2002, 210, 349. 28. Gross, J.; Sadowski, G. Ind Eng Chem Res 2002, 41, 1084.
18. Pouchley, J.; Zivny, A.; Solc, K. J Polym Sci 1968, C23, 245. 29. Gross, J.; Sadowski, G. Ind Eng Chem Res 2002, 41, 5510.
19. Scott, R. L. J Chem Phys 1949, 17, 268. 30. Shultz, A. R.; Flory, P. J. J Am Chem Soc 1952, 74, 4760.
20. Scott, R. L. J Chem Phys 1949, 17, 279. 31. Dobashi, T.; Nakata, M.; Kaneko, M. J Chem Phys 1980, 72,
21. Goldberg, D. E. Genetic Algorithms in Search, Optimization and 6685.
Machine Learning; Addison-Wesley Publishing: Reading, MA, 1989. 32. Dobashi, T.; Nakata, M.; Kaneko, M. J Chem Phys 1980, 72, 6692.

Journal of Computational Chemistry DOI 10.1002/jcc

Das könnte Ihnen auch gefallen