0% found this document useful (0 votes)
360 views40 pages

Continuous System Simulation

This document discusses continuous system simulation and related topics. It begins by defining differential and partial differential equations, which are used to model continuous systems. Continuous systems are those where state variables change continuously over time. Common examples are given. Analog computers and methods are then described for simulating continuous systems using voltages to represent variables. Hybrid simulation and digital-analog simulators are also mentioned. Feedback systems and continuous system simulation languages (CSSLs) are briefly introduced. Distributed lag models are provided as an example continuous system model.

Uploaded by

yalab guragai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
360 views40 pages

Continuous System Simulation

This document discusses continuous system simulation and related topics. It begins by defining differential and partial differential equations, which are used to model continuous systems. Continuous systems are those where state variables change continuously over time. Common examples are given. Analog computers and methods are then described for simulating continuous systems using voltages to represent variables. Hybrid simulation and digital-analog simulators are also mentioned. Feedback systems and continuous system simulation languages (CSSLs) are briefly introduced. Distributed lag models are provided as an example continuous system model.

Uploaded by

yalab guragai
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 40

Chapter 3

Continuous System Simulation


Overview
3.1 Differential and Partial differential Equations
3.2 Continuous System Models
3.3 Analog Computer
3.4 Analog Methods
3.5 Hybrid Simulation
3.6 Digital-Analog Simulators
3.7 Continuous System Simulation Languages (CSSLs)
3.8 Feedback Systems
3.1 Differential and Partial differential Equations

• An ordinary differential equations (ODEs), is the equation which deal


with functions of a single variable and their derivatives.
• A Partial Differential Equation (PDE) is a relationship between an unknown
function of several variables and its partial derivatives.
• In mathematics, a partial differential equation (PDE) is a differential
equation that contains unknown multivariable functions and their partial
derivatives.
• PDEs are used to formulate problems involving functions of several variables,
and are either solved by hand, or used to create a relevant computer model.
• PDEs can be used to describe a wide variety of phenomena such
as sound, heat, electrostatics, electrodynamics, fluid dynamics, elasticity,
or quantum mechanics.
3.2 Continuous system
• A continuous system is one in which the state variable(s) change continuously over time. E.g.
the amount of water flow over a dam.
• A continuous system is the one in which predominant activities of the system cause smooth
changes in the attributes of the system entities.
• When such a system is modeled mathematically, the variables of the model representing the
attributes are controlled by continuous functions.
• Generally, in continuous systems, the relationships describe the rates at which attributes
change, so that the model consists of differential equations.
• The simplest differential equation model with one or more linear equations with constant
coefficients can be solved analytically without the use of simulation.
• However, when nonlinearities are introduced into the model, it frequently becomes
impossible or, at least, very difficult to solve the models.
• The method of applying simulation to continuous models can therefore be developed by
showing their application to models where the differential equations are linear and have
constant coefficients, and then generalizing to more complex equations.
3.2 Continuous system
• An example of differential equation with constant coefficients can be taken as:

• 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

• The last integrator solves the equation.


k23x2
3.5 Hybrid Simulation
• Hybrid simulation is achieved by combining analog and digital computers.
• An approach to simulation in which a continuous simulation clock is
maintained and updates to the model are event-driven.
• The form taken by hybrid simulation depends upon the application.
One computer may be simulating the system being studied, while the other is
providing a simulation of the environment in which the system is to operate.
It is also possible that the system being simulated is an interconnection of
continuous and discrete subsystems.
• High-speed converters are needed to transform signals from one form of
representations to the other.
3.6 Digital-Analog Simulators
• Digital Analog Simulation (DAS) is a programming technique which
makes a digital computer operate much like an analog computer.
• Digital-Analog Simulators are the simulators that allow a continuous
model to be programmed on a digital computer.
• Languages contain macro-instructions that carry out the action of
adders, integrators and sign changers.
• A program, is written to link together these macro-instructions.
3.7 Continuous System Simulation Languages (CSSLs)

• CSSLs uses the statement-type of input for digital computers, allowing a


problem to programmed directly from the equations of mathematical model.
• CSSL uses macros and subroutines, that perform the function of specific
analog elements.
• CSSL also allows the user to define special purpose elements that correspond
to operations that are particularly important in specific types of applications.
• CSSL include a variety of algebraic and logical expressions.
• One particular CSSL described here is Continuous System Modeling Program,
Version III, (CSMP III)
CSMP(Continuous System Modelling Program) III
• A CSMP III program is constructed from three general types of
statements:
1. Structural Statements
2. Data statements
3. Control statement
CSMP III - Statements
Structural Statements:
• Structural statements which define the model. They consist of FORTRAN-like
programming language statements, and functional blocks of program code
(procedures) designed for repeat operations that frequently occur in a model
definition.
• Structural statements can make use of the operations of addition, subtraction,
multiplication, division and exponentiation, using the same notation and rules as used
in FORTRAN.
• For e.g., the model includes the equation:
X = + (Z-2)2
The following statement would be used as:
X = 6.0*Y/W + (Z-2.0)**2.0
CSMP III - Statements
• There are many functional blocks which, in addition to providing
operations specific simulation, duplicate many of the mathematical-
function subprograms of FORTRAN.
• Among these are the exponential functions, trigonometric functions
and functions for taking a maximum and minimum values.
• Below is the list of eleven of the functional blocks:
CSMP III - Statements
Functional Block General Form
INTEGRATOR Y = INTGRL (IC, X)
Y(0) = IC

LIMITER Y = LIMIT (P1, P2, X)


STEP FUNCTION Y = STEP (P)
EXPONENTIAL Y = EXP (X)
NATURAL LOGARITHM Y = ALOG (X)
TRIGONOMETRIC SINE Y = SIN (X)
TRIGONOMETRIC COSINE Y = COS (X)

SQUARE ROOT Y = SQRT (X)


ABSOLUTE VALUE Y = ABS (X)
LARGEST VALUE Y = AMAX1 (X1, X2, ……, Xn)

SMALLEST VALUE Y = AMIN1 (X1, X2, ……, Xn)


CSMP III - Statements
Data Statements:
• Data statements are those which assign numerical values to various changing parameters,
constants, and initial conditions.
• Of the data statements, one called INCON can be used to set the initial values of the integration-
function block.
Control Statements:
• Control Statements are those which specify options in assembly and execution of the program,
and the choice of output of the results of the calculations performed.
• CONST = parameter can be given a value for a specific run with CONST control statement. E.g.
CONST A = 0.5, XDOT = 1.25
• PARAM = it can be used to assign values to individual parameters, but its chief purpose is to
specify a series of values for one parameter only.
E.g. PARAM D = (0.25, 0.50, 0.75, 1.0)
CSMP III - Statements
Control Statements Contd…
• PRINT = gives the output in the form of printed tables.
• PRTPLT = gives the output in the form of print plotted graphs.
• TIMER = used to specify certain time intervals. An integration time size must be
specified, a total simulation time must also be given and interval sizes for printing and
plotting results needs to be specified. The following is an example:
TIMER DELT = 0.005, FINTIM = 1.5, PRDEL = 0.1, OUTDEL = 0.1
The items specified are:
DELT = Integration time
FINTIM = Finish time
PRDEL = Interval at which to print the result
OUTDEL = Interval at which to print-plot
CSMP III - Statements
Control Statements Contd…
• TITLE = can be used to put headings on the printed output
• LABEL = can be used to put headings on the print-plotted outputs
• END = it specifies the end of the all the three types of statements.
CSMP III -Example
3.8 Feedback System
• The system that takes feedback from the output i.e. input is coupled
with output.
• Example a home heating system controlled by a thermostat is a simple
example of a feedback system.
• The system has a furnace whose purpose is to heat a room and the
output of the system can be measured as a room temperature.
• Depending upon whether the temperature is below or above the
thermostat setting, the furnace will be turned on or off, so that the
information is being feedback from the output to the input.
• Here, there are only two states, either the furnace is “on” or “off”.
References
G. Gorden, “ System simulation”

You might also like