Some simulation difficulties

There are a few problems which occur a lot when simulating chemical processes. This section outlines three of the most common, and discusses some ways around them. You should be aware, however, that the way you deal with these problems depends very much on the circumstances; if there was a standard 'fix' then they wouldn't be problems !

A big problem with simulation of chemical processes is physical property data. In many dynamic models, we may be simulating what would happen to a plant under fault conditions, and as a result the plant conditions can move very far away from the normal operating point, with corresponding changes in the values of physical properties. Now, in some cases, physical property equations can be used to estimate the values of these parameters. The problem here is that these equations often involve iteration to arrive at a suitable value. Iterative calculations aren't a problem on a computer where only one or two values are required, but in a dynamic simulation many property values are required at every integration time step. This means that the use of accurate physical property relationships can slow down a simulation to the point where it becomes useless. There are a couple of ways around this problem, and which can also be used for cases where no physical property equations exist. The first is simply to assume that the physical properties remain constant. This assumption can be tested by doing sensitivity studies, and repeating the simulation with various values of the physical properties. Alternatively, where physical property variations have a significant effect on the behaviour of the simulation it may be possible to get away with a look-up table with interpolation between the values. Most simulation systems allow these tables to be easily constructed.

Another common problem in processing systems is that of algebraic loops. A very simple example of an algebraic loop would be two simultaneous equations:

eqn25.gif (1494 bytes)

Dynamic simulators like to work with straight through calculations where the output of the equations can be directly calculated. When an algebraic loop is present, the output of an equation depends on the value of an input to the equation which itself depends on the value of the output. Most dynamic simulators have the capability to handle these loops by performing an iterative (trial and error) calculation. There are several problems in relying on this:

i) The iteration may not converge on a solution.

ii) Multiple solutions may be possible with no guarantee of convergence on the right one.

iii) Iterative calculations at every time step use huge amounts of computer time.

The rule to be followed in writing dynamic simulations is therefore to avoid algebraic loops wherever possible. There are a couple of ways that algebraic loops can be 'broken':

i) Sometimes it is possible to reformulate the equations in such a way as to avoid algebraic loops. In the simultaneous equation example we could simply rearrange the equations to give

eqn26.gif (1758 bytes)

ii) Where it isn't possible to rearrange the equations to break the loop, a delay can be inserted between one of the variables and the equation it acts as an input to. This means that calculations using this variable will be using the value of the variable from one step previously. This will lead to errors in the calculations, but these can be kept down by limiting the length of the integration step.

The last of the major simulation problems arises with simulating stiff systems. A stiff system is one which contains dynamics with widely differing speeds of response. For example, we might build a model of a large reactor and include the dynamic response of the control valves. Now the time for the control valve to complete its response ( i.e. the time for it to stop moving after a change in air pressure) is likely to be measured in seconds, whereas the response of a large vessel to changes in input could easily take hours to complete. The problem with simulating stiff systems is in the integration step. Choosing too long a step results in inaccuracy or even instability, because of the poor modelling of the fast processes. Choosing a step short enough to adequately solve the fast dynamics results in huge numbers of steps having to be taken before the slow response completes. The simplest way to deal with stiff systems is simply to ignore the very fast dynamics and assume that these fast processes can be represented by steady-state models. Where complete dynamic models are required, however, a suitable algorithm should be chosen for the integration method.