Section 4.4.9.1: DAE Formulation of Flow Controller problem

The flow controller model presented in lecture 7 can be formulated as a DAE system of 12 equations as follows.

$\frac{dM}{dt} = F_1 - F_2 $ ODE: material balance
$ F_1 - \theta(t) = 0 $ specify feed flow F1 as function of time
$ F_2 - \sqrt{\frac{M}{1/k^2 + 1/k_v^2} } = 0 $ outflow - pressure drop equation
k - (0.2) = 0 specify pipe flow constant
$ k_v - \phi k_{v,max} = 0 $ valve characteristic equation
kv,max - (1.0) = 0 specify fully-open valve flow constant
$ g_{\phi}(\phi,y) = 0 $ valve opening as function of controller output
y - K e = 0 proportional controller algorithm
$ e - 100 \frac{(F_s - F_2)}{F_{range}} = 0 $ controller error definition
K - (1.2) = 0 specify proportional gain
Fs - (2) = 0 specify flow set point
Frange - (5) = 0 specify flow range

Constants in brackets could equally well take other values, or indeed some could be specified functions of time (e.g. Fs, perhaps K).

$g_{\phi}(\phi,y)$ is a `multiple choice' function:
$ \phi = (y+50)/100 $ if -50 < y < +50
$ \phi = 1 $ if y > +50
$ \phi = 0 $ if y < -50
This ensures that $\phi$, the fractional valve opening, is always in the range 0 to 1.

There are 1 differential and 11 algebraic equations. 6 of the algebraic equations are simple specifications (constant or function of time):
F1, k, kv,max, K, Fs, Frange.

There are 12 variables (`in order of appearance'):

M tank holdup
F1 feed flow
F2 outlet flow
k pipe flow constant
kv valve characteristic
$\phi$ valve open fraction
kv,max valve flow constant (fully open)
y controller output
K controller proportional gain
e controller error signal
Fs flow set point
Frange flow range for controller

Consistent initial values

Replace ODE (1) by

x = 1

and solve with

\begin{eqnarray*}y_1 y_2 - x^2 = 0 \\
y_1 - x y_2^3 - y_2 = 0
\end{eqnarray*}


This is of course the same as solving

\begin{eqnarray*}y_1 y_2 - 1= 0 \\
y_1 - y_2^3 - y_2 = 0
\end{eqnarray*}


If using Newton we need initial guesses for y1 and y2, say
y1(0) = 1, y2(0) = 1
These are NOT initial conditions for the y variables, because they do not satisfy both the AEs. Applying Newton we get
y1 1.0000 1.2000 1.2710 1.2720 = y1(0)
y2 1.0000 0.8000 0.7860 0.7862 = y2(0)


First time step by implicit Euler

Solve simultaneously the discretised ODE and the AEs:

\begin{eqnarray*}x(1) - x(0) - h (- x(1)/y_1(1)) = 0 \\
y_1(1) y_2(1) - x(1)^2 = 0 \\
y_1(1) - x(1) y_2(1)^3 - y_2(1) = 0
\end{eqnarray*}


Suppose h = 0.01. Then solve

\begin{eqnarray*}x(1) - 1 - 0.01 (- x(1)/y_1(1)) = 0 \\
y_1(1) y_2(1) - x(1)^2 = 0 \\
y_1(1) - x(1) y_2(1)^3 - y_2(1) = 0
\end{eqnarray*}


Note that the only `time step 0' value to appear in these equations is x(0) = 1. However, we can also use the y1(0), y2(0) values as initial guesses to solve these equations. Using Newton the step converges after 1 iteration starting from the t=0 values as guesses.
x 1.0000 0.9921
y1 1.2720 1.2578
y2 0.7862 0.7825



Return to Section 4.4.9 Index

Return to Section 4.4 Index

Course Organiser
Last modified: Wed Aug 5 16:30:59 BST