Continuous System Simulation
Continuous System Simulation
• Here, the dependent variable x appears together with its first and second derivatives and that the
terms involving these quantities are multiplied by constant coefficients and added.
• The quantity F(t) is an input to the system, depending upon the independent variable t.
• If the dependent variable or any of its derivatives appear in any other form, such as being raised
to a power, or are combined in any other way for example, by being multiplied together, the
differential equation is said to be nonlinear.
• When more than one independent variable occurs in a differential equation, the equation is said
to be partial differential equation.
• It can involve the derivatives of the same dependent variable with respect to each of the
independent variables.
3.2 Continuous system
• Differential equations both linear and non-linear, occur repeatedly in scientific and
engineering studies. The reason for this prominence is that most physical and chemical
processes involves rates of change, which require differential equations for their
mathematical description.
• Therefore, Continuous System Simulation refers to a computer model of a physical system
that continuously tracks system response according to a set of equations typically
involving differential equations.
• Continuous System simulation allows prediction of:
rocket trajectories
hydrogen bomb dynamics
electric circuit simulation
human respiration
robotics
3.2 Example: Continuous System
Distributed Lag Models
• Models that have the properties of changing only at fixed intervals of time,
and of basing current values of the variables on other current values and
values that occurred in previous intervals, are called distributed lag models.
• They are used extensively in econometric studies where the uniform steps
correspond to a time interval, such as a month or a year, over which some
economic data are collected.
• These models consist of linear algebraic equations.
• They represent a continuous system, but one in which the data is only
available at fixed points in time.
Distributed Lag Models-Contd..
• As an example, consider the following simple mathematical model of the
national economy:
• Let, C be consumption, I be investment, T be taxes, G be government
expenditure and Y be national income.
C=20+0.7(Y-T)
I=2+0.1Y
T=0.2Y
Y=C+I+G
• All quantities are expressed in billions of dollars.
• This is a static mathematical model, but it can be made dynamic by picking a
fixed time interval, say one year, and expressing the current values of the
variables in terms of values at previous intervals.
Distributed Lag Models-Contd..
• Any variable that appears in the form of its current value and one or
more previous intervals is said to be a lagged variable.
• Its value in a previous interval is denoted by attaching the suffix –n to
the variable, where n indicates the interval, with 1 denoting the
previous interval, 2 denoting the one prior to that, and so on.
• In this example we will only go back one interval such as:
I = 2+0.1Y-1
T=0.2Y-1
Y = C-1+ I-1+G-1
C=20+0.7(Y-1-T-1)
Distributed Lag Models-Contd..
• Given an initial set of values for all variables, the values of the
variables at the end of one year can be derived.
• Taking these values as the new values of the lagged variables, the
values can be derived at the end of the second year and so on.
• There are only four equations in five unknowns, so one variable must
be specified for each interval.
3.3 Analog Computer
• The most widely used form of analog computer is the electronic
analog computer, based on the use of high gain dc (direct current)
amplifiers, called operational amplifiers.
• Voltages in the computer are equated to mathematical variables, and
the operational amplifiers can add and integrate the voltages.
• With appropriate circuits, an amplifier can be made to add several
input voltages, each representing a variable of the model, to produce
a voltage representing the sum of the input variables.
3.3 Analog Computer
• Different scale factors can be used on the inputs to represent coefficients
of the model equations. Such amplifiers are called summers.
• Another circuit arrangement produces an integrator for which the output
is the integral with respect to time of a single input voltage or the sum of
several input voltages.
• All voltages can be positive or negative to correspond to the sign of the
variable represented.
• To satisfy the equations of the model, it is sometimes necessary to use a
sign inverter, which is an amplifier designed to cause the output to
reverse the sign of the input.
3.3 Analog Computer
• Electronic analog computers are limited in accuracy for several reasons.
It is difficult to carry the accuracy of measuring a voltage beyond a certain
point.
Secondly, a number of assumptions are made in deriving the relationships for
operational amplifiers, none of which is strictly true; so, amplifiers do not solve
the mathematical model with complete accuracy.
A particularly troublesome assumption is that there should be zero output for
zero input.
Another type of difficulty is presented by the fact that the operational
amplifiers have a limited dynamic range of output, so that scale factors must
be introduced to keep within the range.
3.3 Analog Computer
• As a consequence, it is difficult to maintain an accuracy better than
0.1% in an electronic analog computer.
• A digital computer is not subject to the same type of inaccuracies.
• Virtually any degree of accuracy can be programmed and, with the
use of floating-point representation of numbers, an extremely wide
range of variations can be tolerated.
• Integration of variables is not a natural capability of a digital
computer, as it is in an analog computer, so that integration must be
carried out by numerical approximations.
3.3 Analog Computer
• However, methods have been developed which can maintain a very
high degree of accuracy.
• A digital computer also has the advantage of being easily used for
many different problems.
• An analog computer must usually be dedicated to one application at a
time, although time-sharing sections of an analog computer has
become possible.
3.3 Analog Computer
• In spite of the widespread availability of digital computers, many users prefer to
use analog computers. There are several considerations involved.
The analog representation of a system is often more natural in the sense that it
directly reflects the structure of the system; thus simplifying both the setting—up
of a simulation and the interpretation of the results.
Under certain circumstances, an analog computer is faster than a digital computer,
principally because it can be solving many equations in a truly simultaneous
manner; whereas a digital computer can be working only on one equation at a
time, giving the appearance of simultaneity by interfacing the equations.
On the other hand, the possible disadvantages of analog computers, such as
limited accuracy and the need to dedicate the computer to one problem, may not
be significant.
3.4 Analog methods
• The general method by which analog computers are applied can be
demonstrated using the second—order differential equation that has
already been discussed:
3.4 Analog methods
• Suppose a variable representing the input F(t) is supplied, and assume for the time
being that there exist variables representing -x and -
• These three variables can be scaled and added with a summer to produce a
voltage representing M2 .
• Integrating this variable with a scale factor of 1/M produces
• Changing the sign produces -, which supplies one of the variables initially
assumed; and a further integration produces -x, which was the other assumed
variable.
• For convenience, a further sign inverter is included to produce +x as an output.
• A block diagram to solve the problem in this manner is shown in following Figure.
3.4 Analog methods
3.4 Analog methods
• The symbols used in the figure are standard symbols for drawing
block diagrams representing analog computer arrangements.
• The circles indicate scale factors applied to the variables.
• The triangular symbol at the left of the figure represents the
operation of adding variables.
• The triangular symbol with a vertical bar represents an integration,
and the one containing a minus sign is a sign changer.
3.4 Analog methods
• The addition on the left, with its associated scaling factors, corresponds to
the addition of the variables representing the three forces on the wheel,
producing a variable representing M .
• The scale is changed to produce and the result is integrated twice to
produce both and x.
• Sign changers are introduced so that variables of the correct sign can be
fed back to the adder, and the output can be given in convenient form.
• With an electronic analog computer, the variables that have been
described would be voltages, and the symbols would represent
operational amplifiers arranged as adders, integrators, and sign changers.
3.4 Analog methods
• The above Figure would then represent how the amplifiers are
interconnected to solve the equation.
• It should be pointed out, however, that there can be several ways of
drawing a diagram for a particular problem, depending upon which
variables are of interest, and on the size of the scale factors.
• When a model has more than one variable, a separate block diagram
is drawn for each variable and, where necessary, interconnections are
made between the diagrams.
• As an example, the following Figure shows a block diagram for solving
the model of the liver.
3.4 Analog Methods
• Model of a Liver
The function of liver in human body can be explained as; when a chemical
thyroxine is injected into the blood stream, it is carried to liver.
The liver can change the thyroxine into iodine which is absorbed into the bile.
However, neither the conversion nor the absorption occur instantaneously.
Some of the thyroxine reenters the blood stream to be re-circulated and
returned to the liver.
To study this phenomenon, a mathematical model was constructed assuming
that the body can be represented as 3 compartments and that the rates at
which thyroxine is transferred between the compartments are proportional to
the concentration of the thyroxine in the compartments.
3.4 Analog Methods
• The three compartments 1, 2 and 3 represents the blood vessels , the
liver and bile respectively. The model leads to three differential
equations as:
3.4 Analog methods
3.4 Analog methods
• There are three integrators, shown at the bottom of the figure.
Reading from left to right, they solve the equations for X1, X2, X3.
• Interconnections between the three integrators, with sign changers
where necessary, provide inputs that define the differential
coefficients of the three variables.
• The first integrator, for example, is solving the equation:
-k12x1 + k21x2
3.4 Analog methods
• The second integrator is solving the equation:
k12x1 – (k21 +k23) x2