# Mathematical Models Aid Process Control

## KEY WORDS Process and advanced control Modeling Model predictive control Process control theory Process controllers Loop tuning In its simplest form, a mathematical model is nothing more than an equation that relates the value of one variable to that of another. A model is used to describe the behavior of a process in quantifiable terms.

KEY WORDS

Process and advanced control

Modeling

Model predictive control

Process control theory

Process controllers

Loop tuning

In its simplest form, a mathematical model is nothing more than an equation that relates the value of one variable to that of another. A model is used to describe the behavior of a process in quantifiable terms. Einstein's famous equation E=mc2models the process of converting matter into energy. It uses the speed of light (c) to describe how much energy (E) will be produced by annihilating an object of a given mass (m).

More complex models involve more variables and more elaborate mathematical relationships, but all models can be decomposed into four basic components: *input variables, output variables, constants* , and *operators* . Output variables are the unknown quantities that the model is designed to deduce from values of the known inputs. In Einstein's equation, E is the output and m is the input because the mass of the object can be measured prior to annihilation to predict the energy that will result.

The value of c in Einstein's equation is a constant. Its value always equals the speed of light in a vacuum. Constants generally represent the fundamental principles of physics, chemistry, economics, etc., which govern the behavior of the process. For example, the model for a mechanical process may include a coefficient of friction (

The operators in the model define the mathematical manipulations required to compute the value of the outputs from the inputs and the constants. They can be as simple as the multiplication and squaring functions that appear in Einstein's equation or as complex as Laplace transforms and statistical distributions.

Figure 1 - This spring-mounted hobbyhorse has a total mass of

m kilograms and a center of mass h meters above the pivot point. The

rider sitsθ radians from the vertical position where the motion of the

process was initiated with a push from behind. The constant g

represents the acceleration due to gravity and k is the angular spring

constant of the spring.

Another example

Consider the mechanical process depicted in Figure 1. It consists of a spring-mounted hobbyhorse often found in playgrounds. A child rides the horse by lurching forward and backward, often with the help of an initial push from behind.

The forward force on the rider due to gravity is opposed by the deflection of the spring. If the horse, rider, and spring combine to form a mass of m kilograms with a center of mass h meters from the pivot point, then the motion of the whole contraption can be described in terms of the angular position measurementθ as shown in Figure 2.

As is the case for all but the simplest processes, this model is an approximation of reality. It assumes that no other forces such as wind or friction affect the motion of the process and that the resistive force applied by the spring is perfectly proportional to the angular positionθ. It also assumes that the process begins moving from a perfectly vertical position (i.e., the value of θ is initially zero).

A further simplification would typically be applied to equation [1] in cases whereθremains small enough to roughly equal sinθ.

Substitutingθ for sinθ yields equation [2] which becomes *linear* becauseθ plotted against θ0 now yields a straight line with a slope of -(k - mg)/mh.

However, the real purpose of equation [2] is to generate a plot ofθvs. time so as to predict the future motion of the process. That happens to be a rather simple matter with a linear equation like [2]. In fact, equation [2] can be solved explicitly for θ(t) as shown in Figure 2.

An analogous closed-form solution for equation [1] would be much more complex because of the nonlinear sine operator. Process control engineers will sometimes go to great lengths to create a linear rather than a nonlinear process model, just to simplify the mathematics of the problem.

Figure 2 - The angular acceleration variable

' is the second time

derivative ofθ, **t** is the time since the process was first set in motion,

θ'0 is the original angular velocity imparted by the initial push, **a**

is the amplitude of the subsequent oscillations, and

is the

frequency of those oscillations. The values of **a** and

are constants

that depend on **k** , **m** , **g** , **h** , andθ'0 as shown in equations [4] and [5].

Limitations

Unfortunately, even the simplified equation [2] would not be a particularly useful model for the purposes of controlling the output variableθ(t). It includes no input variables that a controller could manipulate to produce a new position or velocity for the rider.

Even if this process and its model could be modified to include a control mechanism (by mounting the whole contraption on a hydraulically actuated platform, for example), the model would still have its limitations. It would only work if the induced oscillations remained small enough to makeθ' ≈sin θ. Otherwise, the process would begin to behave according to equation [1] rather than equation [2].

Most real processes do behave differently when their input variables go from low values to high values and back again. The process model has to account for those changes or else the controller that relies on the model to select the correct control actions will not get the expected results.

Equation [2] will also fail to describe the actual motion of the process if the *initial conditions* are incorrectly identified. In this model, the only initial condition isθ' _{0} which represents the angular velocity of the process at time t=0. Equation [5] shows how the value ofθ' _{0} determines the amplitude a of the process' subsequent oscillations. The larger the initial velocity due to the first push, the further the process will swing with each oscillation.

However, if that value is mis-measured, then the oscillations predicted by the model will not match the actual motion of the process. Similarly, if the process starts moving from an initial position other thanθ(0)=0, the model's output will be incorrect. In applications where the control of a process depends on a good match between the model's predictions and the actual behavior of the process, control engineers will often try to start a process with all of the initial conditions set to zero to avoid initial condition errors.

Applying the model

Creating an accurate model for a process is only half the battle. The real challenge for the control engineer is designing a controller that makes best use of the model's ability to predict the process' response to a control effort.

The brute force method is trial-and-error. The controller guesses what the next control action should be, applies it to the model to see if it will produce the desired outputs, and keeps trying until it guesses correctly. Because this search can be accomplished in computer time, the controller can actually try thousands of possible control efforts before the time comes to apply its final choice.

On the other hand, a strictly trial-and-error method is horribly inefficient. A more intelligent approach would be to choose each guess according to the results of the previous trial, thus honing in on the correct choice iteratively. The linearity of the model would be particularly helpful for a controller using such a technique. If the initial guess produces an output that is X% larger than required, the controller could try reducing the next guess by X%, since a linear process responds proportionally to a change in the input.

An even simpler approach would be to use a model like equation [2] that can be solved and inverted mathematically. It then becomes a straightforward matter to feed the desired output value into the inverted model and directly calculate the control effort required to achieve it. Unfortunately, this obvious technique can produce numerically unstable results for reasons that are not at all obvious.

Implicit techniques

The foregoing are all *explicit* methods for incorporating a process model into the controller's operations. *Implicit* techniques that use the model only for the design of the controller are much more common.

PID tuning rules, for example, translate the model's constants into suitable values for the controller's proportional, integral, and derivative parameters (see 'Ziegler-Nichols Methods Facilitate Loop Tuning,' *Control Engineering* , Aug. '98, p. 112, and 'Process Controller Tuning Guidelines' online at www.controleng.com ).

A touchy process that the model shows to be highly sensitive to the controller's efforts would be assigned conservative tuning parameters by most tuning rules. Conversely, a sluggish process would warrant more aggressive tuning parameters. The controller never uses the model to compute anything directly, but the model's ability to predict how the process will respond to a control effort ends up implicitly incorporated into the controller's tuning.

The more sophisticated controller design techniques traditionally taught in Control Engineering 101-lead/lag, pole placement, setpoint tracking, etc.-also use the process model implicitly to identify the behavior of the process. However, instead of plugging the model's constants into a fixed set of tuning rules, these techniques use the dynamic characteristics of the model to produce a controller that meets some closed-loop performance criteria.

Other applications

Process models are useful for more than controller design problems. They can be used to create *virtual sensors* that measure one set of variables and deduce the values of another set mathematically. They can also be used to *simulate* the behavior of the process when testing a proposed controller before commissioning it.

Perhaps the most profitable application for process models (in the chemical and petrochemical industries, at least) is constraint management. *Constraints* are the physical limitations that determine the maximum allowable values for the process variables-the capacity of a tank, the temperature limit of a reactor, a pipe's maximum flow rate, etc.

A chemical process generally operates most profitably when running as hard as it can within its physical limits. The controller's job is to maintain the process variables within the high profit range without allowing them to violate their respective constraints.

An accurate model of the process allows the controller to determine in advance where the process variables are headed and take preemptive action to prevent impending constraint violations. Without the foresight offered by the process model, the controller would have to maintain the process variables well away from their constraints (and in a less-profitable range) just to maintain a safety margin.

Process *optimization* works much the same way. When different elements of a process compete for resources such as electricity, steam, or raw materials, a model of the overall process can demonstrate the economic effects of rationing the resources in different combinations. The controller can determine in advance which rationing strategy is most profitable and go about implementing it without having to waste time and resources guessing.

An alternative

A more recent innovation in the field of process control avoids models altogether. The idea is that models are artificial constructs that aren't really required to interpret the measurements coming out of the process. (See *Control Engineering Europe* , Feb./March `01, 'Model Free Adaptive Control', p. 25., also at www.controleng.com ).

*For more about related products, please consult advanced control, loop tuning, control systems, software and other categories in Control Engineering's Online Buyer's Guide, at /buyersguide .*

Applications for process models

Process control: Using a model of the process to predict the effects of its control efforts, a controller can determine how to best manipulate the process.

Controller design: Controllers can be designed to accommodate the dynamic behavior of a process by analyzing the structure of its process model.

Virtual sensors: A model of the process can be used to estimate the values of unmeasurable variables from variables that can be measured.

Simulation: The performance of a proposed controller can be tested in a virtual plant before applying it to the real process.

Constraint management: Processes can be operated closer to the constraints on their process variables by using a process model to foresee and forestall constraint violations.

Process optimization: The most profitable allocation of resources can be determined by using the process model to predict the economic benefits of various rationing strategies.