Section 3.3: Iterative Solution of Single Algebraic Equations

Introduction

To solve a single equation analytically it must be possible to rewrite it as a formula with its unknown on the left hand side. As already noted, this is in general possible only if either:
• The equation is linear in the unknown, i.e. the unknown appears only raised to the first power, and does not appear as the argument of a function such as log, sin or exp.
• The equation is nonlinear in the unknown, but the unknown appears only once. (This also formally requires that any nonlinear function which appears has an inverse, but this is true for all normal functions.)
A very few other special equations, such quadratics and cubics, have analytical solutions. These do not, however, generally appear in physical systems and so they are not treated here.

In practice there are also very few interesting problem in chemical engineering which can conveniently be turned into just one equation. However, we will later see how the methods used for a single equation can often be extended to more realistic problems described by quite large numbers of equations by analysing the structure of the set of equations. This uses essentially the same technique we have just used to solve certain sets of equations `directly' by rearrangement.

Rather than looking for trivial chemical engineering problems with single equations we shall deal with entirely abstract examples. Consider our single equation to involve a single unknown x, and may be written as:

f( x ) = 0

Here f implies any functional form which can be expressed using any of the algebraic operators with which we are already familiar.

We will also assume that our equations have a single solution at one value of x. In principle we know that this is not the case, e.g. a quadratic has two solutions, a cubic has three, etc. In practice, however, it is unusual for an engineering problem to have multiple meaningful solutions. There may be additional solutions which are mathematically valid, but they usually have values which are physically unacceptable, e.g. at mole fractions greater than one, or negative Kelvin temperatures. (Note: exceptions do occur, but they are outside the scope of this course.) Since the methods used to find the solution normally involve searching within predefined bounds, these physically unrealistic solutions may often be excluded.

Methods

The notes below describe three methods used to solve single algebraic equations:

Single Equation Solvers

Most spreadsheet systems now provide a solve or `goal seek' facility which can be programmed to adjust a cell, containing the value of the unknown (e.g. x) until another cell containing a formula involving the unknown (e.g. f( x )) is reduced to zero. The methods used in different spreadsheets vary in both power and sophistication. Try some of the examples below.

A WWW based solver using bisection and written in JavaScript is available in the modelling lab. It is worth using this on a few examples to watch the progress towards the solution.

Example Equations

1. x - 3 = 0
A linear equation is actually a special type of algebraic equation.

2. x2 - x -12 = 0
There are two solutions, one positive and one negative. Run the solver with different initial bounds (e.g. 0 to 12 and -12 to 0) and find both solutions separately. What happens if a set of bounds encompassing both solutions is given?

3. x + log (x) = 0
The solution lies between 0 and 1.0 but log(0) of course cannot be calculated.

4. x² - e-x = 0 ; solution is between -1 and +1

5. 1 - exp(-x) - exp(-2x) = 0 ; solution is between -1 and +1

6. 1 - (p1 + p2) = 0
where p1 = exp(11(1-300/x))
and p2 = exp(11(1-250/x))
Solution is between 100 and 400.