It is
often usefulto
structurea
large probleminto
smaller subproblems. Insimulation
this is
doneby
decomposinga large
systeminto
interconnected subsystems.A
subsystemis
often represented as a box with inputs and outputs and the interconnectionsare
representedby
directed lines between the boxes.Such
a structure can be
representedin
Simnon.This is
doneby
adding declarationsof
inputs and outputsto
the system descriptions. The subsystemscan then be described as
a
CONTINUOUS SYSTEMor a
DISCRETE SYSTEM. A special typeof
systemis
usedto
describe the interconnections. This system is called a CONNECTING SYSTEM.Consider
the
control system shownin
Fig.8
whichis a
combinationof
twosubsystems
discrete
system REGinput yref
youtput
uEND
continuous system PROC
input
uoutput
yI
, ì'
t
?
END
and the system which describes the iriterconnection is given by
.t
,,ll'l f' lt
REG PROC
r
Figure
8.
Block diagram of an interconnected system' connecting sYstem CON"Connecting system
for simulation of
process PROC"with PI regulation
by system PIREGtime t
yrIpireg]
=1yIpireg]=yIproc]
uI proc ] =uIpireg
]
END
Notice
that
states, variables,and
parametersare local
variablesin
eachsubsystem. Variables
in
different subsystems maybe
specifiedby
adding the system namein
square brackets after the identifier. Also notice that expressions may be used to describe the interconnections. constructions likey[reg] = if t<l
then0 else sin(k*v[proc])
are thus possible.The simulation
of
an interconnected system is done using the same commands as was usedto
simulate differenceor
differential equations. The only difference isthat
it is
necessaryto
activateall
subsystems that describe the interconnected system. This is done bY the commandSYST SYS1 SYSz CON
The connecting system must be the last system
in the list'
Theorder of
the systemsis
otherwise irrelevant. Contir,trä,'r, and discrete system may be mixedfreely. + ,
¡, lt t
AN EXAMPLE
-
SIMULATION OF A COMPUTER CONTROL SYSTEMA
continuoustime
processïtÍtv¡
computercontrol
systemis
conveniently described as an interconne"t"h'=yJtem. The process may be represented as aCONTINUOUS SYSTEM and the control computer as a DISCRETE SYSTEM'
discrete
system PIREG"PI regulator with
anti-windupinput yr
youtput
ustate i
new
ni time t
tsamp
ts
e=yr-yv=k* e+i
u=if
v<ulow then ulowelse if
vcuhigh then v ni=i+k* erh/ti+u-v
ts=t+h k:1
ti:
Ih: 0.5 ulow: -1 uhigh: 1 END
else
uhighconnecting system CON
"Connecting system
for simulation of
process PROC"with PI regulation
by system PIREGtime t yrIpireg]=1 yIpireg]=yIproc
uIproc]=uIpiregEND
l l
Listins
5.
Sirnnon descriptÍon of a simple control loop consistingof
a continuous time process and a discrete time PI regulator.Listing 5 describes a feedback loop consisting
of
a continuous time process called PROC and a digital PI regulator called PIREG" The processis
an integrator with input saturation. The interconnectþns ,ar,e describedby the
connecting systemcoN. , t' t
4.t
ln f I
Command
syst proc pireg con store
yr
y[proc]tpt
simu 0 40
split
2
1ashow
y yr
The following annotated dialogue illustrates how Simnon is used.
ashow upr
Action
Activate the system.
Select variables to be stored.
Simulate.
Form two screen windows.
Draw y and yr with
automatic scalingin
firstwindow.
Draw upr with automatic scaling in second window.
Notice
that the
namesare
localto
each subsystem.To
distinguish between variables that occurin
different subsystem the nameof
the subsystem is written in square brackets asin
y[proc]. Variables can be transmitted between subsystem by declaring them as inputs and outputs.The results of the simulation are shown by the oscillatory curves
in
Fig. 9. Thediscrete nature
of the
control actions generatedby the
computerare
clearly visiblein
the curves. These curves show that thereis
a considerable overshoot dueto
windup at the integral. Thisis
avoidedby
telling the regulator what the process limitations are. The commandspar
ulow: -0.1par
uhigh: 0.1changes the necessary parameters. The commands
simu
0
40area
1 I
show
y yr
area2
Lshow upr
\ ,,
shows that the overshoot is reduceflrsignificantly. Compare Fig. 9"
GENERALITIES
¡."t f
Simnon allows three types
of
sþ3terl,. descriptions, namely CONTINUOUS SYSTEM, DISCRETE SYSTEM and CONNECTING SYSTEM. The discretE ANdthc
CONtinUOUs0
la-o L
! co
+tf +)e oJ
T,2
0"6
0 10 20. 30. 40
0.1
-0"1
0 10 20 30 40
Time t
Figure 9. Results
of
simulationof
process controlwith a pl
regulator. Thecurves
with
a large overshoot correspondto
an ordinary regulator.The other set of curves are obtained with a regulator with overshoot inhibition.
systems may be simulated individually provided that
no
inputs and outputs are declared. Interconnected systems may also be describedby
using the connecting system. The complete syntaxfor
the system descriptions is given in Appendix B.EXERCISES 0
J o
áo
.;
n
ãL {t co Lì
I
2
Look at the syntax of the comnTands SIST and SIMU using the help command.
what are the
differences, údtwåen simulationof single
systems and interconnected systems.The HELP
command hasexperimentally.
an hierarchical structure. Explore
thisy',"
f I
â34
3.
Use the command HELP LANGUAGE STRUCT to find the formof
the different system descriptions.4.
Assume that the variabley is
usedin
two subsystemsin
an interconnected system. Constructa
simple test exampleto find out
what happens. What diagnosis is produced? How can the variables be separated?5.
Considerthe
systemin the
example. Repeatthe
simulationon your
own computer. Investigate the consequences of changing the sampling period.6.
Study the structure of the system descriptions.t
, l)
t4
I ñ