• No results found

Linearising a nonlinear tank model

In document Advanced Control using MATLAB (Page 149-153)

Modelling dynamic systems with differential equations

3.6 Linearisation of nonlinear dynamic equations

3.6.1 Linearising a nonlinear tank model

Suppose we wish to linearise the model of the level in a tank given on page88where the tank geometry is such that ρA = 1. The nonlinear dynamic system for the level h is then simplified to

dh

dt =−k√ h + Fin

For a constant flow in, Finss, the resulting steady state level is given by noting that dh/dt = 0, and so

hss= Finss k

2

We wish to linearise the system about this steady-state, so we will actually work with deviation variables,

xdef= h− hss, udef= Fin− Finss

Now following Eqn.3.74, we have

˙h = ˙x = f(hss, Finss)

| {z }

=0

+∂f

∂h(h− hss) + ∂f

∂Fin

(Fin− Finss)

Note that since ∂f /∂h =−k/(2√

hss), then our linearised model about (Finss, hss) is

˙x = −k 2√

hssx + u

which is in state-space form in terms of deviation variables x and u.

We can compare the linearised model with the nonlinear model in Fig.3.24about a nominal input flow of Finss= 2 and k = 2 giving a steady-state level of hss= 4. Note that we must subtract and add the relevant biases when using the linearised model.

An alternative, and much simpler way to linearise a dynamic model is to uselinmod which extracts the Jacobians from a SIMULINKmodel by finite differences.

Listing 3.10: Usinglinmodto linearise an arbitrary SIMULINKmodule.

1 k=1; Fin_ss = 2; %Model parameters and steady-state input hss = (Fin_ss/k)ˆ2 %Steady-state level, hss

[A,B,C,D] = linmod('sNL_tank_linmod',hss,Fin_ss) %Linearise

level, h

(a) A SIMULINKnonlinear tank model and linear state-space model for comparison

0 10 20 30 40 50

(b) Nonlinear and linearised model comparison

Figure 3.24: Comparing the linearised model with the full nonlinear tank level system

A =

Quantifying the extent of the nonlinearity

It is important for the control designer to be able to quantify, if only approximately, the extent of the open-loop process nonlinearity. If for example the process was deemed only marginally nonlinear, then one would be confident a controller designed assuming a linear underlying plant would perform satisfactory. On the other hand, if the plant was strongly nonlinear, then such a linear controller may not be suitable. Ideally we would like to be able to compute a nonlinear

metric, say from 0 (identically linear) to 1 (wildly nonlinear) that quantifies this idea simply by measuring the openloop input/output data. This of course is a complex task, and is going to be a function of the type input signals, duration of the experiment, whether the plant is stable or unstable, and if feedback is present.

One such strategy is proposed in [82] and used to assess the suitability of linear control schemes in [177]. The idea is to compute the norm of the difference between the best linear approxima-tion and the true nonlinear response for the worst input trajectory within a predetermined set of trajectories. This is a nested optimisation problem with a min-max construction. Clearly the choice of linear model family from which to choose the best one, and the choice of the set of input trajectories will have an effect on the final computed nonlinear measure.

3.7 Summary

Stuart Kauffman in a New Scientist article9 succinctly paraphrased the basis of the scientific method. He said

“. . . state the variables, the laws linking the variables, and the initial and boundary conditions, and from these compute the forward trajectory of the biosphere.”

In actual fact he was lamenting that this strategy, sometimes known as scientific determinism voiced by Laplace in the early 19th century was not always applicable to our world as we under-stand it today. Nonetheless, for our aim of modeling for control purposes, this philosophy has been, and will remain for some time I suspect, to be remarkably successful.

Modelling of dynamic systems is important in industry. These types of models can be used for design and or control. Effective modelling is an art. It requires mathematical skill and engi-neering judgement. The scope and complexity of the model is dependent on the purpose of the model. For design studies a detailed model is usually required, although normally only steady state models are needed at this stage. For control, simpler models (although dynamic) can be used since the feedback component of the controller will compensate for any model-plant mis-match. However most control schemes require dynamic models which are more complicated than the steady state equivalent.

Many of the dynamic models used in chemical engineering applications are built from conser-vation laws with thermodynamic constraints. These are often expressed as ordinary differential equations where we equate the rate of accumulation of something (mass or energy) to the inputs, outputs and generation in a defined control volume. In addition there may be some restrictions on allowable states, which introduces some accompanying algebraic equations. Thus general dynamic models can be expressed as a combination of dynamic and algebraic relations

dx

dt = f (x, u, θ, t) (3.80)

0 = g(x, u θ, t) (3.81)

which are termed DAEs (differential and algebraic equations), and special techniques have been developed to solve them efficiently. DAEs crop up frequently in automated computer modelling packages, and can be numerically difficult to solve. [133] provides more details in this field.

Steady state models are a subset of the general dynamic model where the dynamic term, Eqn 3.80, is set to equal zero. We now have an augmented problem of the form Eqn3.81only. Linear

9Stuart Kauffman, God of creativity, 10 May 2008, NewScientist, pp52-53

dynamic models are useful in control because of the many simple design techniques that exist.

These models can be written in the form

˙x = Ax + Bu (3.82)

where the model structure and parameters are linear and often time invariant.

Models are obtained, at least in part, by writing the governing equations of the process. If these are not known, experiments are needed to characterise fully the process. If experiments are used the model is said to be heuristic. If the model has been obtained from detailed chemical and physical laws, then the model is said to be mechanistic. In practice, most models are a mixture of these two extremes. However what ever model is used, it still is only an approximation to the real world. For this reason, the assumptions that are used in the model development must be clearly stated and understood before the model is used.

Chapter 4

In document Advanced Control using MATLAB (Page 149-153)