So far, ODEs only:
E.g.
If f(M) involves non-trivial calculation of other variables we may be better to `open out' the problem and make all these variables explicitly part of the formulation.
E.g. flow controller:
f(M) = F1 - F2 where F2 depends on M and kv, the valve opening.
But kv depends on F2 because of the control algorithm.
Full set of equations in section 4.4.9.1
Instead of 1 ODE (mass balance) in 1 variable (M),
we have 12 equations in 12 variables.
1 equation is an ODE (the mass balance).
The other 11 are algebraic equations.
The 6 simple specification equations are included to show the full structure that is possible, though we might prefer to regard the corresponding variables as constants or explicit functions of time instead.
General DAE system:
: MD ODEs
: MA algebraic equations.
x: variables whose time derivatives appear in the model,
y: variables whose time derivatives do not appear in the model.
x are called differential variables,
y are called algebraic variables.
We have MD differential and MA algebraic variables.
For a DAE system to be easy to solve,
it must be possible to solve the AEs
If not, `high-index' difficulties occur.
Will not be discussed in this course.
Solution of high-index problems remains an active research topic.
It's always best to make sure that a DAE system you formulate satisfies the above condition.
M is a differential variable because
appears in the model.
The other 11 variables are algebraic variables:
F1, F2, k, kv,
,
kv,max, y, K, e, Fs and Frange.
If M is given the AEs can be used to solve for the algebraic variables.
For example:
Explicit Euler:
Discretise the ODE as
Needs values for all the algebraic variables at tn.
Integration gives only the differential variable(s) at tn+1.
Then solve the AEs for the algebraic variables at tn+1 using the value calculated for M(n+1) by explicit Euler.
Solution is no different from treating the system as an ODE:
If the flow controller is treated as an ODE the initial condition is M(0) at time t0.
This must remain true if the problem is treated as a DAE system.
General Rule for ICs:
One IC for each differential variable.
A safe choice is to give the initial value of each differential variable (as here). In other cases this may be inconvenient - see next section.
What about the algebraic variables?
Consistent initial values must be found by solving the AEs at time t0 with specified values
for the differential variables.
I.e. solve
DO NOT GIVE INDEPENDENT
INITIAL CONDITIONS
FOR THE ALGEBRAIC VARIABLES.
However, initial guesses may be needed for the algebraic variables when solving the initial point equations above, e.g. by Newton's method.
Implicit Euler:
Discretise the ODE as
M(n+1), F1(n+1) and F2(n+1) are all unknown. So it makes sense to solve the discretised ODE simultaneously with the AEs at tn+1.
The unknowns in the AEs are the differential and algebraic variables at time tn+1:
This is different from the method used if we regard the system as just an ODE.
If the flow controller is treated as an ODE
Solving for M(n+1) involves an iterative loop, if f is non-linear.
Each iteration involves calculation of f at an iterated value M(k) for M(n+1).
But
f = F1 - F2 and, in the flow control example, iterative solution for F2 is required at a given M.
Thus we have an inner iterative loop for F2,
and an outer iterative loop for M.
Which is better?
Nested loops each for one unknown,
or a single loop for 12 variables
(though a partitioning scheme can easily be devised which reduces the number of simultaneous unknowns in the implicit DAE solution to 2: M and F2.)
An open question.
Probably depends on the problem.
The flow controller was solved for 200 time steps of 10 s, by which time (2000 s) steady state had been reached.
(Feed F1 and initial holdup M0 as in section 7 level control example).
Solving as a DAE needed 418 simultaneous linear equation solutions for the 12 variables, i.e. 418 Newton iterations of the full system.
(This could have been reduced to a 2 variable system with special programming.)
3 iterations per step to t=540 s, 2 iterations per step to 1610 s, 1 iteration per step thereafter.
Solving as an ODE took 464 outer loop iterations:
3 outer to 710 s, 2 outer to 1910 s, then 1 outer.
All inner loops converged in 3 secant iterations.
Next - Section 4.4.10: Towards Process Simulation
Return to Section 4.4 Index
Return to Section 4 Index
Course Organiser Last modified: Wed Aug 5 16:41:48 BST