As a simple process example, consider a heated, stirred tank. Liquid
flows continuously in and out of the tank via streams Fin and
Fout (F is a volumetric flowrate). Inside the tank, there is a liquid level h. A
heating coil can be used to transfer heat to the liquid. A second inlet
stream D is also present.
This basic example will be used to demonstrate a number of aspects of
control modeling. Different sections will apply at different times
during the course:
Some equations in this document are being displayed using MINSE, a browser independent approach
to displaying equations on the web. If the equations do not look properly
formatted, please RENDER
them by selecting the link and invoking Ping's MINSE polymediator. This will run
a special program that should cause the equations to be formatted for viewing by
your browser.
Maybe the most fundamental method for developing a differential equation
model for use in control uses "shell balances". This approach
begins by defining a "shell" of "differential thickness" (which makes
more sense when done for position dependence than it does for time!).
Maybe this makes most sense as an example.
Mass Balance
Our system will be the "water in a tank". Our model will be the total
material balance.
The accumulation is the amount by which the total mass in the
tank changes over a "differential slice of time"
, or
The net flow of mass into the tank can be written as the product of the mass flow rate
and the time interval
and a similar term written for the mass flow out
Notice that both these terms have mass units. Now if the whole thing is
put together
The next step is CALCULUS and we'll need the definition
of a derivative (do you remember?)
This means that if we take the limit of both sides of our working
equation as we end up with
This is the mass balance for the system. The accumulation term is the
differential (rate of change with respect to time) of the total mass in the
tank. If the mass flow entering the tank is greater than that leaving, the
mass in the tank is increasing, the level is rising, and the derivative is
positive. The opposite (derivative < 0) is true when the mass in the tank is
decreasing.
The accumulation term in our dynamic models will always be a time
derivative; the time derivative of the total amount of whatever we are
balancing contained within whatever system we have defined. With some
thought, and maybe a little practice, one can write the derivative for
the accumulation directly and dispense with the intermediate steps. The
work will be tricky enough without that piece of math.
Normally, we don't "know" the total mass in the tank. We're more likely
to know the volume in the tank, and the volumetric flow rates in and
out. Volume is not conserved so we
cannot write a volume balance. The bridge between volume and mass is
density, so we typically write our mass balance as:
If you want to try the shell balances again, it goes like this:
Typically, we won't be directly measuring the volume in the tank any
more than the mass; what is measured is the level, or height, of liquid
in the tank. If the cross-sectional area of the tank (A) is knowable,
the volume is the product of area and height, so
An important simplification can be made if we assume that the fluid in
the tank is well-mixed (perfect mixing). This lets us state that the
properties of the fluid are the same at any point in the tank,
including the exit, and consequently
, T=To, etc.
Next, we want to look at the variables inside the time derivative --
which vary with time and which are constant? The tank is almost
certainly rigid, so the cross section won't be changing. If we
also assume that the fluids are incompressible, density will be
constant with respect to time.
These simplifications let us write the total mass balance as:
which we will often rearrange to the form
Integrating this equation will give us an expression for the level in
the tank as a function of time. (This is called "simulation")
Another common simplification occurs if the density of the fluid entering the
tank is approximately the same as that of the fluid leaving the tank (equal densities). You need
to watch this one for reactors and mixing tanks, but it isn't a problem
if all we're doing is heating water. Since the densities are the same,
they cancel out, leaving
Energy Balance
If our tank has a coil or jacket so that the temperature is changed, an
energy balance will be needed. The enthalpy of the flowing streams will
be expressed in terms of the heat capacities and temperatures of the
streams to produce
Assume perfect mixing and express the volume as the product of the
cross-section and the height
Assume incompressible fluids and constant heat capacities:
and divide through to isolate the derivative
Once again, it is time to remember calculus. We'll apply the chain
rule, to break the derivative into two parts
This sets things up to substitute the results of the mass balance in and
eliminate the height derivative
Combine the T terms (some will go away) and
and this is the simplified energy balance for the system.
Depending on the purpose of our model, we might also need more
explanation of the heat transfer term Q, for instance
This is particularly important if the Q term depends directly on either
h or T.
The Model
The differential equation model for the heated, stirred tank:
BREAK
Steady State Model
The steady state version of this equation is
which is sometimes useful in evaluating modeling parameters.
Simulation
With the nonlinear model, it is possible to set up the system for a nonlinear
simulation. The simulation will numerically integrate the model equation to
produce transient response curve. The equation will need to be rearrranged
slightly:
so that it is convenient to plug it into a numerical integration algorithm, such
as the Euler method:
Linear Model
The linear, deviation variable model of this system is:
It shouldn't be too difficult to obtain this directly, however, some may prefer
to break the procedure into intermediate steps.
Linearization
The first step in obtaining this version is to use a Taylor series
expansion (truncated after the first order terms) to linearize the
model:
Then by using the steady state equation
and the definition of deviation variables
and quite a bit of substitution and cancellation, we get the
linearized deviation variable model above.
Inputs & Outputs
At this point, it might be useful to note that this system has one
output, T, and three inputs, F, Ti, and Q. Of the inputs,
Q is a manipulation, and F and Ti are disturbances.
Laplace Transformation
Before doing the Laplace transformation, let use the residence time
to "clean up" the differential equation
then take the Laplace transform
where T, Ti, F, and Q are now functions of the Laplace
variable s and no longer functions of time. Remember that the initial
value of T is zero because the equation is in deviation variables.
The equation can be rearranged to
Transfer Functions
Because the system has one output and three inputs, three transfer
functions are needed. The Laplace domain equation in transfer
function form is:
where
I tend to use GP for transfer functions relating outputs to
manipulated inputs and GD for transfer functions relating
outputs to disturbance inputs.
Solving the Linear Model
Because this is a linear model, we only need consider one input at a time.
The solution if two inputs change will be the sum of the solutions
changing one input at a time. Because we are in deviation variables,
any inputs that do not change will be zero. In this example, we will
consider an input change in Q only.
The linear model can be solved in two ways. The equation can be
arranged into a standard form for a first order linear ODE
that can be solved using the integrating factor method, or (since this type of
equation
is so familiar by now) by inspection. For a step change in the heat
input:
Solution by Integrating Factor
If "inspection" is intimidating, the integrating factor method may be
used. The integrating factor for this equation will be:
The differential equation is multiplied by the integrating factor
and the left hand side can then be contracted into a single
derivative:
Integrating (given that Q is a step function) yields
or
Since the problem is in deviation variables, the initial condition
gives T=0, and so
and so
Solution by Laplace Transforms
The equation can also be solved using Laplace transforms. Since Q is a
step function
and so
Block Diagram of Process
Control Loop
R.M. Price
Original: 2/10/97
Modified: 5/8/2003
Copyright 1997, 2003 by R.M. Price -- All Rights Reserved