Main menu

- Home Page
- Sensors
- Simulation
- Analytics
- Forecasting
- Football Forecasting
- Random Corner
- Projects
- Resources
- Blog
- About/Contact
- Creative Works
- Separator 1
- Privacy & Terms

Simulation > Introduction to Simulation

*6 July 2017*

One major way of classifying simulation models is whether they are *static *or *dynamic*.

A static model is one which contains no internal history of either input values previously applied, values of internal variables, or output values. A canonical example of a static model is a set of algebraic equations.

In this type of model, each output (y i ) is dependent on some function (f i ) of the inputs (u i ). It is also possible for the output variables to be dependent on other output variables, although this results in a model which may not have closed-

To 'run' this type of static simulation model involves setting the parameters of the equations, providing values for any inputs they may require, and evaluating, which yields a set of results. A static model can be thought of as providing a 'snapshot' of a system's response to a specified set of input conditions.

An example of a static model is the calculation of mechanical stress in a bridge or other similar structure. Although in actual use, cars and trucks may be driven over it, one of the most basic models that will typically be built is one which assumes that some weight distribution has been placed on the bridge at some point in the past, and that everything has settled into a steady-

Since a static simulation model of a bridge won’t account for the effects of loads created by time-*Dynamic* models provide one means of simulating the time-

The defining feature of a dynamic model is that unlike the static model, it *does* maintain an internal 'memory' of some combination of prior inputs, internal variables, and outputs. The canonical example of a dynamic model involves the combination of algebraic and differential equations:

In the above model, there are still input variables (u i ) and output variables (y i ). The main addition is a series of *state variables* (x i ) that are dependent on both the input variables and themselves. The output variables (y i (t)) are defined by a set of functions 'g' whose outputs are also dependent on the present state of the input variables and the state variables.

Also note that all variables are now denoted as functions of time. While you can certainly formulate a static model such that the inputs and outputs are functions of time, it is much more so important to specify this in a dynamic model. In the static model, providing the same set of input values will always result in the same set of output values. In the case of the dynamic model, the output values at any instant in time are dependent on not only the input values at that time, but may also be dependent on all of the input values presented to the model at previous times as well.

As previously mentioned, a dynamic model has internal memory – this is provided by the state variables. The values of the state variables in this example are not defined, just their rate of change (dx/dt), which can (and for most interesting models, will) vary as a function of time. And that rate of change is dependent on their current values, and the current values of the inputs. You may recognize the state variables and their defining relationships as an example of set of 1 st order differential equations.

Since only the rate of change is defined for the state variables, consider what happens if for some interval of time, that rate of change were somehow to be *zero* – the values of the state variables would just remain constant from the start to the end of that time interval. Even in the more common case where their rate of change is not zero, but is some other value, their ability to change is limited by the defining rate of change. This means that their values tend to change only a small amount when viewed from instant-

Another consequence of defining only the rate of change for the state variables is that we must also define *initial conditions* for them -*time is the independent variable that drives everything else.* Input variables are defined either as functions of time or as constants (which can still be thought of as very dull functions of time whose values do not change!). Time is given a privileged status within the model and is often referred to as the simulation *clock*. In implementations of simulations, the time variable is often managed implicitly by the software, and cannot be directly controlled by conditions in the model. For example, in a popular electronic circuit simulation program called SPICE, the user will specify a stop-

Differential equations are most useful in describing systems where the state variables change continuously, that is, the values of the state variables do not change in discrete jumps. Because many physical systems behave this way, and many other systems' behavior can be approximated by continuous change, the differential equation paradigm is extremely useful in a wide range of modeling domains.

Some systems really are not modeled very well by continuously changing variables. In physics, quantum mechanics is all about the idea that at the most fundamental levels of reality, the world becomes discontinuous. Outside of this specialized field of physics, however, the most common models in which discontinuous behavior occurs may be found in man-

While it is often possible to model discontinuous systems using the continuous differential equation paradigm, there are other representations which are often better suited for this purpose – better suited as in requiring fewer approximations and intellectual somersaults to form a useful model. A *state machine* is one such model which is intended specifically for representing highly discontinuous systems. One formulation of a state machine is shown in the set of equations below:

Similarly to the continuous model, the discrete model has input variables (ui[t]), output variables (yi[t]) and state variables (xi[t]). The key differences from the continuous differential-

Time in the simulation progresses in discrete steps of 'Δt'. Nothing interesting happens between these discrete time-

points. The variables do not represent continuous functions – they only need to be defined for specific points in time, and are represented as discrete sequences of numbers. While their values may often be treated as persisting between the time steps, this is not necessary to 'executing' the simulation.

State variables are updated with completely new values (x[t+ Δt]) based on their previous values (x[t]) and the previous values of the inputs (u[t]). Unlike the state variables in the differential equation paradigm, the state variables in a state machine paradigm can, and always do, change in discrete steps.

The above set of equations should be treated as the 'entry-

It is also possible for a dynamic model to include both continuous and discontinuous components. In this case the model will include both differential equations and state machines. While this does make the low-