Vous êtes sur la page 1sur 7

International Journal of Modelling and Simulation

ISSN: 0228-6203 (Print) 1925-7082 (Online) Journal homepage: http://www.tandfonline.com/loi/tjms20

Obtaining System Block Diagrams based on Bond


Graph Models and Application of Bondsim Tools

D. Antic & B. Vidojkovic

To cite this article: D. Antic & B. Vidojkovic (2001) Obtaining System Block Diagrams based on
Bond Graph Models and Application of Bondsim Tools, International Journal of Modelling and
Simulation, 21:4, 257-262

To link to this article: http://dx.doi.org/10.1080/02286203.2001.11442210

Published online: 15 Jul 2015.

Submit your article to this journal

Article views: 22

View related articles

Full Terms & Conditions of access and use can be found at


http://www.tandfonline.com/action/journalInformation?journalCode=tjms20

Download by: [Istanbul Technical University] Date: 12 October 2017, At: 04:45
International Journal of Modelling and Simulation, Vol. 21, No.4, 2001

OBTAINING SYSTEM BLOCK DIAGRAMS


BASED ON BOND GRAPH MODELS AND
APPLICATION OF BONDSIM TOOLS
D. Antic* and B. Vidojkovic*

Abstract simulation is performed; and the direct transformation of


Downloaded by [Istanbul Technical University] at 04:45 12 October 2017

causal bond graph model into the block diagrams is done


This article presents methods for transforming bond graph models [4-6] and then the simulation follows. In some simulation
into their representation by block diagrams. The authors show that programs, such as TUTSIM, the input code for simula-
the use of Simulink S-functions and Bondsim tools will simplify tion can be obtained directly from the causal bond graph
the modelling and simulation of dynamic systems. The application model. This program for dynamic system simulation ac-
of Bondsim elements is based on Fakri transformation of bond cepts (nonlinear) block diagrams, bond graphs, and their
graphs into block diagrams. This article introduces notions of combinations. The second way of simulation is realized us-
Fakri transformation, such as owner bonds of junctions, internal ing specialized program packages for simulation by directly
and external bonds, owner blocks of junctions, and constitutive entering the bond graph models. PC-CAMAS, 20 SIM,
blocks and connection with Bondsim elements. The efficiency of EMPORT-PC, CAMBAS, and others belong to that group
the proposed approach for modelling dynamic systems is illustrated of program packages. The third way for simulation is based
using an example. on the fact that every bond graph element is described
by the clearly defined mathematical relations that connect
KeyWords the variables effort e and flow f. The system of equations
that describes the dynamic behaviour of the modelled sys-
Modelling, simulation, bond graph, block diagram tem can be obtained for each bond graph element by the
analysis of these relations. Some specific form of equations
1. Introduction is often required, such as the state-space model, and it
is necessary to accomplish the additional arrangement of
The bond graph model and the block diagram are com- primary derived equations. Modern, block-oriented pro-
monly used to represent graphically the mathematical gram packages (MatlabjSimulink, Modelcc, Simnon, etc.)
model of a dynamic system. In a block diagram, the that do not accept, as input, simulation models in the
main system variables, the connections between them, and form of bond graph model or the special input code, allow
transfer functions, that is, dynamic characteristic of the the possibility of forming additional tools, to enable direct
system components, are presented. Therefore, a block dia- acceptance of the bond graph models.
gram provides functional information about what happens The most frequently used program package, Mat-
in a system and how events occur in that system. Whereas labjSimulink, is a high-quality piece of software for anal-
a bond graph provides insight into the physical nature and ysis, modelling, and simulation of dynamic systems. It
technical realization of the system elements, a block dia- contains different tools assigned for identification, control,
gram does not provide such details about the model of the optimization, fuzzy systems, neuro networks, and so on.
system. When the bond graph model is known for a dynamic sys-
Bond graph models can be used as simulation mod- tem, the state-space model for that system may be de-
els for analyzing different physical systems [1-5]. There rived and modelled in MatlabjSimulink using S-functions.
are four ways for obtaining simulation models from bond The following sections illustrate how these transformations
graph models: input code for simulation is derived directly may be completed, using an example. Bondsim Simulink
from the causal bond graph model; the bond graph model library for directly obtaining Simulink simulation models
is entered graphically by a special graph editor and sim- from bond graph models, without using state-space equa-
ulated; the state-space equations are derived from bond tions, was realized at the Faculty of Electronic Engineering
graph models, block diagrams are formed from them, and in Nis, Yugoslavia. This library contains elements (blocks)
* Department of Automatic Control, Faculty of Electronic En- that were derived from bond graph elements based on
gineering, Beogradska 14, P.O. Box 73,18000 Nis, Yugoslavia; knowledge of the causality and appropriate functional re-
e-mail: dantic@elfak.ni.ac.yu
lations between inputs and outputs. The elements of this
(paper no. 205-2006)
251
library and their application are described in detail in [7], L = 100H, R2 = 5000n; and the initial conditions are:
and the method of direct transformation of causal bond condensator voltage is equal to OV and coil current is equal
graph models into block diagrams (Fakri transformation) to OA.
is described in [6]. To get a simpler and more effective
direct transformation using the Bondsim tool, a connection
with Fakri transformation is proposed.

2. Obtaining System Block Diagrams Based on


State-Space Equations Derived from Causal
I c n :1
Bond Graph Models, and Simulation Using S-
Functions

The state-space models, derived from bond graph mod- Figure 1. The electrical circuit.
els, can be represented easily using Matlab/Simulink [8]
wherein if a nonlinear model is derived, the full block The bond graph model for obtaining the state-space
presentation or S-function can be used. If obtained state- equations of the given example is shown in Fig. 2.
space model is linear, the state-space Simulink block can
be used, too. R: l/R,
Downloaded by [Istanbul Technical University] at 04:45 12 October 2017

fF~"'l-
The S-functions can be used for modelling specific
problems and denoted in block diagrams using the S-
function Simulink block. S-function behaves like any other
f,=u f,=nx; fll=x, f l1 =x,
Matlab function. It has the calling syntax: SF : u=! I e -x;>" 0 _ . :> I TF --'-'--:::>".fl 1 :> I I: L
sys=model(t, x, u, flag) ,- 2 e,-x, n e ll =nx, e,,=nx,-R,x,
where model is the model name, t is the current value of
the time, x is the instantaneous value of the state variable,
"'" J fFll<",-x,iR, e"=R,, J f,,='
u is the current value of the input, and flag controls the C:C R:R,
information returned in sys. Setting the flag to various val-
ues causes the S-function to behave in completely different
ways, depending on what is required at the time. The flag Figure 2. The bond graph model for obtaining the state-
options available in Simulink are given in Table 1. space equations.

To derive the state-space model, let the state variables


Table 1 be the flow of I element,xl = /12, and the effort of C
Flag Options Available in Simulink element, X2 = e2. The equations for the O-junction are:

flag = 0 S-function returns sizes of parameters and


initial conditions /1=U
flag = 1 S-function returns state derivatives :i; = dx/dt
flag = 2 S-function returns the discrete state x(n + 1)
flag = 3 S-function returns the output vector y
flag = 4 S-function returns the next time interval for a
discrete update

If the state-space model is linear, that is, if it can be and for the 1-junction are:
given by:

x=Ax+Bu

y = Cx+Du (1)

then it can be implemented in Simulink using the state-


space block. (3)
The application of the proposed approach to forming
the block diagram will be illustrated using an electrical If the coil current and the condensator voltage are
circuit example, shown in Fig. 1. The parameter values chosen for the system outputs, the next state-space model
are: I = 980A, C = O.351F, Rl = 1/l1.6n, n = 1963, is given:
258
Stale~Space IB

Block name: State-Space


State-Space

State-space model matrices:


dx/dt = Ax + Bu
= C
X2 X+
1 ( -nXl - Rl 2U) y= Cx + Du

A:

11-50,19.63;-5592.5926.-33.048433)
B:
110;2.8490028)
Y2 = X2 (4)
c:

The state-space model (4) is linear, and there are three 0:


ways of modelling it in Matlab/Simulink: the full block
110;01
presentation, the using of State-space block, and the using
Initial conditions:
of S-function block.
The full block presentation is the easiest way to model
and leads to a better understanding of the system. The
Downloaded by [Istanbul Technical University] at 04:45 12 October 2017

block diagram of the electrical circuit example, shown Figure 4. Dialog box of Simulink state-space block.
in Fig. 3, is directly derived from the state-space equa-
tions (4). Fig. 5 shows the Simulink block diagram of the given
linear system, which uses the previous state-space block.

To Workspace2

2
To Workspace1
(,9----J1o[=r:::J
Clock To Workspace2
Gain: nIL
Figure 5. The use of the state-space block.
Gain:n/C
Constant: utC
The state-space model (4) can be written in the form
of the following S-function:
function[sys,xO]=ha(t,x,u,flag,L,R2,n,C,R1,xi)
if abs(flag)==l,
sys(1)=(1/L)*(-R2*x(1)+n*x(2));
sys(2)=(1/C)*(-n*x(1)-x(2)/R1+u);
(9----..!., I elseif flag==3,
sys(1)=x(1) ;
Clock To Workspace
sys(2)=x(2);
elseif flag==O,
Figure 3. The full block presentation.
sys=[2;0;2;1;0;0];
xO=xi;
The state-space model (4) can be written in the matrix else
form (1), where the matrices A, B, C, and D are given sys=[] ;
with: end;
end;
A= [ -R2/ L niL
-n/C -1/(CR1 )
1 =[ 1
,B
0
l/C '
This S-function can be built in block diagram (Fig. 6)
using S-function block, the Dialog box for which is shown
in Fig. 7.

(5) ha
Constant: S-Function
u=9S0 ~mux
To Workspace1
Equations (1) and (5) can be modelled in Simulink C9---+C:IJ
Clock To Workspace2
using the State-space block, the Dialog box for which is
shown in Fig. 4. Figure 6. Use of S-function block.
259
S-Funchon ~ 2. All elements are expanded into "computational blocks"
that represent the constitutive relations of the bond
I Block name: S-Function
graph elements (Fig. 8(b)).
i! Block type: S-Function
3. Every junction is represented by a node and a sum-
Ii Subsystem:
sys=fun(t.x.uJlag,param1 ...)
mation, wherein the constitutive relations of the junc-
! tion have to be satisfied in the proper causal form
l_.__~_.___...._~ . _. __.__....__._ (Fig. 8(b)).
Subsystem function name: The block diagram, shown in Fig. 8(b), is implemented
easily in Simulink (Fig. 9).
Function parameters:
1100,5000,1963,0.351.1 11 1.6,(0;011

Figure 7. Dialog box of S-function block.

The simulation results are given in Fig. 13.


Downloaded by [Istanbul Technical University] at 04:45 12 October 2017

To Workspace1

3. Breedveld Direct Transformation of Bond Graph ~


Clock To Workspace
Models into Block Diagrams

Figure 9. The Simulink realization of Breedveld transfor-


mation.

4. Application of Fakri Transformation and Bond-


sim Simulink Library

Fakri transformation is a simple, easy, and practical imple-


mentation of the Breedveld transformation to convert bond
graph models into their representation by block diagrams,
and it is an excellent, distinct, clear, and convenient trans-
formation for the application of Bondsim tool. In order to
facilitate the translation of the bond graphs into block dia-
grams, the following notions are introduced: owner bonds
a) of junctions, internal and external bonds, owner blocks of
junctions (O-junction and I-junction Bondsim elements),
and constitutive blocks (other Bondsim elements). The
owner bonds of junction, internal, and external bonds are
shown in Fig. 10. The Bondsim simulation model, derived
r.:I f, using the rules for direct transformation of bond graph
~1---I+11
models into the block diagrams that were defined by Fakri
[6] and Bondsim library [7, 8], is given in Fig. 11. The
owner block of junctions and Bondsim elements are also
shown in Fig. 11.

External bonds Owner bond


of junction
h)

Figure 8. Breedveld direct transformation of bond graph


model into block diagram. SF I
11 IT! 4
2 / 0 ",3 _ :> I TF
11 ifl12
:>" ~-1313~>"\'" I
Breedveld [5] exhibited a procedure for directly trans- A "t; Internal /I ~
forming causal bond graph model into the block diagram. C R bonds R
The causal bond graph model can be "expanded" into a
block diagram by the following procedure: of junction
1. Every bond is represented by two opposite arrows.
The direction of the arrows is determined by the causal
strokes (Fig. 8(a)). Figure 10. Some transfer elements.
260
The rules for bond graph models transformation into is presented in the block diagram by a-junction Bondsim
block diagrams are given by the following algorithm: element, which realizes the constitutive relation of this
1. Number the junctions and the bonds of the causal junction (12 = h - h - 14)
bond graph model. Junction number 2 is a I-junction (common flow junc-
2. For each junction composed of N bonds identify owner tion). It has three bonds. The owner bond of junction is
bond of junction, the common power variable, and the the number 12, and it is linked to I bond graph element
N - 1 external and internal bonds. (The owner bond and requires I Bondsim element. The bond number 11
of junction is the bond that imposes by its causality is an external bond linked to RTF element in block dia-
the common power variable to the considered junction. gram. The owner block of junction number 2 is I-junction
The internal bonds of junction are bonds of R, I, Bondsim element, and it realizes the constitutive relation
or C bond graph elements that have common power e12 = ell - e13'
variable in their inputs. The external bonds are sources
and/or bonds exchanging power with some of the other RTF-TIght causal strokes TF [Mask) Imi
junctions of the graph directly or through transformers r"BI~-~-~;;~':""'RightT~;~~fu;;;'-~;-"""""""'-'_ . . . ._.
(TF) or gyrators (GY)).
3. Construct the owner block of junction (a-junction or 1- i Block type: RTF-right causal strokes'
r.:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
junction Bondsim element) expressing the power con- I Enter the value of transformer ratio m.
servation, having on its output the power variable of ! (in1 =e1. in2=f2.outl =e2. out2=f1).
Downloaded by [Istanbul Technical University] at 04:45 12 October 2017

;
the owner bond of junction, and having the N - 1 IL-__________________________ ~

internal or external bonds as inputs. Transformer ratio:


4. Place the appropriate Bondsim elements, of the bond
graph elements connected with internal bonds, in the
local feedback loops of the new block diagram.
5. Take power variables of external bonds on blocks rep-
resenting following Bondsim elements: SE, SF, RTF, Figure 12. Dialog box of RTF Bondsim element.
LTF, RMTF, LMTF, OGY, IGY, OMGY, IMGY,
other I-junctions and a-junctions. The simulation results for the example electrical circuit
Note: When the owner bond is not connected with are presented in Fig. 13.
an R, I, or C element, there are no local feedback loops. 0.9,,.---,---,---,---,----, 10

,~Jj\!ij~
All external and internal bonds of the owner block are
taken on the next Bondsim elements representing the other
junctions of the bond graph.

CD ~/I Owner blocks of june'lions i---"" GJ


a ::: ~/ . . . ~ ........... ;
Flow-sou=
'--~r.+---,/ Capadtance Right Transformer 1 ;,nction ,
Cf--...----..J
0~~0~.02~~0.~04-~-0~.0~8~O.1
time(!O)

o} b)
Conductance
To Worksp.",,2
.1 Figure 13. Simulation results of electrical circuit shown in
Fig. 1.
Figure 11. Bondsim simulation model of considered exam-
ple. 5. Conclusion

The causal bond graph model, shown in Fig. 10, con- A method for direct transformation of bond graph models
sists of two junctions. of dynamic systems into models in the form of block dia-
Junction number 1 has four bonds. It is a a-junction grams is introduced. The application of this method en-
(common effort junction). The owner bond is the number ables simple modelling and simulation of dynamic systems
2 connected with C bond graph element and requires using program packages oriented on block diagrams that
C Bondsim element placed behind O-junction Bondsim are accessible frequently. Obtaining simulation models in
element in the block diagram given in Fig. 11. The bond the form of block diagrams is done directly from bond
number 3 linked to R bond graph element is an internal graph models. Explicitly written equations are not neces-
bond and requires a local feedback loop with G Bondsim sary because the use of Bondsim elements directly realized
element in the block diagram. The bond number 1 (flow the constitutive relations of the bond graph elements and
source, SF bond graph element) and number 4 are external junctions, that is, constitutive blocks and owner blocks
(no local feedbacks). The external bond number 4 is linked of junctions. Fakri transformation is convenient for di-
to TF bond graph element presented by RTF Bondsim rect application of Bondsim elements to optimize Simulink
element in the block diagram. The Dialog box of RTF is blocks. Using the Bondsim library, a visually more dis-
given in Fig. 12. The owner block of junction number 1 tinct simulation model is obtained that enables simpler
261
manipulation of elements of the simulation model. The Biographies
application of Bondsim library retained the computational
as well as the topological structure of the system. A simple Dragan Antic received the B.Sc.,
application of the proposed method is illustrated using a M.Sc., and Ph.D. degrees from
concrete example of modelling and simulation. This paper the Faculty of Electronic Engi-
has demonstrated how the S-functions may be used with neering, University of Nis, Yu-
bond graph modelling and simulation of dynamic systems. goslavia, in 1987, 1991, and 1994,
respectively. He is now Associate
References Professor at that faculty, where
he teaches courses in modelling
[1] P.J. Gawthrop & L. Smith, Metamodelling: Bond gmphs and and simulation and control sys-
dynamic systems (London: Prentice Hall, 1996).
[2] J.U. Thoma, Simulation by bond gmphs: Introduction to a
tem theory. He is the author and
gmphical method (Berlin: Springer, 1990). coauthor of a large number of pa-
[3] J. Thoma & B. Ould Bouamama, Modelling and simulation pers. His research interests are
in thermal and chemical engineering: A bond gmph approach modelling and simulation, variable structure systems, fuzzy
(Berlin: Springer, 2000).
[4] J. Thoma, Introduction to bondgmphs and their applications
sliding mode control, control of electric drives, and indus-
(Oxford: Pergamon, 1975). trial processes.
[5] P.C. Breedveld, Systematic procedures to derive block dia-
Downloaded by [Istanbul Technical University] at 04:45 12 October 2017

grams and state equations from bond graphs. In A. Sydow,


S.G. Tsafestas, & R. Vichnevetsky (Eds.), Systems analy- Biljana Vidojkovic was born in
sis and simulation, Mathematical Research Band, 47 (Berlin: Jagodina, Yugoslavia, in 1973.
Akademie Verlag, 1988),371-374. She received the B.Sc. and M.Sc.
[6] A. Fakri, F. Rocaries, & A. Carriere, A simple method for the
conversion of bond graph models in representation by block degrees from the Faculty of Elec-
diagrams, Int. Conf. on Bond Gmph Modeling and Simulation tronic Engineering, University of
(ICBGM'97), Phoenix, 1997, 15-19. Nis, Yugoslavia, in 1996 and 1999,
[7] B. Vidojkovic, D. Antic, & B. Dankovic, Bondsim-Simulink
respectively. She is now a research
tools for bond graph modelling and simulation, Proc. 7th
Symp. of Mathematics and its Applications, Timisoara, 1997, assistant at that faculty, where
243-248. she is writing her Ph.D. thesis.
[8] D. Antic, B. Dankovic, & B. Vidojkovic, Modelling and simu- Her research interests are bond
lation of the force control system using bond graphs, Matlab
and Simulink, Proc. RISK '97, Nis, 1997, 61-66.
graph modelling and simulation.

262

Vous aimerez peut-être aussi