# From Math to Models

## Unlike a plastic or clay model that shows the appearance of an object, a process model shows how a controlled process reacts to control efforts and disturbances. A process model generally takes the form of mathematical equations that quantify the relationship between the process’ inputs and its outputs.

11/01/2006

 At a glance Mathematical models explained Simulating a process with its model Examples Advantages and limitations

Unlike a plastic or clay model that shows the appearance of an object, a process model shows how a controlled process reacts to control efforts and disturbances. A process model generally takes the form of mathematical equations that quantify the relationship between the process’ inputs and its outputs.

Models are useful in understanding PID loops and for designing process control systems. Consider, for example, a process involving a cylindrical tank being filled with water as shown in the “Simple Process Model” graphic. If the inflow rate is F, the level in the tank after t minutes of filling will be:

[1]

where R is the radius of the tank. Such a model could be used to predict how long a controller would need to operate to fill the tank.

## Elements of a model

More complex process models can involve more variables and more elaborate mathematical relationships, but all models for continuous processes consist of four basic elements:

• Input variables;

• Output variables;

• Constants; and,

• Operators.

The outputs are the quantities that the model is designed to predict from the values of the inputs. In the tank filling example, L is the output that can be predicted from inputs t and F.

The value of R is a constant determined by the size of the tank. Constants generally represent fundamental principles of physics, chemistry, economics, geometry, etc. that govern the behavior of the process. Their values do not vary over time as the inputs and outputs change.

Operators define the mathematical manipulations required to compute the value of the outputs from the inputs and constants. They can be as simple as the multiplication and squaring functions in equation one or as complex as Laplace transforms and statistical distributions.

## Models for control

Process models can be useful for designing, implementing, and testing feedback control schemes. Most analytical techniques require a model with gains and time constants that show how much and how fast the process reacts to a control effort. Knowledge of the model parameters allows an engineer to design an aggressive controller for a slow-acting process or a conservative controller for a fast-acting process.

Similarly, model predictive controllers can use mathematical models to determine the control effort required to achieve a particular trajectory for the controlled variable. They essentially design themselves on the fly.

If a control scheme has already been developed for a particular application, a process model can also be used to test the scheme on a virtual process before trying it on the real thing. The model’s governing equations can be programmed into the controller or into a separate test computer using custom code or one of several special-purpose simulation languages. Simulations running in computer time can quickly uncover flaws in the proposed control scheme without risking damage to the real process.

## Model development example

The trick to developing a model for any of these purposes is encoding the behavior of the process into a set of governing equations like number one. Consider the example shown in the “Inverted Pendulum Model” graphic where a heavy load sits atop a flat spring affixed to the ground. A horizontal disturbance causes the load to sway back and forth in a single arc.

The behavior of this device could be used for a variety of simulation studies. It could be a child’s toy or a simplified representation of a tall building swaying in the wind. With additional joints, it could approximate the motion of a person’s leg during a stride.

Whatever the application, the underlying physics principles are the same. The gravitational force on the load is opposed by the resistance of the spring. If the load and the spring combine to form a mass of m kilograms with a center of mass h meters above the ground, then the motion of the whole contraption can be described in terms of the angular position measurement e as shown in the graphic.

## Reality check

 This simple model predicts the water level L (in meters) inside a cylindrical tank of radius R meters after t minutes of filling at a rate of F cubic meters per minute.

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 friction affect the motion of the load and that the resistive force applied by the spring is perfectly proportional to the angular position e. It also assumes that the process begins moving from a perfectly vertical position (i.e., the value of e is initially zero).

A further simplification would typically be applied to equation two in cases where e remains small enough to roughly equal sin(e). Substituting e for sin(e) yields equation three, which is said to be linear because e plotted against e would yield a straight line with a slope of -(k - mg)/mh.

Model for the inverted pendulum process

[2]

Simplified model for the inverted pendulum

[3]

Solution to the simplified model

[4]

where

[5]

[6]

The angular acceleration variable e is the second time derivative of the angular position e, t is the time since the process was first set in motion, e ° is the initial angular velocity imparted to the load by the disturbance, A is the amplitude of the process’ subsequent oscillations andù is their frequency. The values of A and ù are constants that depend on k, m, g, h, and e ° as shown in equations five and six.

However, the real purpose of equation three is to generate a plot of e vs. time to predict the future motion of the process. That happens to be a simple matter with a linear equation like number three. In fact, equation three can be solved explicitly for e(t) as shown in equation four.

An analogous closed-form solution for equation two would be much more complex because of the non-linear sine operator. Control engineers will sometimes go to great lengths to create a linear rather than a non-linear process model just to simplify the mathematics of the problem.

## Limitations

Unfortunately, even the simplified equation three would not be particularly useful for purposes of controlling the output variable e(t). Unlike a real-world process, it includes no input variables that a controller could manipulate to produce a new position or velocity for the load.

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 only works if the induced oscillations remain small enough to make e approximately equal to sin(e). Otherwise, the process begins to behave according to equation two rather than equation three.

Most real processes do behave differently if their input and output variables go from low values to high values and back again. Even the tank-filling model will fail if the tank fills to the point that the sides start to bulge. A process model must account for such changes or else the controller that relies on the model will not get the results it expects.

 This spring-mounted load has a total mass of m kilograms and a center of mass h meters above the pivot point. The spring deflects by radians from the vertical position after a horizontal disturbance. The force of the load’s weight is mg.sin() which is opposed by the spring force k. The constants g and k represent the acceleration due to gravity and the angular spring constant, respectively.

Equation three also fails to describe the actual motion of the inverted pendulum if the initial conditions are incorrectly identified. In this model, the only initial condition is e ° , which represents the angular velocity of the load at time t=0 when the disturbance is applied. Equation six shows how the value of e ° determines the amplitude of the load’s subsequent oscillations. The larger the initial velocity due to the horizontal disturbance, the further the load will swing with each oscillation.

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

## Simulation results

But if such limitations can be identified and minimized, a well-developed process model can simulate the behavior of a process with considerable realism. To ensure the necessary accuracy, process engineers will typically run a series of validation tests where the model is exercised under various conditions for which the process’ behavior is already known.

For example, a building will sway further when wind gusts are stronger. The inverted pendulum model can be tested under analogous conditions by increasing the initial angular velocity imparted by the disturbance (e ° ). Equation six shows that the amplitude of the model’s oscillations will increase in direct proportion to the load’s initial velocity, just as the building would behave.

But simulations are most valuable when they are conducted with conditions that have never been tried on the real process, especially when they reveal unexpected behaviors—either dangerous situations that must be avoided with the real process or operating conditions that will improve yields over current levels. With an entire simulated plant based on thoroughly validated models, process engineers can search by trial-and-error for combinations of operating conditions (temperatures, pressures, flow rates, etc.) that will produce more of their product at a lower cost.

The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by...
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
Each year, a panel of Control Engineering and Plant Engineering editors and industry expert judges select the System Integrator of the Year Award winners in three categories.
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
Robotic integration and cloud connections; SCADA and cybersecurity; Motor efficiency standards; Open- and closed-loop control; Augmented reality
Controller programming; Safety networks; Enclosure design; Power quality; Safety integrity levels; Increasing process efficiency
Additive manufacturing benefits; HMI and sensor tips; System integrator advice; Innovations from the industry
Featured articles highlight technologies that enable the Industrial Internet of Things, IIoT-related products and strategies to get data more easily to the user.
This article collection contains several articles on how automation and controls are helping human-machine interface (HMI) hardware and software advance.
This digital report will explore several aspects of how IIoT will transform manufacturing in the coming years.
Cloud, mobility, and remote operations; SCADA and contextual mobility; Custom UPS empowering a secure pipeline
Infrastructure for natural gas expansion; Artificial lift methods; Disruptive technology and fugitive gas emissions
Mobility as the means to offshore innovation; Preventing another Deepwater Horizon; ROVs as subsea robots; SCADA and the radio spectrum
Automation Engineer; Wood Group
System Integrator; Cross Integrated Systems Group
Jose S. Vasquez, Jr.
Fire & Life Safety Engineer; Technip USA Inc.
This course focuses on climate analysis, appropriateness of cooling system selection, and combining cooling systems.
This course will help identify and reveal electrical hazards and identify the solutions to implementing and maintaining a safe work environment.
This course explains how maintaining power and communication systems through emergency power-generation systems is critical.