You are on page 1of 6

generalized solution

Material balancing-a
method
R. I. Mackie
Minerals

and Metals

Division,

Warren

Spring

Laboratory,

Stevenage,

Herts,

UK

A method for the solution of material balancing problems encountered in mineral processing is described. The method makes use of the highly structured nature of the equations encountered, thus
resulting in savings in computer storage space and computation time. One of the key advantages of
the method is that it is presented in a very general way and can therefore be used to solve a wide
variety of balancing problems. In particular, the method enables constraints imposed upon individual
streams (e.g., sum of size distribution must equal 100%) to be handled at very little extra cost, whereas
most other balances tend not to deal with these sorts of constraints.
Keywords:

constrained least squares, optimization, mineral processing

Introduction

Description of the process

A mineral treatment plant can consist of many interconnected unit processes, and in order to operate the
plant efficiently it is necessary to have an accurate
picture of what is happening at all parts of the circuit.
However, data collection is an expensive task, and the
raw data will be contradictory; e.g., the measured mass
flow entering the circuit will not equal the measured
mass flow leaving the circuit. Therefore the data have
to be balanced in order to produce data that are consistent. This is a task which lends itself readily to computer methods, and programs to do this have been
available for many years. The first material balances
were written for mainframe computers, and a useful
review can be found in Reid et al. With the advent of
microcomputers these methods are now readily available to the plant engineer, and Warren Spring Laboratory (WSL) has produced balance programs for use
on microcomputers.*
However, the microcomputer
balances shared the common problem of limitations on
the problem size that can be dealt with. There are also
potentially many sorts of balances that can be carried
out, ranging from balancing only the total mass flow
to balancing total mass flow, pulp density, size/specific
gravity (SG) distribution, and assay data. This paper
describes a method that breaks down the problem into
smaller components, thereby reducing the storage space
needed, reducing the time of computation and providing the framework for a much more general solution
process.

A mineral processing plant can be viewed as a system


of streams and nodes (Figure I). The nodes can either
be unit processes or complete subsections of the plant
(e.g., flotation circuit). For each stream some or all of
the following data can be measured: total flow rate,
pulp density, size distribution, SG distribution, and
assays.
These measurements can be obtained in a variety
of ways, ranging from accurate on-line measurement
and laboratory analysis to an educated guess. To deal
with this variation in the reliability of the data, we can
assign confidence values to each data element, higher
values being given to measurements believed to be
very accurate and low values to measurements known
to be subject to large errors. So if x$ (j = 1,n) are the
measurements taken for each stream, and if there are
N streams, the problem is to minimize the function

E = 5

WU(xti - x8)

i=l

where the W, are weighting factors applied to each


data element. If Wti is taken to be the confidence factor
divided by the square of the measurement, then the
balance minimizes the percentage change made to each
data element and tends to make the smallest changes
to those measurements with the highest confidence
factors. In addition, the data will be subject to certain
constraints; these can be split into two categories:

Addressreprint requests to P. Tucker, Warren Spring Laboratory,


Stevenage, Herts SGl 2BX, UK.
Dr. R. I. Mackie is now in the Department
The University, Dundee, DDl 4HN, UK.
Received December

1987; revised July 1988

(1) stream constraints; e.g., the sum of the size distribution must equal 100%; the sum of the size
assays must equal the total assay.
(2) nodal constraints; i.e., the total mass of each com-

0 1989 Butterworth

Publishers

Appl. Math. Modelling,

of Civil Engineering,

1989, Vol. 13, March

149

Material

balancing-a

generalized

solution method:

R. I. Mackie

Stream 1 data
Stream n data
Stream constraints

1 Lagrange

multipliers

Stream constraints it Lagrange multipliers


Nodal constraints Lagrange multipliers
Once the equations have been set up, they will have
the general structure

(Z3 (;)=(i)
Figure 1.

Flowsheet as streams and

nodes

ponent (e.g., each size fraction) entering a node


must equal the total mass of each component leaving the node.
These constraints can be introduced into the problem by means of Lagrange multipliers. The solution is
then obtained by calculating the gradient vector and
setting it equal to zero. This produces a set of simultaneous equations. Depending on how the problem is
formulated, the equations can be linear or nonlinear.
Details can be found in Cutting.3
The drawback of this technique is that it considerably increases the number of variables and, hence, the
problem size. One method of overcoming this problem
has been developed as a result of recent work, commissioned by Warren Spring Laboratory, at Thames
Polytechnic by Simpson er ~1.~ Simpsons approach
views the flowsheet as a set of independent flow paths,
rather than as a set of streams and nodes. The difference can be seen by comparing Figure 2 with Figure
1. The optimization is now carried out on the flows in
the independent paths, and the nodal constraints are
automatically taken care of. This significantly reduces
the size of the problem. An alternative is presented
here which takes account of the highly structured nature of the problem, and the method is formulated in
completely general terms.

where D is associated with the stream variables, P with


the Lagrange multipliers (the superscript t indicates
the transpose matrix). A signiticant saving over solving
the original system directly can be obtained by solving
this system. This is done as follows: expanding (2)
gives
DX+PY=A

(3)

PX = B

(4)

Therefore
X = D-(A
Substituting

- PY)

(5)

into (4) gives

(PD-P)Y

= PD-A

- B

(7)

D,
where Di is the matrix associated
the structure

Math. Modelling,

with stream i. P has

El

, p3

It is possible to obtain the solution to the problem by


solving directly the set of simultaneous equations.
However, the system of equations is extremely sparse
and highly structured. The method about to be described accounts for this, and so reduces the storage
space needed and computation time. The method will
first be described in general terms and then illustrated
by a particular example.
Suppose there are n streams. Then arrange the data
in the following order:

Appl.

(6)

which can be solved to give Y, and then (5) gives X.


The system of equations for Y is substantially smaller
than the original system. Also if the problem is suitably
linearized, D is diagonal, and so calculating its inverse
presents no problem.
Further savings can be obtained by further examining the structure of D, P, A, and B. D has the form

Equation structure

150

(2)

1989, Vol. 13, March

Figure 2.

Flowsheet as independent

paths

Material

Li
i

Mi

balancing-a

generalized

solution method:

R. I. Mackie

Equation (6) can now be written schematically

(8)

L, Mr,

(15)

where Li is the matrix associated with the stream Lagrange multipliers for stream i, and M, is the nodal
Lagrange multiplier matrix associated with stream i.
X can be written as
X=(Xi,...,X#

(9)

where Xi is the vector of calculated


for stream i. Y can be written as

stream variables
(10)

where Yi is the vector of stream Lagrange multipliers


associated with stream i, and Z is the vector of nodal
Lagrange multipliers. A has the form
(Ai, * . . ,ArJ

(11)

where Ai is associated

with stream i. B has the form

(Bi, . - . , B,, B-V

(12)

where Bj is associated with the stream Lagrange multipliers for stream i, and BZ with the nodal Lagrange
multipliers.
Using this decomposition, we can write the left side
of equation (6) as
PD-P
f...

. . . Lk)r...

M;...@

u;.**u:,

where
Vi = L:DD;Li
Ui = LID; M;
W = EMIDiMi

(K, * . . 3 Yn, a*

= [;

as

D-

; )

Ui = LID;-Ai - Bi
b = EMiD; Ai - BZ

(16)

Equation (15) gives


i= 12 . . . 3n

Vi Y; + UiZ = U;,
CU:Y/+
Therefore

WZ=b

(17)
(18)

equation (17) gives

Y, = v; (a; - U;Z)

(19)

and so
(W - Z U:V;Ui)Z

= b - ~ U:V;Ui

(20)

This can be solved to give Z, and then equation (19)


can be used to obtain the Yi.
Equation (5) can then be written as

(1;)
=ir-.
..,3

L,,M,

L1D;

Al

LLD,

1
kf\D; . . . MLD,

L:D;

:I

Mi
.
L Mn

- LiYi - MiZ)

(22)

which gives
Xi = Di(Ai

and so the solution is obtained.


The advantages of the above method are that the
system of equations for Z is again smaller than the
system in equation (6). Also with suitable linearization
the matrices Dj and Vi will often be diagonal, so inversion is again no problem. Even in the cases when
the Vi are not diagonal, they will be quite small matrices
with few off-diagonal terms.

LLD, M,

MrD;L, . . . M,D,L,

(21)

[ii All

L: D, M,
L:D, L,

CM:D; M;

and the right side as


/ L:D;

Example
M~DD;

. . MLD,

(14)

In order to clarify the method, consider the following


example: Suppose that there are n streams and m nodes.
For each node estimates are made of the total solids
mass flow and size distribution (d size fractions). Mi
is the total mass flow for stream i, and sii (j = 1, . . . ,
d) is the percent size distribution. The function to be
minimized is

Appl. Math. Modelling,

1989, Vol. 13, March

151

Material

balancing-a

generalized

solution

Wi(Mj - MT)* + C W,(SG - s:)*


L

method:

R. I. Mackie
Mi has the general form

(23)

s:

. ..s& o...o-s:

(24)

and d constraints

for each node L,

C Qi,_MiSy = 0
I

(25a)

where Q is the plant matrix, with QiL = 1 if stream i


enters node L, QiL = - 1 if stream i leaves node L,
and Qil = 0 otherwise. Equation (25) can be linearized
in the following way (WiegeP):

+ x

Xi = (M;, Sii, . . . ) Sid)t


Yi = (Hi)

(34)

Z = (Gii,. ** 9GNd)t
and A, B, and BZ by
Ai = 2 (WiM$ywiisz,.

. . ) Wins%)
(35)

(25b)

where My and s$ are the latest estimates of Mi and sij.


Once the Lagrange multipliers (Hi and GLj) have been
introduced, the minimization function becomes
W;(Mi - M$)

where the exact position of the ls and - ls depends


upon which node stream i enters and which node it
leaves. Xi, Yi, and 2 are given by

Bi = (1)

~ Qir.(Mis~ f MPs~ - MPs~)

E = C

Wo(S; - Sf)

The problem is now in the form necessary to apply the


new method.

Computational method and storage

The essential steps in the computation


~~Hi(~s~-

(26)

This is minimized when grad(E) = 0, and grad(E) is


given by
= 2Wi(M,
I
g,

=
u

- MT) + x GLjQiLSt

(27)

Lj

2W,(Sc- 5':) + Hi + 2 GLjQiLMP

(28)

$+j-l
.i
gj

QiL(Mis& + M:s,

M~s:)

(30)

In terms of the decomposition given in equations (7)-( 12),


Di is the diagonal matrix
/Wi

(31)

Li is a column vector with transpose

(O,I,...,I)

152

are as follows:

1) +iGLj

2 Qi,_ (Miss + M:SG - f?lpSt)

$,

.o...o

-MY

where MF and s$ are the measured values and Wi and


wii are the associated weighting factors. There is one
constraint for each stream,
Tti=

. ..-s$

Appl. Math. Modelling,

(32)

1989, Vol. 13, March

(1) Formulate Liy Diy ML, A, and B.


(2) Calculate Did, U,, Vi, W, U, and b.
(3) Calculate W - XUiV;Ui.
(4) Solve for Z.
(5) Calculate Y;s.
(6) Calculate Xis*
One of the key points is that the solution method is
now generalized to deal with any sort of bal,ancing
problem. Separate modules will deal with the particular
formulation of D, Li, M, A, and B for the problem at
hand.
Often the problem can be formulated in such a way
that the matrices Vi are diagonal, which means that
calculating its inverse is no problem. This was the case
in the above example. It will also be the case whenever
each row of Li has only one nonzero entry and D is
diagonal. For then the elements of Vi are given by
(V;)pg = 2 (Li)kp(D; )k(Li)kq

(36)

which iS nonzero if and Only if (Li)kp and (Li)kq are


nonzero, which is true if and only if p = 4. Therefore
Vi is diagonal. There may be no stream constraints at
all. This occurs if the only measurement taken apart
from the solids mass flow was one or more metal assays, the sum of which need not total 100%. Even if
Vi is not diagonal it is likely to be sparse and will also
be small in comparison to W. Therefore inverting it is
unlikely to require an unacceptable computational time.

Material

balancing-a

generalized

solution method:

R. I. Mackie

Where total mass flow and size distribution are measured the problem size is as follows:

D,

= 1+ d
Numberofvariablesper
stream
Number of constraints per stream = 1
= d
Number of constraints per node
Therefore the total number of variables in the complete
system of equations is n*(l + d) + n + m*d, where
n is the number of streams and m the number of nodes.
For the partially reduced system in equation (4) the
number of variables is n + m*d and for the fully reduced system, m*d.
For a system with 4 size fractions, 27 nodes, and
54 streams, the complete system has 432 variables, the
partially reduced system 162, and the fully reduced
system 108. To obtain the size of matrix to be stored,
all these figures have to be squared, and this gives
186,624, 26,244, and 11,664, respectively. This highlights the saving made. Storage space is not the only
saving. The amount of work required to solve a set of
simultaneous linear equations is proportional to the
cube of the number of variables, so there is also a
considerable saving here as well. In the above example
using the partially reduced system, the time for one
iteration was 6.6 CPU seconds, whereas the new method
took 1.O CPU seconds (both times being on a MicroVAX
II computer). The saving is due to solving a smaller
set of equations, and the decomposition generally leads
to a more efficient program.

(37)

Tl

where the Tis are the sets of transfer coefficients. If


there are no equivalents of the stream constraints for
the transfer coefficients, P will have the form

L,
(38)

The number of nodal constraints may have increased.


has same form as in (8) except that W is now
given by

PD-P

W = 2 M:D;Mi

+ x M;+,T;M,+,

If there are some constraints relating the transfer coefficients within each group, P will have exactly the same
form as in (8).

Conclusion
Combining
simulation

mass balancing

and flowsheet

Obtaining data from a plant is a time-consuming and


costly exercise. Therefore it will often be that the data
are incomplete. One possible solution to this problem
is to use mathematical models to provide additional
data. This is already done in SUPERBAL for nonstandard nodes. Nonstandard nodes are found in
grinding or leaching circuits. At a grinding mill the
conservation of mass for each size fraction breaks down
because of the size reduction, and in a leaching circuit
at certain nodes material will be going into or out of
solution. One solution is to ignore the size constraint
in the case of size reduction nodes. However, an alternative solution is to use a simple mathematical model
to represent the degree of size reduction occurring.
This idea can be extended to normal nodes where no
size transfer or dissolution occurs, and transfer coefficients can be introduced as additional data elements.
The transfer coefficients can be derived in various ways,
e.g., using mathematical models, using results of experimental work, using the plant engineers experience.
Using transfer coefficients introduces additional
variables and constraints into the problem. However,
as will now be shown, the general solution method
described above still applies. The D matrix now has
the form

The equations arising out of material balancing problems are of a highly structured form. A method has
been described that expresses the structure in a form
applicable to a wide variety of problems, and a general
solution scheme is presented using this structure. This
method results in a considerable saving in the storage
space required, and also in the computation time. Both
these savings are very significant in the writing of balancing software for microcomputers. Although the above
discussion has concentrated upon the fully linear problem, the nonlinear problem can usually be linearized
in such a way as to enable the above method to be
used.
The method makes full use of the structure of the
stream constraint part of the equations, but part of the
equation structure that has not been fully developed
is that of the matrices M (the nodal constraint matrices). Simpsons method, on the other hand, makes full
use of this structure. If the present method and Simpsons method could be combined, the result would be
an even more efficient method. (This is the key difference between the two methods.) The possibility of
doing this should be investigated.

Notation
d
D

number of size fractions


matrix associated with stream variables

Appl. Math. Modelling,

1989, Vol. 13, March

153

Material

balancing-a

generalized

solution method:

M;, MI

adjusted and measured mass flow for stream


i

:Jl
P
sij
w,w

x, x*

X
Y

number of nodes
number of streams
matrix associated with Lagrange multipliers
fraction in size interval j of stream i
weighting factors
adjusted and measured readings
vector of adjusted measurements
vector of Lagrange multipliers

R. I. Mackie

References
1

1976, 3, 207-218

Subscripts
i

stream number
size fraction

154

Appt. Math. Modelling,

Reid, K. J., Smith, K. A., Voller, V. R., and Cross, M. A survey


of material balance packages in the minerals industry. Seventeenth Application of Computers and Operations Research in
the Minerals Industry, AIME, New York, 1982
Tucker, P. Material balancing software-what
does the future
hold. ht. Mining April 1988
Cutting, G. W. Estimation of interlocking mass balances on
complex mineral benefication plants. Znt. J. Mineral Processing
Simpson, D. E., Everett, M. G., and Voller, V.R. Reducing the
unknowns in a constrained minimisation problem-an
application to material balances. App. Math. Modelling 1988, 12(2),
204-212
Weigel, R. L. Advances in mineral processing material balances.
Canadian Metallurgical

1989, Vol. 13, March

Quarterly 1972, 11(2), 413-424