Você está na página 1de 7

Topic 3: Describing the world in 3D, vectors and matrices

Matrices for Optimisation in Chemical Engineering


Optimisation problems, as you will explore in your second term, are problems in which
several variables can be modified to achieve a final, optimal answer, subject to constraints
and limitations.
In chemical engineering, optimisation problems are a constant encounter. For example, in oil
production. If a certain company is extracting two types of crude oil with different
compositions of kerosene, gasoline, fuel oil and residues; each with different selling prices
and separation and purification costs; it will aim to extract the right amount of each crude oil
to have the optimal profit when later selling them. On top
of that, there are several constraints. The country in
which it processes the oil may perhaps only allow a
certain amount of residue to be produced every day due
to environmental issues, or there may only be so much of
each type of oil that the company can extract per day. The
different compositions have different selling costs, one of
the oils may be worse for the environment when
processed
The list of factors is lengthy and each makes the search for the optimal amount of each type
of oil harder. So how do we go about tackling this?
A method used by most engineers and indeed the most common one in software is the use
of matrices.
All of the aforementioned factors can be written down as equations, which can then be easily
transformed into a matrix (we will not go into the mathematics behind this, as you will learn it
in Computational Modelling and Analysis). Through Gaussian elimination, a method for
solving a system of linear equations by reducing the rows in a matrix to zeroes through row
operations, the system is simplified to the point in which the engineer or the programme
arrives to a final and optimal solution.

Vectors in Chemical Engineering


Vectors are a fundamental part of engineering and are considered imperative in the design
of, for example, structures. Contrary to scalar values, vectors also give us information
regarding the direction of the measured quantity (for example, force or velocity). For
example, in electronical engineering, a particle with a certain charge under the effect of an
electric field will experience a force whichs magnitude and direction can be determined
through the use of vectors.

Example
An irrigation system for a crop field uses water from a source
which is known for having a pH that varies year-round. A
chemical engineer is hired to measure the pH of the water to
ensure it is within the healthy range for this specific crop. He will
drill a hole through one of the pipes and take a small sample of
water which he will later analyse to determine its level of acidity
or basicity. To do so, he places a small measurement device on
top of the soil which will display two coordinates for two different
points in the pipe with respect to the location of the device,
where each unit represents a centimetre. Once the coordinates
have been determined, he will remove the device to drill into the soil from the point at which
it was placed, in the direction which will yield the shortest distance to the pipe.
The device yields the following coordinates for points on the pipe with respect to its origin
(itself): (5, 3, 6) and (2, 4, 6). Determine the vector which defines the direction in which the
chemical engineer has to drill and the distance to the pipe from where he will start to drill (the
origin).
Hint: determine the vector equation of the pipe and the point closest to the origin in this line.
Solution
The direction of the pipe can be determined by using the method described in the
worksheet to calculate the direction of a vector. To then formulate a vector equation, we are
required to use any point on the line (if we just give the direction of the vector, it could lie
anywhere in space) to use as a reference point for the location in space of the pipe. Since
we already know 2 co-ordinates, any one would suffice. Hence, the vector equation can be
given by:
(3, -1, 0) t + (5, 3, 6)

equation a

The point closest to the origin can be considered to be defined by the coordinate
(3t1+5, -t1+3, 6), where t1 is an unknown to be determined.
Now, the closest point between a line and the origin will always be a point whichs line
connecting it to the origin is perpendicular to the line itself (the original line from which we
are getting this point).
The line connecting the point closest to the origin and the origin itself is given by
(3t1+5, -t1+3, 6) - equation b, where t1 is an unknown still to be determined. Since this line is
perpendicular to the vector defining the pipes direction, their scalar product will yield 0
(since the sine of 90 degrees is 0).
This implies that the equation for the scalar product can be reduced to a.b = 0 ie. the scalar
product of a and b is 0.
31 + 5
3
Therefore: ( 1) ( 1 + 3) = 0
0
6

Therefore yielding a value for t1 of -1.2


Hence, the point in the pipe closest to the origin is given by: (1.4, 1.8, 6). This is also the
vector direction in which the chemical engineer has to drill.

The distance is yielded by the square root of the sum of the squares of each of these
values: 1.42 + 1.82 + 62 = 6.42 , where the units are centimetres.

Example
Two liquid streams, each made of 3 smaller streams (A, B and I) which are completely
immiscible with each other, are mixed together through the use of a mixer. Each stream A,
B and I is made of different mixtures of compounds 1, 2 and 3. When stream 1 and stream 2
are mixed together, stream A from stream 1 mixes with stream A from stream 2, and so on
for B and I. The tables below show the molar flowrate (in kmol/hr) for each compound within
each stream:

MIXER

a) Represent in a matrix the output composition of each compound in each


stream.
Solution
The answer to this is simply the summation of the two matrices like so:
20 40 10
60 80 70
80 120 80
[30 10 20] + [10 50 20] = [ 40 60 40 ]
50 50 70
30 15 10
80 65 80
b) The company asks us to triple the molar flowrates of the first stream and double
the molar flowrates of the second stream. Develop new matrices to represent
these changes.
Solution
20 40 10
60 120 30
3 [30 10 20] = [ 90 30 60 ]
50 50 70
150 150 210
60 80 70
120 160 140
2 [10 50 20] = [ 20 100 40 ]
30 15 10
60 30 20
And we can read the data as we constructed it with the rows being the compounds
and the columns being the individual streams within streams 1 and 2, resulting in:

Example
In a batch reactor, ethane is dehydrogenated to form ethylene and hydrogen. There are
initially 100 moles of pure ethane entering the reactor. The output from the reactor contains
40 moles of hydrogen. Since the reactor is not completely efficient, the reaction does not
go to completion and some unreacted ethane is left in the output stream. A computer was
programmed to analyse the molar composition of the remaining unknowns (the molar output
of ethane and ethylene). Before it could complete the final step, the network crashed and the
computer was unable to finish the final steps of the operation. The last step the computer
could arrive to was the following:
[

2 2
200
][
]=[
]
6 4
520

Where is the moles of ethane and are the moles of ethylene in the output stream.
Using an inverse matrix (and not otherwise), solve for and .
Solution:
Since we are asked to solve this question using an inverse matrix, the following steps have
to be followed
2 2
A. Let A = [
]
6 4
B. Find the determinant of matrix A:
2
|
6

2
| = 2 4 2 6 = 4
4

C. Find the adjoin of matrix A:


4 2
[
]
6 2
D. Follow the rule:

1
()

to calculate the final inverse matrix:


1 0.5
A-1 = [
]
1.5 0.5

E. Multiply the inverse matrix by both sides of the given equation. Bear in mind that A

and A-1 will cancel out, leaving the left hand side with only [ ]. The right hand side

will yield the following result:


[

200 1 0.5
60
][
]=[ ]
520 1.5 0.5
40

Then we simply read the corresponding values off the matrix

[ ] =

Hence: = , =

60
[ ]
40

Example
During the calculation of another process, the computer instead employed an iterative,
Newtonian method to calculate the approximate values of several derivatives which could
not be solved analytically. This method involves the use of a Jacobian matrix, J, and a step
vector, p, made of three unknowns: p1, p2 and p3 (the meaning of these is beyond the scope
of this module). The following relation was established:
1
1 2 4
= [4 5 6] ; = [2 ]
3
6 8 4

1
50
. [2 ] = [150]
3
200

Using the equations given and the inverse (and not otherwise) of the Jacobian matrix, solve
for the unknowns in the step vector.
Solution
A. Find the determinant of matrix J:
Finding the determinant of a 2x2 matrix like such [

] is only the result of . However,

for a 3x3 matrix like [ ] the determinant would be:

| || |+| |

Therefore,
det() = 20
B. Find the matrix of cofactors for J:
The cofactors of a 3x3 matrix is a matrix of the determinants of the minors of each cell like
so:
5
|
8
2
|
8
2
[|5

6 4
||
4 6
4 1
||
4 6
4 1
||
6 4

6 4
||
4 6
4 1
||
4 6
4 1
||
6 4

5
|
8
28 20 2
2
| = [24 20 4]
8
8 10 3
2
|]
5

C. Take the transpose of the matrix of the cofactors:


28 24 8
[20 20 10]
2
4
3
D. Change signs according to the checkerboard matrix:
28 24 8
[ 20 20 10 ]
2
4
3

E. To conclude the calculation of the inverse matrix, multiply the final matrix by the
reciprocal of the determinant:

1 =

28 24 8
. . .
1
[ 20 20 10 ] = [

. ]
||
2
4
3
. . .

F. Multiply the inverse matrix by both sides of the given equation. Bear in mind that J
1
-1

and J will cancel out, leaving the left hand side with only [ 2 ]. The right hand side
3
will yield the following result:
1.4 1.2 0.4
30
50
[ 1
1
0.5 ] [150] = [ 0 ]
0.1 0.2 0.15
5
200
1
Therefore: [2 ] =
3

30
[0]
5

Hence: p1 = 30, p2 = 0 and p3 = 5.

Você também pode gostar