You are on page 1of 9

Computers and Chemical Engineering 35 (2011) 403411

Contents lists available at ScienceDirect

Computers and Chemical Engineering


journal homepage: www.elsevier.com/locate/compchemeng

A new homotopy for seeking all real roots of a nonlinear equation


Saeed Khaleghi Rahimian a , Farhang Jalali b , J.D. Seader c, , R.E. White a
a

Department of Chemical Engineering, University of South Carolina, Columbia, SC 29208, USA


Chemical Engineering Department, University of Tehran, Tehran, Iran
c
Department of Chemical Engineering, University of Utah, Salt Lake City, UT 84112, USA
b

a r t i c l e

i n f o

Article history:
Received 15 March 2010
Accepted 5 April 2010
Available online 10 April 2010
Keywords:
Nonlinear equation
Homotopy
Continuation
All real roots
Bifurcation
Path tracking

a b s t r a c t
A new continuation method, which applies a new homotopy that is a combination of the xed-point and
Newton homotopies (FPN), is developed for seeking all real solutions to a nonlinear equation, written
as f(x) = 0, without having to specify a bounded interval. First, the equation to be solved is multiplied by
(x x0 ), where x0 is the starting value, which is set to zero unless the function does not exist at x0 , in which
case x0 becomes a tracking initiation point that can be set arbitrarily to any value where the function
does exist. Next, the new function, (x x0 )f(x) = 0, is incorporated into the FPN homotopy. The initial step
establishes a single bifurcation point from which all real roots can be found. The second step ensures a
relatively simple continuation path that consists of just two branches that stem from the bifurcation point
and prevents the formation of any isola. By tracking the two branches of the homotopy path, all real roots
are located. Path tracking is carried out with MATLAB, using the continuation toolbox of CL MATCONT,
developed by Dhooge et al. (2006), based on the work of Dhooge, Govaerts, and Kuznetsov (2003), which
applies MoorePenrose predictor-corrector continuation to track the path, using convergence-dependent
step-size control to negotiate turning points and other sharp changes in path curvature. This new method
has been applied, without failure, to numerous nonlinear equations, including those with transcendental
functions. As with other continuation methods, f(x)must have twice-continuous derivatives.
2010 Elsevier Ltd. All rights reserved.

1. Introduction
Mathematical models of steady-state chemical processes consist of systems of algebraic and/or transcendental equations. When
all equations in the system are linear and independent of each
other, only a single solution exists, which is readily obtained by
robust numerical matrix methods. However, more commonly, the
system of equations contains some nonlinear equations. In that
case, multiple solutions may exist, where the unknowns may be
real positive, real negative, and/or complexconjugate pairs. When
the unknowns are absolute temperature, absolute pressure, ow
rate, and/or composition variables, only solution sets consisting of
real positive values are of interest. When the composition variables
are mole, mass, or volume fractions, only real positive values in the
region bounded by 0 and 1 are of interest.
Occurrences of multiple solutions of interest in chemical engineering problems have been known for decades. These include:
1. Cubic equations of state, such as the RedlichKwong equation, where, depending on the temperature, pressure, and
mixture composition, there exists three real-positive roots or

Corresponding author.
E-mail address: J.Seader@utah.edu (J.D. Seader).
0098-1354/$ see front matter 2010 Elsevier Ltd. All rights reserved.
doi:10.1016/j.compchemeng.2010.04.007

2.

3.

4.

5.
6.

one real positive root and one pair of complexconjugate


roots.
Fluid ow through a convergingdiverging nozzle, where, for
a sufciently large ow rate, one real-positive solution is for
subsonic conditions in the converging section of the nozzle and
another real-positive solution is for supersonic conditions in the
diverging section of the nozzle.
Underwood equations for component distribution from the feed
to the distillate and bottoms at minimum reux and innite
stages, where one real-positive solution exists between each pair
of ordered relative volatilities.
Liquidliquid equilibrium compositions when using the NRTL or
UNIQUAC activity coefcient equations, where more than one
set of real-positive mole fractions between 0 and 1 exist.
Adiabatic CSTR reactor with a single, homogeneous, exothermic
reaction, where three real-positive conversions may exist.
Effectiveness factor for a highly exothermic reaction in a porous
catalyst, where three real-positive values of the factor may exist.

For each of these classic cases, robust methods have been


devised to compute the multiple solutions. For example, the well
known analytical solution to the three roots of a cubic equation can
be applied to the cubic equation of state.
Prior to the late 1970s, the possible existence of multiple solutions in component-separation operations, e.g. distillation, was

404

S.K. Rahimian et al. / Computers and Chemical Engineering 35 (2011) 403411

not imagined, despite the nonlinear nature of the equations used


to model the operations. However, starting with a discovery by
Magnussen, Michelsen, and Fredenslund (1979) for heterogeneous
azeotropic distillation, multiple solutions have been found for a
wide variety of separation operations, including: isothermal ash of
a multicomponent system, binary distillation, multicomponent distillation, interlinked systems of distillation columns, homogeneous
azeotropic distillation, heterogeneous azeotropic distillation, reactive distillation, temperature-swing adsorption, pressure-swing
adsorption, membrane separation, and isothermal, continuous
MSMPR crystallization.
When considering the possibility of multiple solutions, it is
worthwhile to recognize the three types of multiplicity, as discussed by Gani and Jorgensen (1994):

Melville, Morgan, and Walker (1997), Kuznetsov (1998), Jalali and


Seader (1999), Bausa and Marquardt (2000), Gritton, Seader, and
Lin (2001), Wu (2005), and Imai, Yamamura, and Inoue (2005). In
this paper, only a single nonlinear algebraic and/or transcendental equation is considered, and a new homotopy is introduced and
applied to the determination of all real roots. Unlike the method of
Gritton, Seader, and Lin, the homotopy path of our method never
consists of branches that are only connected at opposite innities,
or by branches in the complex domain. Our new homotopy only
consists of one path, which is quickly tracked in the forward and
backward directions, called Branches 1 and 2, from the starting
point or a tracking initiation point. In a subsequent paper, our new
homotopy is extended to determine all real solutions to systems of
nonlinear algebraic and/or transcendental equations.

1. Output multiplicity, where all input variables are specied and


two or more sets of output variables are found.
2. Input multiplicity, where one or more output variables are specied and two or more sets of unspecied input variables are
found.
3. Internal-state multiplicity, where two or more sets of internal
conditions or proles are found for the same values of the input
and output variables.

2. The new homotopy (FPN)

All three types of multiplicity have been found for componentseparation operations.
Usually, multiplicity occurs only for certain sets of specications
and only over restricted ranges of certain parameters. Often, sets
of multiple solutions contain both stable and unstable solutions.
One or more of the stable solutions is clearly superior for practical
application and one or more of the other stable solutions is trivial
or very undesirable for practical application. For design purposes,
it is important to be aware of the possibility of multiplicity and
to discover all multiple solutions within the practical domain of
operating variables.
Numerical methods that seek to nd multiple solutions are:
1. Newtons method with deation, e.g. Press, Flannery, Teukolsky,
and Vetterling (1992).
2. Parallel-path homotopy-continuation methods for systems of
polynomial equations, which use Bezouts theorem for determining the maximum number of multiple solutions and nds all
solutions, real and positive, e.g. Morgan (1987).
3. Global homotopy-continuation methods, which attempt to nd
all sets of real solutions, e.g. references below.
4. Interval Newton method with generalized bisection, which
locates all real roots within specied intervals of the unknowns,
e.g. Kearfott and Novoa (1990).
5. Global terrain methods, which consist of a series of downhill,
equation-solving computations and uphill predictor-corrector
calculations to nd all physically meaningful solutions and singular points, e.g. Lucia and Feng (2002).
6. Deterministic branch-and-bound method that transforms the
system of equations into a global optimization problem, e.g.
Maranas and Floudas (1995).
7. Methods using cellular exclusion tests, e.g. Georg (2003).
Method 1 is unreliable. Method 2 is very reliable and easy to use,
but is restricted to polynomial equations. Methods 47 are reliable,
but require the specication of bounded intervals.
Here, we concentrate on Method 3, which has been discussed
and applied by a number of investigators, including Keller (1977,
1978), Chow, Mallet-Paret, and Yorke (1978), Garcia and Zangwill
(1979), Allgower and Georg (1980), Watson (1986), Wayburn and
Seader (1987), Allgower and Georg (1987), Kuno and Seader (1988),
Seader et al. (1990), Sun and Seider (1995), Watson, Sosonkina,

A widely used homotopy, H(x, t), consists of a linear combination of two real functions: f (x), whose zeroes are sought; and
G(x), a function for which a zero is known or readily selected or
obtained. Both functions must be smooth with twice-differentiable
derivatives. Thus,
H(x, t) = tf (x) + (1 t)G(x) = 0

(1)

where t, the homotopy parameter, allows tracking of a solution path


that connects the starting point, x0 , at t = 0, to all xi , which are all
solutions of f (x) = 0. Using numerical continuation, the parameter
t is gradually varied, starting from t = 0 and without being conned,
leading to a series of solutions to Eq. (1). Whenever the homotopy
path crosses t = 1, a solution to f (x) = 0 is found.
When attempting to determine all roots of f (x) = 0, the choice of
G(x) can be important. The three most widely cited G(x) functions
are the xed-point (FP) function,
G(x) = (x x0 ),

(2)

the afne function, which adds a factor, A, to the FP function to


improve scaling in the homotopy function,
G(x) = A(x x0 ),
where A is often taken as the derivative of f(x) evaluated at
the Newton (N) function,
G(x) = f (x) f (x0 )

(3)
x0 ,

and
(4)

When Eqs. (2) or (3) are applied to Eq. (1), the homotopy is satised by only one root at t = 0, the usual starting point. However, the
path can consist of branches that are only connected at opposite
innities or by branches in the complex domain. Kuno and Seader
(1988) present two methods for avoiding the innity problem. One
method involves a criterion for establishing a starting point; but
the criterion cannot always be implemented. The second method
involves an auxiliary function, which, however, adds an additional
equation to the one to be solved. When Eq. (4) is applied, f(x) = f(x0 )
at t = 0 and multiple starting points and multiple branches may
exist. Here, for reasons discussed below, we introduce a new formulation of the homotopy function of Eq. (1), which incorporates
a new G(x) function. At rst, the new homotopy appears to be considerably more complicated than Eq. (1) with Eqs. (2), (3), or (4).
However, after simplication, the new homotopy is less complex,
avoids the disadvantages of the xed-point, afne, and Newton
functions, and possesses superior characteristics for tracking the
homotopy path to determine all solutions to f (x) = 0. We refer to
the new homotopy, as the FPN homotopy because it uses elements
of the xed-point and Newton functions. Most important, the FPN
homotopy does not have multiple starting points and the path is
not connected at opposite innities.

S.K. Rahimian et al. / Computers and Chemical Engineering 35 (2011) 403411

The FPN homotopy is formulated in two steps. In the rst step,


the function to be solved is multiplied by the xed-point function
to give a new function,
F(x) = f (x)(x x0 )

(5)

Eq. (1) now becomes,


H(x, t) = tf (x)(x x0 ) + (1 t)G(x) = tF(x) + (1 t)G(x) = 0

(6)

In the next step, the G(x) function is formed by a combination


of the xed-point and Newton functions to give,
G(x) =



(x x0 ) + F(x) F(x0 )

=0

(7)

Substitution of Eq. (7) into Eq. (6) gives,



H(x, t) = tF(x) + (1 t) (x x0 ) + F(x) F(x0 )

=0

(8)

Although the FPN homotopy of Eq. (8) appears to be more complicated than homotopies formed from Eq. (1) with Eqs. (2), (3), or
(4), it is simplied by noting, rst, that Eq. (5) causes F(x0 ) to equal
zero. Then, substitution of Eq. (5) into Eq. (8), after simplication,
gives,
H(x, t) = (x x0 ) [1 + f (x) t] = 0

(9)

which is quite simple. Eq. (9) is the new homotopy for the continuation method presented here. As will be shown below, the
above rst step in its formulation establishes a single bifurcation
point, at x0 , from which all real roots can be found. The second step
ensures a relatively simple continuation path that consists of just
two branches that stem from the bifurcation point and prevents the
formation of any isola. By tracking the two branches of the homotopy path, all real roots are located. An even simpler homotopy,
namely H(x, t) = f (x) t = 0, possesses the same properties as that
of Eq. (9). However, most homotopies are based on the condition
that f(x) = 0 when t = 1. Our homotopy satises this condition, while
the simpler homotopy does not. Furthermore, as will be shown in a
companion paper, Eq. (9) is preferred when extending our method
to a system of nonlinear equations.
3. Characteristics of the FPN homotopy
The FPN homotopy of Eq. (9) has a number of interesting characteristics:
1. It is satised by either of the two factors, (x x0 ) and
[1 + f (x) t]. In a plot of the homotopy path as x versus t, (x = x0 )
establishes a horizontal branch, (x x0 ), which is dependent only
on the starting value, x0 , and is independent of the homotopy
parameter, t. The other factor, when written as [1 + f (x) t = 0],
is the only part of the homotopy that needs to be tracked, and
is independent of the starting value, x0 , but does depend on the
homotopy parameter.
2. Although not absolutely necessary, it is convenient to select a
starting value of zero for x0 , unless the function, f (x0 ), does not
exist at x0 , in which case x0 is set arbitrarily to any value where
the function does exist. If x0 is set to a value where the function, f (x0 ), exists, then the two parts of the homotopy, (x x0 )
and [1 + f (x) t = 0] intersect at (x = x0 ) and only at that value
of x. The0 value of t at the intersection is obtained by solving
1 + f (x ) t = 0 for t. This intersection point satises the conditions for a branch or bifurcation point (Kubicek & Marek, 1983)
as follows. Rearrange Eq. (9) to,
H(x, t) = (x x0 )(1 t) + (x x0 )f (x) = 0

405

Thus, solving Eq. (11), t = 1 + f (x0 ) at the bifurcation point.


The second condition is:
H
= 0 = (x0 x), at (x = x0 ). Thus, x = x0 at the bifurcation
t
point.
It is convenient to initiate tracking of the homotopy curve from
this sole and readily determined bifurcation point, x = x0 and
t = 1 + f (x0 ), despite the fact that t will rarely be zero at this
starting point.
3. When tracked, the homotopy function may exhibit limit or turning points, which satisfy the conditions (Kubicek & Marek, 1983):
H
dt
= 0 and dx
= 0. For the FPN homotopy, t = 1 + f (x). Differx
dt
= dfdx(x) = 0, and from Eq.
dx
0
x ) dfdx(x) . Combining the two

entiating,

(11),

H
x

The net result of these characteristics is that all roots of a single


nonlinear algebraic and/or transcendental equation can be readily
computed by tracking a single path with the FPN homotopy.
4. Steps for nding all roots with the FPN homotopy
The steps for nding all real roots with the FPN homotopy, as
used in this study, are as follows, with reference to Fig. 1, which
shows an example of homotopy paths.
Step 1: Convert the equation to be solved to the zero form, f (x) =
0, if it is not in this form. In doing this, examine the function
and determine if it can be reduced to a simpler form. Remove
dependent variables from any denominator terms where possible.
Consider changing variables and/or scaling.
Step 2: Multiply f(x) by (x x0 ) to give F(x) = (x x0 )f(x) = 0.
Step
the FPN
 3: Form

 homotopy, H(x, t) = tF(x) + (1
= 0.
t) (x x0 ) + F(x) F(x0 )

(10)

The rst of two conditions at the bifurcation point is:


H
df (x)
= 0 = (1 t) + f (x) + (x x0 )
dx
x

at (x = x0 )

(11)

= 0 = (1 t) +

f (x) + (x
conditions, limit points
occur at t = 1 + f (x) when df (x)/dx = 0.
4. For an isola to exist in the xt plane, at least two values of t
must exist for each real value of x in the isola region. From Eq.
(9), t = 1 + f (x). Thus, for each value of x, only one value of t is
determined and an isola cannot exist.
5. With some homotopies, the path in the xt plane may reach, one
or more times, t = + or t = at a value of x , requiring that the
path be transferred, at the same value, x , to t = or +. For
the FPN homotopy, the factor, (x x0 ) reaches t = . However,
the two branches of the other factor, [1 + f (x) t], may or may
not reach t = . If they do, it is highly unlikely that x+ = x .
Thus, most equations can be solved for all real roots by tracking
just the two branches that emanate from t = 1 + f (x), starting
from the bifurcation point at x0 .

Fig. 1. Example of homotopy branches.

406

S.K. Rahimian et al. / Computers and Chemical Engineering 35 (2011) 403411

Step 4: Simplify the FPN homotopy to its working form, H(x, t) =


(x x0 ) [1 + f (x) t] = 0.
Step 5: Select the starting point, x0 , as zero, unless f(x0 ) is not
dened; in which case, select a value of x0 (e.g. one) such that f(x0 )
is dened. This starting point is the bifurcation (branch) point, BP.
Note that although x0 is a root of F(x) = 0, it is not necessarily a root
of f(x) = 0, and, if not, is referred to as an excess root. In Fig. 1, the
function is not dened for x < 0 and x0 is arbitrarily chosen as 16.
When f(x) is not dened within certain bounds, starting points on
either side of the bounds can be used to nd all roots, as illustrated
in an example, Gritton et al. Problem No. 7, later in this paper.
Step 6: Note that the value of the homotopy parameter, t, for the
starting point is readily calculated from t = 1 + f (x0 ), and is usually
not zero as in the application of other homotopy methods. Note in
Fig. 1 that at the starting point, BP, t = 0.21.
Step 7: Ignoring the branch, x x0 , track the paths of Branches 1
and 2 of 1 + f (x) t = 0 that stem from the starting point in the
xt plane, proceeding carefully around any existing limit (turning)
points, LP. Branch 1 is computed by initially continuing backward
in t, while Branch 2 is computed by initially computing forward in
t.
Step 8: Verify any turning points by applying the condition, t =
1 + f (x) when df (x)/dx = 0. If possible, check for additional turning
points, which if found may require that extensions of the branches
be calculated.
Step 9: Note the value of x each time the path of a branch crosses
t = 1. That value is a root of f (x) = 0. In Fig. 1, three roots are shown,
one on Branch 1 and two on Branch 2. If Branch 2 were continued,
more roots might be found on that branch. If neither branch crosses
t = 1, it may be assumed that no real roots exist.
Step 10: Verify that each root satises f (x) = 0.
In Fig. 1, the function is a complicated trigonometric function,
and Branch 2 terminates at the point (t = 1, x = 0). Branch 1 may
approach x = without ever reaching values of the homotopy
parameter, t < 0 or > 2.
5. Path-tracking method
Computer programs for tracking continuation paths have been
widely available since 1976. They include: DERPAR (Kubicek,
1976), PITCON (Rheinboldt & Burkhardt, 1983), BIFPACK (Seydel,
1985), HOMPACK (Watson et al., 1997), CONTENT (Kuznetsov &
Levitin, 1997), AUTO (Doedel et al., 1997), and the MATCONT and
CL MATCONT toolboxes (Dhooge et al., 2006). In the work presented here, CL MATCONT was used because it is a toolbox for
MATLAB, which is a widely available standard engineering software environment, used by more than one million people. MATLAB
facilitates data exchange, visualization of computed results in the
form of plots and tables, and implements many of the efcient and
robust core numerical computing methods in MATLAB.
CL MATCONT was designed to study parameterized nonlinear
problems, particularly ODEs. It can nd limit points and various
types of bifurcation points. Of interest here is a limiting case of ODEs
at equilibria, where the derivatives are set to zero. For example,
consider the Bratu-Gelfand boundary-value problem (BVP) cited
by Govaerts (2000) and included in Dhooge et al. (2006):
dx
= x = y 2x + ex
dt

(12)

dy
= y = x 2y + ey
dt

(13)

where is a parameter. At equilibrium, x = y = 0. The result is


a set of two simultaneous nonlinear algebraic and transcendental
equations in terms of x, y, and the parameter, , where is analogous to the homotopy parameter, t, in Eq. (9). CL MATCONT readily

Fig. 2. Continuation calculations with CL MATCONT.

solves for the equilibrium values of x and y as a function of by


continuation from a starting point, which may be taken at (x, y,
) = (0, 0, 0), which satises x = y = 0. CL MATCONT detects all
limit and branching points, and can calculate all points for a specied value of the parameter. The CL MATCONT result is shown in
Fig. 2, where continuation in branch B1 reaches a limit point (LP)
at (x, y, ) = (1.0, 1.0, 0.368), a neutral saddle (H) at (x, y, ) = (2, 2,
0.271), and a branch point (BP) at (x, y, ) = (3, 3, 0.149). At the
branch point, forward and backward continuation produces the
branches, B2 and B3. Points at which = a specied value of 0.2 (u1)
are detected at (x, y, ) = (0.259, 0.259, 0.200) and (x, y, ) = (2.543,
2.543, 0.200). Branches are terminated when they reach a specied
number of points, but can be extended for an additional specied
number of points.
As with most continuation algorithms, CL MATCONT uses a
predictor-corrector method to track the branches. As is common,
a new point is predicted using the tangent to the curve and a
step-size. However, unlike many other continuation algorithms,
a Newton iteration based on a pseudo-arc length is not applied.
Instead, a Newton iteration based on the somewhat more efcient
MoorePenrose pseudo-inverse (Penrose, 1955) is used. A reliable
convergence-dependent method is used to control step-size. The
user can specify the initial, minimum, or maximum step-sizes, or
take the defaults. The maximum number of correction iterations
can also be specied or taken by default.
6. Application of the FPN homotopy
Gritton et al. (2001) successfully solved 15 single nonlinear
equations in chemical engineering for all roots, real and complex,
using a global xed-point homotopy method. These equations were
also solved successfully for all real roots with the FPN homotopy
method described above. We limit our discussion here to six of
these equations, and point out the signicant differences between
the two methods. The problem numbers are those assigned by
Gritton et al. (2001).
6.1. Gritton et al. Problem No. 1: chemical equilibrium
This problem involves a single nonlinear equation, studied by
Shacham (1989), which represents the chemical equilibrium of the
N2 H2 NH3 system at 500 C and 250 atm, where the variable, x, is
the fractional conversion of nitrogen starting with a stoichiometric
mixture of N2 and H2 . The equation is,
8(4 x)2 x2
(6 3x)2 (2 x)

0.186 = 0

(14)

Gritton et al. found two real roots (0.277759 and 0.384094),


and one pair of complex conjugates (3.948542 0.316124i). Only

S.K. Rahimian et al. / Computers and Chemical Engineering 35 (2011) 403411

407

Fig. 4. Extended FPN homotopy path for Gritton et al. Problem 1.


Fig. 3. FPN homotopy path for Gritton et al. Problem 1 using x0 = 0.

8[4 (0.384094)]2 (0.384094)2


the rst root is meaningful because the fractional conversion is limited to values between 0 and 1. To obtain the two real roots with the
FPN homotopy method, Eq. (14) was rst reduced and simplied,
according to Step 1 above, to the following fourth-order polynomial
equation:
f (x) = x4 7.79075x3 + 14.7445x2 + 2.511x 1.674 = 0

(15)

Applying Steps 24 above, by multiplying Eq. (15) by (x x0 ),


substituting the result into Eq. (8), and simplifying, as in Eq. (9), the
working FPN homotopy function is:

H(x, t) = (x 0) x4 7.79075x3

+ 14.7445x2 + 2.511x 0.674 t = 0

[6 3(0.384094)] [2 (0.384094)]
= 0.1860 and 0.1860 0.186 = 0.000
It is of interest to compare the above solution by the FPN homotopy method with a solution using the global xed-point homotopy
(GFPH) method described by Gritton et al. (2001), which is shown
in Fig. 5.
The path in Fig. 5 begins at (x, t) = (0, 0) and moves to the right,
crossing t = 1 at the root, 0.277759. The path then goes off to the rst
of four values of x at t = . These four values can be computed from
the GFPH equation for x0 = 0,

(16)

where zero has been assigned to the starting value, x0 , in Step 5


because f(x) is dened for that value of x. Applying Step 6, the value
of the homotopy parameter, t, is computed to be 0.674. Thus,
the branch (bifurcation) point (BP) for the homotopy function is
(x, t) = (0, 0.674). Starting from the branch point (BP), the two
branches are tracked using CL MATCONT. In Step 7, the forward
branch nds a root at 0.277759, while the backward branch nds a
limit point (LP) at 0.0800075 and a root at 0.384094, as shown
in Fig. 3.
One of the limitations of CL MATCONT is the need to specify
the number of points to be calculated along a branch. It is possible that one or the other of the two branches in Fig. 3 could turn
around and locate additional roots at t = 1, in which extensions of
the branches should be calculated. In Step 8, the limit point may be
veried as follows by computing the location of the turning points.
The result is three turning points located at x = 0.0800075 (shown
in Fig. 3), 2.0, and 3.92307. When CL MATCONT is used to extend
the branches, the result shown in Fig. 4 is obtained.
In Fig. 4, we now see all three turning points, but no additional
roots are found and because the branches cannot turn again, there
is no possibility of nding additional roots. In Step 9, we note that,
and CL MATCONT computes the two real roots stated above. In Step
10, the roots are veried for accuracy by substituting each of them
into Eq. (14), with the results:

+ (1 t) x = 0

(17)

Solving Eq. (17) for 1/t and taking the limit as t ,


x4 7.79075x3 + 14.7445x2 + 1.511x 1.674 = 0,

(18)

which has roots of 0.353988, 0.311347, 3.52735, and 4.30599. In


Fig. 5, after the homotopy path nds the rst root, it goes off at
t = for a value of x = 0.311347. The path is resumed for this same
value of x at t = . The path then moves to right, goes through a
turning point, and goes off at t = for a value of x = 3.52735. The
path reenters for this same value of x at t = , moves left to another

8(4 0.277759)2 (0.277759)2


(6 3 0.277759)2 (2 0.277759)
= 0.1860 and 0.186 0.186 = 0.000

H (x, t) = t x4 7.79075x3 + 14.7445x2 + 2.511x 1.674

Fig. 5. GFPH path for Gritton et al. Problem 1 using x0 = 0.

408

S.K. Rahimian et al. / Computers and Chemical Engineering 35 (2011) 403411

Fig. 6. FPN homotopy path for Gritton et al. Problem 3 using T0 = 273 K.

turning point, and goes off at t = for a value of x = 4.30599. The


path reenters for this same value of x at t = , moves to the right
and goes off at x = as t = 0 is approached. The path reenters for a
value of x = and t = 0, moves to the right and passes through the
other root of 0.384094 at t = 1, before going off at t = for a value
of x = 0.353988. Finally, the path reenters at t = for this same
value of x and moves right, reaching the starting point at (x, t) = (0,
0), thus, completing the path.
Although the same two roots are found (0.277759 and
0.384094), the homotopy path for the GFPH method is considerably more complicated than the path in Figs. 3 and 4 for the FPN
method. Furthermore, as shown by Gritton et al. (2001), if a value for
x0 > 2.36 is selected, all real branches of the homotopy curve cannot
be reached unless the path is tracked in the complex domain. With
the new homotopy method presented here, it is never necessary to
track the path in the complex domain to reach all real roots.

Fig. 7. Extended FPN homotopy path for Gritton et al. Problem 3.

more complicated than the FPN homotopy path in Figs. 6 and 7. As


in Fig. 5, the GFPH path goes in and out of at T = 558.9 K and also
at t = 0.013.
6.3. Gritton et al. Problem No. 7: fractional conversion in a reactor
This problem, which was presented by Shacham (1986), involves
the determination of the fractional chemical conversion, x, in a
reactor with the following equation:
f (x) =

6.2. Gritton et al. Problem No. 3: kinetics in a stirred reactor


This problem, which involves a transcendental function, is taken
from Shacham (1990) and is similar to one presented by Bilous and
Amundson (1955) in which the stability of a continuous stirredtank reactor (CSTR) is considered at steady state. An exothermic
rst-order, irreversible reaction, A B, is carried out in an adiabatic
reactor. Upon combining the kinetic and energy-balance equations,
the following equation is obtained for computing the nal temperature, T, in K.
f (T ) =

1
exp
T2

 21000 
T

1.11 1011 = 0

(19)

x
0.4 (1 x)
+ 4.45977 = 0
5 ln
1x
0.4 0.5x

There are two roots for this equation, x = 0.757396 and 1.098984,
where only the rst root is physically meaningful. The equation
has complex values in the domain 0.8 < x < 1.0 and two asymptotes
at x = 0.8 and 1.0, which is the reason we deal with this equation
in this paper. To solve the equation with the new homotopy, it is
necessary to select two tracking initiation points, one in the range
< x < 0.8 and the other in the range 1.0 < x < +. The homotopy
paths for initiation points 0.0 and 2.0 are shown in Fig. 9. The function has values of 4.4597700 and 4.4870955 at x = 0 and x = 2.0,
respectively, making the bifurcation points located at t = 4.4597700
and t = 4.4870955, respectively. It can be seen that both roots are
found at t = 1, one in the rst domain and the other in the second.

where the temperature, T, is in K. As discussed by Gritton et al., the


following logarithmic transformation greatly improves the scaling
of the problem, giving:
f (T ) = 2T ln(T ) + 25.432796T 21000 = 0

(20)

This nonlinear equation has only one real root at


T = 551.773825 K. A starting point of zero for T is not feasible;
instead, we arbitrarily select T0 = 273 K, which, from Eq. (20), gives
f(T0 ) = 10994.1, with a corresponding value of the homotopy
parameter at the starting point of t = 1 + f(T0 ) = 10993.1. The
homotopy path, which is almost a straight line, is shown in Fig. 6,
as computed with the CL MATCONT program. Only one root is
found. Even, when the range of temperature is extended over the
range of 16000 K, as shown in Fig. 7, the homotopy path is still
almost straight and no other real root is found.
It is again of interest to compare the above solution by the FPN
homotopy method with a solution to Problem 3 by the global xedpoint homotopy (GFPH) method described by Gritton et al. (2001),
which is shown in Fig. 8. The homotopy path in Fig. 8 is considerably

Fig. 8. GFPH path for Gritton et al. Problem 3 using T0 = 273 K.

S.K. Rahimian et al. / Computers and Chemical Engineering 35 (2011) 403411

Fig. 9. FPN homotopy path for Gritton et al. Problem 7.

Therefore if the equation is not continuous over the whole domain


( < x < +), a tracking initiation point must be selected for each
sub-domain where the function has real values.
6.4. Gritton et al. Problem No. 9: pressure drop in a diverging
nozzle
The pressure drop in a converging-diverging nozzle of the type
used in rocket engines is considered on page 204 of Carnahan,
Luther, and Wilkes (1969), based on the isentropic ow of an ideal
gas, with sonic velocity at the throat. After the compressible gas
passes through the throat, expansion occurs in an assumed frictionless manner with the pressure decrease resulting in increased
kinetic energy of the uid. The following equation gives the pressure, P, at an axial location in the nozzle where the cross-sectional
area of the nozzle, A > At (the cross-sectional area of the throat), is
specied:
f (P) =

  + 1 ((+1)/(1))  2 
 1

 (2/)
P
Pd

 P ((+1)/)
Pd

A2t
A2

=0

(21)

Pd is the upstream pressure corresponding to a very large


area, and  is the gas specic heat ratio. Let the parameters be
 = 1.4, Pd = 100, At = 0.10 and A = 0.12. The real roots of Eq. (21) are
P = 25.920406 and P = 78.997483. To solve this problem by homotopy continuation, arbitrarily select a starting-point value of 1
for P0 . When substituted into Eq. (21), f(P0 ) = 0.67927. The corresponding value of t for the FPN homotopy is computed from
t = 1 + f(P) as 0.32073. Thus, the branch point, which is used as the
starting point, is established. The homotopy path computed by
CL MATCONT is shown in Fig. 10, where the two roots are readily located. A backward branch from the branch point is not shown
because the nozzle equation is known to have only two real roots
and both are found on the forward branch.

Fig. 10. FPN homotopy path for Gritton et al. Problem 9 using P0 = 1. For this problem,
the GFPH method produced a simple path, somewhat similar to the FPN homotopy
method, with no branches going in or out of innity.

homotopy paths for some of the problems, namely Problems 4, 6, 7,


1013, and 15 were complicated by tracking in the complex domain
and/or tracking to in the homotopy parameter, t.
6.6. Two single nonlinear equations of special interest
Seven other types of single nonlinear equations were successfully solved for all real roots using the FPN homotopy method. Two
of them were of special interest and are presented here.
6.7. Problem SE-1
This problem consisted of the following second-degree polynomial equation, which has only complex roots, and was formulated
to see how the FPN homotopy method behaves when no real roots
exist. The function is:
f (x) = x2 4x + 13 = 0

(22)

Eq. (22) has a complex conjugate pair of roots, x = 2 + 3i and 2 3i.


A starting value of 0 was selected for x0 , corresponding to a value
of 14 for the homotopy parameter, t. The homotopy curve, as computed with CL MATCONT is shown in Fig. 11, where it can be seen
that the path does not intersect the vertical line for t = 1. Thus, there
are no real roots.

6.5. Other Gritton et al. problems


The CL MATCONT continuation program, using the FPN homotopy method, successfully solved all real roots of all the remaining
12 chemical engineering problems of Gritton et al, namely Problems 2, 48, and 1015. For all problems, the branch point of the FPN
method was easily computed and the branches were well behaved
as in Problems 1, 3, and 9 above. Although the GFPH method also
computed all real roots, as well as the complex roots when they
existed, the starting points required careful consideration and the

409

Fig. 11. FPN homotopy path for Problem SE-1 using x0 = 1.

410

S.K. Rahimian et al. / Computers and Chemical Engineering 35 (2011) 403411

7. Conclusions

Fig. 12. FPN homotopy path for Problem SE-2 using x0 = 0.

6.8. Problem SE-2


This problem was designed to test the ability of the FPN homotopy to track the path of a trigonometric function, complicated by
the addition of an exponential term in the form of a hyperbolic
function, as follows:
f (x) = sin(x)

cosh(x)
+ 0.5 = 0
1000

(23)

A starting point of x0 = 0 was selected, which gave a bifurcation


point at t = 1.5. The homotopy path is shown in Fig. 12. Tracking of
the forward branch found three real roots at x = 3.643, 5.975, and
8.000. Tracking of the backward branch found three real roots at
x = 0.522, 2.626, and 6.464. After nding the roots, the ends of
both branches tend to trail off to t = .
Problem SE-2 was also solved using the GFPH method, with
x0 = 0. The homotopy path is shown in Fig. 13, which exhibits some
of the characteristics of the complicated GFPH paths in Figs. 5 and 8.
Although the GFPH method nds all six roots, the paths go in and
out of t = at x = 1.495 and 10.003, and in and out of x = at
t = 0.
6.9. Problem SE-3
This problem, which involves the calculation of the real roots
of a third-degree polynomial equation is presented in Appendix A,
where the MATLAB m-les are listed.

Fig. 13. GFPH path for Problem SE-2 using x0 = 0.

A new homotopy-continuation method, which combines xedpoint and Newton homotopies is developed for seeking all real
solutions to a single nonlinear equation, written as f(x)= 0. First,
the equation to be solved is multiplied by (x x0 ), where x0 is the
starting value, which is set to zero unless the function does not exist
at x0 , in which case x0 can be set arbitrarily to any value where the
function does exist. Next, the new function, F(x) = (x x0 )f(x) = 0,
is incorporated into a new homotopy, which is the sum of the
xed-point and Newton functions. The resulting homotopy, which
when simplied is H(x, t) = (x x0 )[1 + f (x) t] = 0, is referred to
as the FPN homotopy. This homotopy establishes a single bifurcation point at x0 , from which all real roots can be found. The
homotopy path is relatively simple, consisting of a forward branch
and a backward branch. By tracking the two branches, all real roots
are located. Path tracking is conveniently carried out with MATLAB, using the continuation toolbox of CL MATCONT, developed
by Dhooge et al. (2006), based on the work of Dhooge, Govaerts,
and Kuznetsov (2003). This new method has been applied, without failure, to numerous nonlinear equations, including those with
transcendental functions.
Appendix A.
CL MATCONT m-les for computing all real roots of the equation:
f (x) = x3 6x2 + 21x 26 = 0

(A-1)

used MATLAB 7 on a PC with a Pentium 4 CPU running at 2.40 GHz


with MS Windows XP (SP-2). Two m-les were used: MainRealSE3.m and ProbSE3.m. These les do not include commands to
print or list the tracking results, but these commands can be added.
Listing of le, MainRealSE3.m:
clc
clear all
close all
format long
global x v s h f cds ap p x0 g
ap = 1;
x0 g = 0;
t = 1 + x0g3 -6*x0g2 + 21*x0g-26;
dx = 1e-3;
opt = contset;opt = contset(opt,MaxNumPoints,500);
opt = contset(opt,Singularities,1);
opt = contset(opt,Userfunctions,1);
UserInfo.name = userf1;UserInfo.state = 1;
UserInfo.label = u1;
opt = contset(opt,UserfunctionsInfo,UserInfo);
opt = contset(opt,Backward,1);
[x0,vO] = init EP EP(@ProbSE3,x0g + dx, t, ap);
[x1,v1,s1] = cont(@equilibrium,x0,[],opt);
opt = contset(opt,Backward,0);
[x1B,v1B,s1B] = cont(@equilibrium,x0,[],opt);
Listing of le, ProbSE3.m:
function out = ProbSE3
out{1} = @init;
out{2} = @fun eval;
out{3} = [];%@jacobian;
out{4} = [];
out{5} = [];%@hessians;
out{6} = [];
out{7} = [];
out{8} = [];

S.K. Rahimian et al. / Computers and Chemical Engineering 35 (2011) 403411

out{9} = [];
out{10}= @userf1;
% function dydt = fun eval(t,x,a)
global x0 g
f = (x-x0 g)*(x3 -6*x2 + 21*x-26);
% a = parameter
dydt = a*f + (1-a)*[x-x0g + f];
% function userfun1 = userf1(t,x,a)
userfun1 = a-1;
Results for Problem SE-3:
Calculation of Branch Point:
rst point found
tangent vector to rst point found
label = BP, x = (0.000000 -25.000000)
where x = (x, t)
Calculation of forward branch (one root found):
elapsed time = 2.1 secs
npoints curve = 500
rst point found
tangent vector to rst point found
label = u1, x = (2.000000 1.000000)
where x = (x,t)
Calculation of backward branch (no roots)
elapsed time = 1.9 secs
npoints curve = 500
The other two roots of the equation are the complex conjugate
pair, x = 2 3i.
References
Allgower, E. L., & Georg, K. (1980). Homotopy method of approximating several solutions to nonlinear systems of equations. In W. Forster (Ed.), Numerical solution
of highly nonlinear problems. Amsterdam: North-Holland.
Allgower, E. L., & Georg, K. (1987). Introduction to numerical continuation methods.
Philadelphia: Society for Industrial Mathematics.
Bausa, J., & Marquardt, W. (2000). Quick and reliable phase stability test in VLLE ash
calculations by homotopy continuation. Computers & Chemical Engineering, 24,
2447.
Bilous, O., & Amundson, N. R. (1955). Chemical reactor stability and sensitivity.
American Institute of Chemical Engineering Journal, 1, 513.
Carnahan, B., Luther, H. A., & Wilkes, J. O. (1969). Applied numerical methods. New
York: Wiley.
Chow, S. N., Mallet-Paret, J., & Yorke, J. A. (1978). Finding zeroes of maps: Homotopy
methods that are constructive with probability one. Mathematics of Computation,
32, 887.
Dhooge, A., Govaerts, W., & Kuznetsov, Yu. A. (2003). MatCont: A Matlab package
for numerical bifurcation analysis of ODEs. ACM Transactions on Mathematical
Software, 29(2), 141164.
Dhooge, A., Govaerts, W., Kuznetsov, Yu. A., Mestrom, W., Riet, A. M., & Sautois,
B. (2006). MATCONT and CL MATCONT: Continuation toolboxes in MATLAB
(http://www.matcont.ugent.be/manual.pdf).
Doedel, E. J., Champneys, A. R., Fairgrieve, T. F., Kuznetsov, Yu. A., Sandstede, B.,
& Wang, X. J. AUTO 97-00: Continuation and bifurcation software for ordinary differential equations (with HomCont), Users Guide, Concordia University,
Montreal, Canada (19972000) (http://indy.cs.concordia.ca).
Gani, G., & Jorgensen, J. B. (1994). Multiplicity in numerical solution of nonlinear
models: Separation processes. Computers and Chemical Engineering, 18, S55.

411

Garcia, C. B., & Zangwill, W. I. (1979). Determining all solutions to certain systems
of nonlinear equations. Mathematical Operations Research, 4, 1.
Georg, K. (2003). A new exclusion test. Journal of Computational and Applied Mathematics, 152, 147160.
Govaerts, W. J. F. (2000). Numerical methods for bifurcations of dynamical equilibria.
SIAM.
Gritton, K. S., Seader, J. D., & Lin, W. (2001). Global homotopy continuation procedures for seeking all roots of a nonlinear equation. Computers and Chemical
Engineering, 25, 1003.
Imai, Y., Yamamura, K., & Inoue, Y. (2005). An efcient homotopy method for nding
DC operating points of nonlinear circuits. IEICE Transactions on Fundamentals,
E88-A, No. 10, 25542561.
Jalali, F., & Seader, J. D. (1999). Homotopy continuation method in multi-phase multireaction equilibrium systems. Computers & Chemical Engineering, 23, 1319.
Kearfott, R. B., & Novoa, M. (1990). INTBIS, a portable interval Newton/bisection
package. ACM Transactions on Mathematical Software, 16, 152.
Keller, H. B. (1977). Numerical solution of bifurcation and nonlinear eigenvalue
problems. In P. Rabinowitz (Ed.), Applications of bifurcation theory. New York:
Academic Press.
Keller, H. B. (1978). Global homotopies and Newton methods. In C. deBoor, et al.
(Ed.), Recent advances in numerical analysis. New York: Academic Press.
Kubicek, M. (1976). Algorithm 502. Dependence of solution of nonlinear systems on
a parameter. ACT Transactions of Mathematical Software, 2(1), 98.
Kubicek, M., & Marek, M. (1983). Computational methods in bifurcation theory and
dissipative structures. Springer-Verlag: New York.
Kuno, M., & Seader, J. D. (1988). Computing all real solutions to systems of nonlinear equations with a global xed-point homotopy. Industrial Engineering and
Chemistry Research, 27, 1320.
Kuznetsov, Yu. A. (1998). Elements of applied bifurcation theory. Springer-Verlag.
Kuznetsov, Y. A., & Levitin, V. V. (1997). CONTENT: A multiplatform environment
for continuation and bifurcation analysis of dynamical systems. Centrum voor
Wiskunde en Informatica, Kruislaan 413, 1098 SJ Amsterdam, The Netherlands.
Lucia, A., & Feng, Y. (2002). Global terrain methods. Computers and Chemical Engineering, 26, 529.
Magnussen, T., Michelsen, M., & Fredenslund, A. (1979). Azeotropic distillation using
UNIFAC. Int. Chem. Engng. Symp. Ser., 56, 4.2/14.2/19.
Maranas, C. D., & Floudas, C. A. (1995). Finding all solutions of nonlinearly constrained systems of equations. Journal of Optimization, 7(2), 143182.
Morgan, A. P. (1987). Solving polynomial systems using continuation for engineering
and scientic problems. New Jersey: Prentice Hall.
Penrose, R. (1955). A generalized inverse for matrices. Proceedings of the Cambridge
Philosophical Society, 51, 406.
Press, W. H., Flannery, B. P., Teukolsky, S. A., & Vetterling, W. T. (1992). Numerical recipes in C: The art of scientic computing (2nd ed.). New York: Cambridge
University Press.
Rheinboldt, W. C., & Burkhardt, J. V. (1983). Algorithm 596. A program for locally
parametrized continuation process. ACT Transactions of Mathematical Software,
9, 236.
Seader, J. D., Kuno, M., Lin, W.-J., Johnson, S. A., Unsworth, K., & Wiskin, J. W. (1990).
Mapped continuation methods for computing all solutions to general systems
of nonlinear equations. Computers and Chemical Engineering, 14, 71.
Seydel, R. (1985). BIFPACK: A program package for calculating bifurcations. State University of New York at Buffalo.
Shacham, M. (1986). Numerical solution of constrained nonlinear algebraic equations. International Journal of Numerical Methods in Engineering, 23, 1455.
Shacham, M. (1989). An improved memory method for the solution of a nonlinear
equation. Chemical Engineering Science, 44, 1495.
Shacham, M. A. (1990). A variable order method for solution of a nonlinear algebraic
equation. Computers and Chemical Engineering, 14, 621.
Sun, A. C., & Seider, W. D. (1995). Homotopycontinuation method for stability analysis in the global minimization of the Gibbs free energy. Fluid Phase Equilibria,
103, 213.
Watson, L. T. (1986). Engineering applications of the Chow-York algorithm. Applied
Mathematics and Computation, 9, 111.
Watson, L. T., Sosonkina, M., Melville, R. C., Morgan, A. P., & Walker, H. F. (1997).
HOMPACK90: A Suite of Fortran 90 Codes for Globally Convergent Homotopy
Algorithms. ACM Transactions on Mathematical Software, 23, 514.
Wayburn, T. L., & Seader, J. D. (1987). Homotopy continuation methods for computeraided process design. Computers and Chemical Engineering, 11(1), 7.
Wu, T. M. (2005). A study of convergence on the Newton-homotopy continuation
method. Applied Mathematics and Computation, 168, 1169.

You might also like