J. Indian Inst. Sci., Jan.–Feb. 2006, 86, 45–68 © Indian Institute of Science.
Bond graph simulation and symbolic extraction toolbox in MATLAB/SIMULINK
AMOD C. UMARIKAR, TUSHARKANT MISHRA AND L. UMANAND* Centre for Electronic Design and Technology, Indian Institute of Science, Bangalore 560 012, India email:
[email protected]; Phone: 91-80-2293 2290 Received on December 7, 2004; Revised on October 14, 2005. Abstract Bond graph toolbox, developed in the MATLAB/SIMULINK environment, has two-fold functions: First to simulate the system using bond graph and second to extract the dynamical system equations in symbolic form. This development is an amalgamation of simulation power of the MATLAB/ SIMULINK and modelling power of the bond graph. The toolbox is divided into two parts. One deals with the numerical simulation of the bond graph model and the other handles extraction of dynamic equation in symbolic form. The process of toolbox development is discussed in detail, which is supplemented by an adequate number of examples that demonstrates its power. Keywords: Bond graph, toolbox, symbolic extraction, MATLAB/SIMULINK.
1. Introduction Modelling and simulation of engineering dynamical systems is an essential analysis and synthesis tool. ‘Pencil-and-paper’ approach to find the equations of the system and analysing the implications behind them is tedious for large complex systems. Numerical simulation on digital computer aids in understanding the dynamical behaviour of such systems. Many software packages on multiple platforms are available which perform simulation of complex physical systems that are represented in mathematical form. This has led to enhanced comprehension on the behaviour of the systems. Before embarking on the simulation process, the mathematical representation of the system is an important issue to be considered and overcome. One needs to get a sufficiently accurate model (mathematical representation) of the given system. There are various approaches for modelling systems. Graphical approach consists of the following methods: block diagram, signal flow graph, bond graph from which one gets the mathematical model of the system. Block diagram and signal flow graph provide a picture of the equations. They portray operators acting on the signals. Hence block diagram and signal flow graph do not give much insight into the topology of the system [1, 2]. This paper focuses on the use of bond graph method for modelling and simulating engineering systems. It seamlessly integrates modelling of multidisciplinary systems like electrical, mechanical, magnetic, thermal, etc. It is a well-established graphical method for *Author for correspondence.
46
AMOD C. UMARIKAR et al.
modelling dynamical systems. The causality property of bond graph gives cause–effect relationship between the system energy variables. Bond graph with assigned causality displays the structure of state space equations. One can write state equations from the bond graph just by inspection. Further, it provides an algorithmic way of extraction of state equations for computer simulation. These advantages have encouraged simulation industry to develop softwares which use bond graph as a primary modelling tool [3, 4]. Some of the software developed are 20-sim, SYMBOLS-2000, Enport and CAMP-G. Taking into account the advantages of bond graph, the authors thought of developing a tool that uses bond graph model as an input to the general simulation platform like MATLAB/SIMULINK. MATLAB is a high-level language for engineering applications. It integrates computation, visualization, and programming in an easy-to-use manner. SIMULINK® is a software package working in MATLAB environment that has applications in modelling, simulation and analysing dynamic systems. It supports linear and nonlinear systems, modelled in continuous time, sampled time, or a hybrid of the two. Systems can also be multirate, i.e. have different parts that are sampled or updated at different rates. MATLAB and SIMULINK are integrated; one can simulate, analyse, and revise models in either environment at any point [5]. For modelling, SIMULINK provides a graphical user interface (GUI) for building models as block diagrams, using click-and-drag mouse operations. With this interface, one can draw the models just as with pencil and paper (or as most textbooks depict them). This is an improvement over earlier simulation packages that require formulation of differential equations and difference equations in a language or program. SIMULINK includes a comprehensive block library of sinks, sources, linear and nonlinear components, and connectors. One can also customize and create new blocks using s-function block. The authors noted that if one can enter the model in SIMULINK directly in the form of bond graph instead of block diagram, then the appearance of the model is closer to the physical system than in the block diagram form. Furthermore, one will avail of all the processing power of MATLAB/SIMULINK. Thus integrating the powerful bond graph modelling technique and simulation package MATLAB/SIMULINK would give a better tool in analysing dynamical systems. Though many bond graph-based simulation software packages are available, at academic institutions level and in most industries, MATLAB/SIMULINK is the software which is used more often for studying dynamical systems. Keeping the above in mind, the authors have decided to develop bond graph toolbox using MATLAB/SIMULINK. The process of developing toolbox is described in the paper. Section 2 discusses briefly about bond graph modelling technique and professional bond graph simulation packages. Section 3 discusses the development process of bond graph simulation toolbox, Section 4 the symbolic equation extraction bond graph toolbox, and Section 5 simulation examples. Section 6 concludes the paper. 2. Bond graph philosophy and software Bond graph is a labelled and directed graphical representation of physical systems. The basis of bond graph modelling is power/energy flow in a system. As energy or power flow is the underlying principle for bond graph modelling, there is seamless integration across multiple domains. As a consequence, different domains (such as electrical, mechanical, ther-
BOND GRAPH—MODELLING AND SIMULATION
47
mal, fluid, magnetic, etc.) can be represented in a unified way. The power or the energy flow is represented by an half arrow, which is called the power bond or the energy bond. The causality for each bond is a significant issue that is inherently addressed in bond graph modelling. As every bond involves two power variables, the decision of setting the cause variable and the effect variable is by natural law. This has a significant bearing in the resulting state equations of the system. Proper assignment of energy direction resolves the sign-placing problem when connecting submodel structures. The causality will dictate whether a specific power variable is a cause or the effect. Causal bars on either ends of the power bond graphically indicate the causality for every bond. Once the causality gets assigned, bond graph displays the structure of state space equations explicitly. The discussion and examples of modelling engineering systems using bond graph modelling elements is discussed in [6, 7]. There are large number of software which are dedicated to simulation using bond graph modelling. A few of them are discussed here briefly. 1. The first bond graph modelling and simulation software is ENPORT, which was written in the early 70s. This software does not request causalities to be specified, and it transforms the topological input description into a branch admittance matrix, which could then be solved. It structures equations for solution with MATLAB®. This software was instrumental in the growth of bond graph theory and applications. However, the package does not conform to cutting-edge software development practices [8, 9]. 2. CAMP-G is a software package that helps engineers and scientists design mechatronics and dynamic systems using physical models described by the method of bond graphs as inputs. Mechanical, electrical, hydraulic, thermal and control systems can be modelled together using computer graphics. CAMP-G is a model generating tool that interfaces with languages such as MATLAB/SIMULINK, ACSL® and others to perform computer simulations of physical and control systems. However, it depends heavily on external software to perform post-processing. In the post-processing domain, relation to the base bond graph model is lost amidst mathematical abstractions [10–13]. 3. 20-sim is a modelling and simulation program that runs under Windows. The product is a time-tested modelling tool evolved after the famous DOS-based TutSim software. It is an advanced modelling and simulation package for dynamic systems that supports iconic diagrams, bond graphs, block diagrams, equation models or any combination of these. With it you can simulate the behaviour of dynamic systems, such as electrical, mechanical and hydraulic systems or any combination of these. The latest release is MATLAB enabled and allows interaction with SIMULINK [14–15]. 4. Modelica is an object-oriented modelling and simulation tool, influenced by many of the ideas from OMOLA and is used for large, complex, and heterogeneous physical systems. It is suited for multi-domain modelling, for example, mechatronic models in robotics, automotive and aerospace applications involving mechanical, electrical, hydraulic and control subsystems, process-oriented applications and generation and distribution of electric power. It is suited for hardware-in-the-loop simulations and for embedded control systems [16–17].
48
AMOD C. UMARIKAR et al.
5. SYMBOLS-2000 is object-oriented hierarchical hybrid modelling, simulation and control analysis software. It allows users to create models using bond graph, block diagram and equation models. Large number of advanced submodels called ‘Capsules’ is available for different engineering and modelling domains. This software uses a contemporary GUI with elegant outlook. Its symbolic and numeric solution capabilities are very advanced. This software requires pre-installed Microsoft Developer Studio™ (version 5.0 or above). It is recommended for use in research and industrial modelling of large systems [18, 19]. Apart from the software discussed above, there are numerous software for simulation using bond graph, which are discussed in [20, 21]. The authors thought of building a bond graph toolbox using a simulation package which is most generally available everywhere. MATLAB/SIMULINK [5] is being used extensively by both industrial and academic institutions. SIMULINK is very well developed software in which simulations are interactive, so one can change parameters on the fly and immediately see what happens. One has instant access to all the analysis tools, for working on the results, analyses and visualizations. After one defines a model, one can simulate it, using a choice of integration methods, either from the SIMULINK menus or by entering commands in the MATLAB Command Window. Using scopes and other display blocks, one can see the simulation results while the simulation is running. In addition, one can change parameters and immediately see what happens, for ‘what if’ exploration. The simulation results can be put in the MATLAB workspace for postprocessing and visualization. Further, using the symbolic math toolbox, which comes along with MATLAB package, one can extract dynamic equations of the bond graph model in SIMULINK in symbolic form. The symbolic math toolbox incorporates symbolic computation into the numeric environment of MATLAB. The computational engine underlying the toolbox is the kernel of Maple®. This toolbox supplements MATLAB numeric and graphical facilities with several other types of mathematical computation like calculus, solving and simplifying equations, linear algebra, etc. After obtaining state equations in symbolic form, one can use them for analysis and design of the system. Taking into account all the above points, the authors have decided to develop a bond graph toolbox using SIMULINK, which has two-fold functions. First is to simulate a bond graph model and second is to extract the symbolic dynamic equations in state space form in symbolic notations. The next section describes the development of simulation tool for bond graph model in SIMULINK. Extraction process of symbolic equations from the bond graph model in SIMULINK is discussed in Section 4. 3. Development of simulation toolbox 3.1. Formulation of simulation toolbox In SIMULINK, simulating a system is a two-step process. First is block diagram creation by using SIMULINK model editor. This graphically describes time-dependent mathematical relationships among the system inputs, states and outputs. Next, it simulates the system represented by a model from a specified start time to a specified stop time. In SIMULINK, to emulate bond graph elements, constitutive equations of each element are modelled in the form of block diagram. The equations are in terms of effort/flow according to the causality
BOND GRAPH—MODELLING AND SIMULATION
49
assigned to that particular element. Appendix 1 shows bond graph elements and its constitutive block diagram. Block diagram is masked by a respective bond graph element. The bond graph elements are divided in three parts, one-, two- and multi-port elements. Two new elements, switched power 0-junction or 0s-junction and switched power 1junction or 1s-junction are also introduced in the toolbox [22]. These elements aid in modelling of switching systems such as power electronic systems. The bond graph is in SIMULINK domain. In SIMULINK domain, the signal connection between two blocks transmit signal only in one direction. Therefore, to achieve cause–effect type signal flow, one has to connect two signal lines. One for cause signal from source to destination block and another is of effect signal. With such connections, bond graph system connected in such a manner would lose its bond graph appearance. For large bond graph model the case will get worse. This can be overcome by considering two distinct layers as shown in Fig. 1. One layer is the MATLAB workspace wherein all nontemporal computations are performed. The other is the SIMULINK space wherein all the time-domain computations are performed. The efforts and flows of the various bonds and at junctions are obtained from a data space, which is common to both the layers. The data space can be classified into four types, namely, effort and flows of bonds and effort and flow of junctions. Therefore, four global variables are defined in MATLAB layer, namely, effort, flow, junction effort (jun_eff) and junction flow (jun_flow). Effort and flow variables are arrays of size that equal the number of bonds. jun_eff and jun_flow variables are arrays of size equal to the number of junctions. Global variables are key factors in linking all bonds through the MATLAB layer. Further, it facilitates to probe any effort or flow value while simulation is running. The parameter entry in SIMULINK domain is divided into three parts, viz. one port, two port and multiport parameter entries. One port parameter entry contains bond number, numerical value of the one port element like R, C and L and junction number that it associated with. Two-port parameter entries contain bond numbers and value of the modulation parameter. Multiports are divided into two parts, i.e. conventional junctions and switching
FIG. 1. Data flow in two layers.
50
AMOD C. UMARIKAR et al.
power junctions. Conventional 1 junction data entry is junction number, flow decider bond number and other bond numbers, which decide the junction effort at the 1-junction. These effort decider bond numbers are entered with sign which is decided according to the power flow sign convention decided by the user. Similar data will be entered in 0-junction interchanging the role of effort and flow. The switching power zero junction and one junction contains an additional data entry. For example, in 1s-junction, there are multiple flow decider bonds whose flow will be junction flow at mutually exclusive instants of time. User has to enter flow decider bond numbers. Similarly, in 0s-junction, user has to enter the effort decider bond numbers. In this way, all the bonds get linked in SIMULINK through the MATLAB layer. In addition to four global variables, there is an additional global variable for switching systems. This variable is number of switching sets. In one switching set, there will be a number of switching inputs. This number will determine how many mutually exclusive switching are there in one switching set. Therefore different switching sets will have different numbers of switching inputs switching mutually exclusive in time. The parameter entry needed for each element in bond graph is shown in Appendix 2. The interaction between MATLAB and the SIMULINK layers is shown in Figs 2 and 3. The figures show block diagram form of one-port element. An example of integral causal C and conductive causal R is taken. Figure 2 is a structure of integral causal C element. There are four inputs to this element from the user. Junction number, value of C, initial condition and bond number are the inputs, which are shown in blocks named as input. First block ‘junction number’ gives input to the block named as extract junction flow, a MATLAB function that is in MATLAB layer. This will extract the junction flow from the global data space in MATLAB layer. Junction number is the number given to the junction, which is associated with C. If the bond associated with the 0/1 junction has causal bar near the junction, then its flow is the same as the junction flow. The extracted junction flow returns the value
FIG. 2. Block diagram of integral causal C-element.
BOND GRAPH—MODELLING AND SIMULATION
51
FIG. 3. Block diagram of conductive causal R-element.
to the SIMULINK layer. In SIMULINK layer, the extracted junction flow is then integrated to get the effort at the C. The block uses following equation to get the effort. effort =
1 ( junction flow)dt C∫
(1)
The effort value gets transferred to the MATLAB layer through MATLAB function. Bond number is another input from the user to the MATLAB function. In MATLAB layer, it gets assigned to the effort array in the global data space at the specified bond number (Fig. 2). Similarly to Fig. 2, all other one-port elements are treated in the same way. If the C-element has nonlinear characteristics, using different SIMULINK blocks, one can implement the nonlinear characteristics. These blocks will be in between ‘extracted junction flow’ block and ‘effort’ block for an integral causal C-element of Fig. 2. In Fig. 3, there is an extract junction effort block. This bond has the causal bar away from the junction. If the bond associated with the 0/1 junction has the causal bar away from the junction, then its effort is the same as the junction effort. The block diagram structure is the same as the previous one except the equation of R and interchange of effort and flow variables. Figures 2 and 3 give an idea about the data flow between SIMULINK and MATLAB layer for one-port elements. Similarly, two- and multiports are constructed with slight difference of inputs. Figure 4 shows a two-port element, an effort causal transformer. The multiplication of modulation index ‘m’ with the effort and flow takes place in MATLAB layer and the result gets stored in effort and flow array in the global data space. If modulation index is modulated then it is called ‘modulated transformer’ or ‘mTF’. Instead of giving fixed input block, input port has been provided to give variable modulation index. Similar to Fig. 4, other two-port elements like flow causal transformer and effort and flow causal gyrator with fixed and variable modulation index are implemented. Figure 5 shows the block diagram of the 1-junction element. The data which goes from to MATLAB domain of 1-junction is junction number, flow decider bond number
SIMULINK
52
AMOD C. UMARIKAR et al.
FIG. 4. Block diagram for effort causal transformer element.
and other associated bond numbers with appropriate signs. According to the property of 1junction, flow at all bonds associated with 1-junction is the same as that of the flow decider bond at that junction. This is also the junction flow. The effort on flow decider bond is summation of all other bonds associated with the junction, i.e. junction effort. In MATLAB domain, efforts and flows are assigned to the bonds associated with the 1-junction according to the above property. Figure 6 shows the block diagram of a 0s-junction [24]. The information that the user has to provide is the same as 0-junction except that the number of effort decider bonds is more than one in 0s-junction. The effort decider bond numbers are given in sequence in which
FIG. 5. 1-junction block diagram.
BOND GRAPH—MODELLING AND SIMULATION
53
FIG. 6. 0s-junction block diagram.
the effort gets applied on the 0s-junction. The switching set number decides proper switching sequence set for the given switched power junction. The rest of the information is the same as conventional 0-junction. Figures 2–6 give idea about the block diagram construction of each bond graph element. The switching of effort at 0s-junction and switching of flow at 1s-junction is controlled by another block created called ‘ucontrol’. 0s- and 1s-junction element and ucontrol block are internally linked through MATLAB layer. Input to the ucontrol determines when and in what sequence to switch the effort/flow at switched power junctions. Effort and flow probe blocks are provided to probe the effort and flow at any bond. In this way, the bond graph model can be assembled in the SIMULINK Graphic User Interface. After assembling bond graph, specified numerical integration algorithms perform simulation directly in the SIMULINK. The simulation results can be accessed using various ‘sink’ blocks in SIMULINK either during simulation or after simulation according to sink block used. 3.2. Discussion The simulation toolbox can simulate bond graph model with linear as well as nonlinear elements. User has to pay attention only towards the proper entry for each element. SIMULINK uses its own numerical algorithms to simulate the bond graph model. System with any number of bonds can be simulated with the toolbox. However, as the number of bonds increases, the speed of the simulation becomes less. This is due to the use of interface of MATLAB domain and SIMULINK. This can be overcome by using S-functions in SIMULINK. Further n-port L, C, LC and R elements are not currently implemented in the simulation toolbox. These points are the issues of further development.
54
AMOD C. UMARIKAR et al.
4. Development of symbolic equation extraction toolbox Bond graph displays the form of state space equation explicitly. These equations can be used for numerical simulation of the system. Simulation toolbox discussed above does the same implicitly. Further, if one gets dynamic equations in symbolic form from bond graph, one can analyze and design the system. The symbolic computation from bond graph was proposed in [23, 24] which used MATHEMATICA as symbolic processing engine. The authors used the symbolic math toolbox to extract dynamic equations from the bond graph entered in SIMULINK. Symbolic math toolbox provides facility for symbolic computation in MATLAB environment. As in bond graph model simulation tool, here also MATLAB function links all the bonds. All symbolic computations take place in MATLAB domain. The data for symbolic computation comes from SIMULINK domain. The solution is obtained in terms of state variables. Symbolic toolbox provides different modules which solve algebraic equations, differential equations, etc. The module, which solves algebraic equations, is used here. The algebraic equation solver needs the equations and the number of variables. The program is written in such a way that it will form the equation array and array of variables according to the number of bonds. Symbolic math code is written for each bond element. This function gets executed in SIMULINK through MATLAB function, which forms equations for bonds. The equation for each bond and variables associated with it gets stored in the equation array and array for the variables, respectively. Furthermore, the equation which defines the relation among the different bonds is formed through junction rules. For each bond, there are four variables associated, i.e. effort, flow, differential effort (diff_effort) and differential flow (diff_flow). Two new variables diff_effort or ‘de’ and diff_flow or ‘df’ is introduced to handle the cases where differential causality of storage element occurs. Take an example of two inductors in series. In this case one inductor will have differential causality. That is only one inductor will decide the flow, while the second inductor will have the same flow as decided by the first. This can be written as V = L1
diL1 di + L2 L 2 dt dt
(2)
where V is voltage applied across two inductors. While formulating the equation one has to take differential of the flow in inductor 1 equal to differential of the flow in inductor 2 as diL 2 diL1 = dt dt
Q iL 2 = iL1 .
(3)
This will define the redundancy of flow of the second inductor. Further, state space equation of appropriate order will be formed. The same case can be applied for capacitors in parallel. Note here that the solution is in terms of state variables. Therefore, bonds belonging to storage elements will not have the corresponding variable in the variable array. For example, capacitor will not have effort and inductor will not have flow in the variable array. Finally, the display is arranged in the form of state space equations which shows A, B, C, and D matrices. In case the system does not have state variables, only matrix D will be displayed.
BOND GRAPH—MODELLING AND SIMULATION
55
The simulation schematic itself can be used for the equation extraction toolbox. The bond graph elements are divided into three parts—one, two and multiports. As an example of one-port element, the equation forming for integral causal capacitor is shown in Fig. 7. The block diagram shows how the data about the bond gets transferred to the MATLAB domain and how it then forms the equation in terms of flow and de with the subscript of the bond number. At the junction elements, equation forms are in terms of variables de, df, e and f. For example, at 1-junction, it forms n-1 flow equations, if n numbers of bonds are associated with it. The number is n-1 obviously because at 1-junction one bond is a flow decider. The other equation is effort equation representing Kirchoff’s Voltage Law (KVL). In this way, equation and variable gets formed and get stored in equation and variable array. Figure 8 shows this in the block diagram form. After equation and variable arrays are formed, algebraic solver processes it and gives solution. One ‘.m’ file is written to display the solution in the state space format. In this way, using the power of symbolic computation for bond graph gives powerful tool for analysing the system prior to simulation. The symbolic tool box is designed to extract equations from bond graph model which consists of only linear elements. Symbolic equation extraction from the bond graph which contains nonlinear elements is a further issue of development. An example of the use of symbolic toolbox in the bond graph model is discussed in the next section. 5. Examples The examples of the simulation and symbolic equation extraction of the bond graph model are discussed in this section. Examples of the electrical systems and electromechanical system are illustrated. In the electrical system, the example of power electronic DC–DC converter, which includes the use of switched power junctions, is discussed. An example of separately excited DC machine is taken to illustrate the multidomain modelling.
FIG. 7. Block diagram of C-element for symbolic computation.
56
AMOD C. UMARIKAR et al.
FIG. 8. Block diagram form of the 1-junction for symbolic computation.
The R-L-C series circuit with a DC-voltage source is shown in Fig 9. Its bond graph model in SIMULINK is shown in Fig. 10. The dynamic equations, which are extracted symbolically, are shown in Fig. 11. These equations get extracted in MATLAB window. The snapshot of this window is shown in Fig. 11. The equations in Fig. 11 are rewritten in eqn (4) for clarity. dX = AX + BU dt Y = CX + DU
(4)
where R1 dI L1 − L dX dt 1 = , A = dt dVC1 1 dt C 1
−
1 1 L1 , B = L1 0 0
FIG. 9. RLC series circuit.
BOND GRAPH—MODELLING AND SIMULATION
57
FIG. 10. Bond graph model entered in SIMULINK.
f I 1 0 0 Y = 2, C = , D = , X = L1 , U = Se1 0 1 0 e4 VC1 f2, i.e. flow in bond 2, and e4, i.e. effort on bond 4 are the output the authors have chosen for Y. Any number of outputs can be chosen for Y. The simulation result is shown in Fig. 11. The value of R is 2 ohm, L is 1 mH and C is 100 µF. The DC voltage source is of value 10 V. The simulation shows the transients response in voltage of capacitor and current in inductor when dc voltage gets applied. Switches are inherent part in almost all of the power electronic systems. To model power electronic systems in bond graph, modelling of switching phenomenon is required. The authors used switched power junctions to model the switching phenomena. An example of boost converter is taken to illustrate modelling of power electronic systems [25]. Figure 13 shows boost converter circuit, which shows two single pole single throw (SPST) switches with their semiconductor counterparts. Figure 14 shows bond graph model entered in SIMULINK. Simulation results are shown in Fig. 15. Simulation shows transient response of the inductor current and the capacitor voltage. The values are taken as R = 15 ohm, L = 1 mH, C = 100 µF, fs = 10 kHz, D = 0.5 and V1 = 10 V. – The extracted dynamic equations of the circuit are shown in Fig. 16. U and U (Ubar in the symbolic extraction toolbox) are control signals which control the switching. The output equation specified is effort on bond 3 and flow in bond 5, which includes switching signal components. The equations in Fig. 16 are rewritten in eqns (5). dX = AX + BU dt
58
AMOD C. UMARIKAR et al.
FIG. 11. Dynamic equations of bond graph model in symbolic form for RLC circuit.
Y = CX + DU where dI L1 0 dX dt = , A = U dt dVC1 dt C1 U f Y = 5, C = e3 0
U 1 L1 , B = L1 1 0 − R1C1 −
0 I L1 0 , D = , X = , U = Se1 . −U 0 VC1
(5)
This example illustrates the usefulness of toolbox for modelling of switching systems. The systems in other domains which include switching phenomena can also be modelled using the toolbox.
FIG. 12. Simulation results of RLC circuit bond graph model.
BOND GRAPH—MODELLING AND SIMULATION
59
FIG. 13. Boost converter.
The example of RLC series circuit bond graph model with two inductors in series is shown in Fig. 17. This illustrates an example of system where storage element has differential causality. The equation extraction toolbox accommodates the facility of handling such cases. The equations extracted are shown in Fig. 18. The output equation specified is of effort on derivative causal inductor, i.e. bond 5 and flow in bond 2. The equations in Fig. 18 are rewritten in eqn (6). dX = AX + BU dt
FIG. 14. Bond graph model of boost converter entered in SIMULINK.
60
AMOD C. UMARIKAR et al.
FIG. 15. Boost simulation waveform.
Y = CX + DU where R1 dI L1 − L + L dX dt 1 2 = , A = 1 dt dVC1 dt C1
−
1 1 L1 + L2 , B = L1 0 0
FIG. 16. Dynamic equations of bond graph model in symbolic form for boost converter.
BOND GRAPH—MODELLING AND SIMULATION
61
FIG. 17. RLC circuit bond graph model with two inductors in series.
1 f Y = 2 , C = R1 L2 − L1 + L2 e5
0 −
L1 L1 + L2
0 0 , D = L1 , D = L2 , X = S e1. L1 + L2 L1 + L2
FIG. 18. Extracted dynamic equation of RLC series circuit with two inductors in series.
(6)
62
AMOD C. UMARIKAR et al.
FIG. 19. Separately excited dc machine.
Figure 19 shows separately excited DC motor, which is taken as an example of multidomain system. The load is rotational which can be considered as a disc. The bond graph model entered in SIMULINK is shown in Fig. 20. Simulation results are shown in Fig. 21. It shows armature current and speed at the starting of the motor. At the starting, the input voltage is given in the form of ramp till the rated voltage is achieved. The ratings of the motor are Rated voltage = 460 V, Rated current = 690 A, Rated power = 300 kW, Base speed = 500 rpm = 52.4 rad/s, Full load torque = 5730 Nm, Moment of inertia = 84 kg m2 = 824 Nm2, Back emf constant = 8.5 Vs/rad, Armature resistance = 0.0234 Ω and Armature inductance = 0.7026 mH. Figure 22 shows extracted symbolic equations. J1 is rotary inertia of the motor, Z1 is rotary resistance, and K1 is gyrator coefficient. The output equation shows effort at bond 4 and flow at bond 5. The equations in Figure 22 are rewritten in eqn (7). dX = AX + BU dt Y = CX + DU where R1 dI L1 − L dX dt 1 = , A = K1 dt d ω1 dt J1
FIG. 20. Bond graph entered in the SIMULINK.
K1 1 L L1 , B= 1 Z1 0 J1
−
0 1 − J1
BOND GRAPH—MODELLING AND SIMULATION
63
FIG. 21. Simulation result which shows armature current and speed at the starting of the motor.
f 0 1 I S 0 0 Y = 5, C = , D= , X = L1 , U = e1 . 0 0 e4 0 K1 ω1 Se 2
(7)
The examples above are discussed to show the overall scope of the toolbox. With this toolbox, the new dimension of simulating bond graph models in MATLAB/SIMULINK is achieved. 6. Conclusion The development process of bond graph toolbox created using MATLAB/SIMULINK is described in this paper. The toolbox has two-fold function. The first is simulating the model and the second is extracting the dynamic equations in the symbolic form. Both MATLAB and SIMULINK domains are used to construct the toolbox. MATLAB functions are used to compute the nontemporal values and SIMULINK tools are used to compute the temporal values. A global data space is used as the interface between both the domains.
FIG. 22. Extracted dynamic equations of the separately excited dc machine.
64
AMOD C. UMARIKAR et al.
Further, a symbolic equation extraction toolbox is made using symbolic math toolbox of which is linked to SIMULINK through the MATLAB functions. This toolbox extracts state space equations from any graphical bond graph model in symbolic form. Though not included, the symbolic toolbox can be used for further computations like getting transfer function, solution of equation in time domain form from the state space equations, etc. The toolbox thus can be a good tool to study dynamic systems in academic environment where MATLAB/SIMULINK is a primary tool.
MATLAB,
Appendix 1 Bond graph elements with their constitutive block diagrams Sl. no.
Element
Port
1.
Effort source One
2.
Flow source
One port
3.
Conductive causal R
One
4.
Resistance
One
5.
Integral causal inertia
One
SIMULINK Block diagram
Mask in SIMULINK
contd…
65
BOND GRAPH—MODELLING AND SIMULATION
Bond graph elements with their constitutive block diagrams Sl. no.
Element
Port
6.
Differential One causal inertia
7.
Integral One causal capacitor
8.
Differential One causal capacitor
9.
Effort causal Two transformer
10.
Flow causal transformer
11.
Effort causal Two gyrator
12.
Flow causal gyrator
SIMULINK
Block diagram
Mask in SIMULINK
Two
Two
contd…
66
AMOD C. UMARIKAR et al.
Bond graph elements with their constitutive block diagrams Sl. no.
Element
Port
13.
1-Junction
Multi
14.
0-Junction
Multi
15.
1s-Junction
Multi
16.
0s-junction
Multi port
SIMULINK
Block diagram
Mask in SIMULINK
The names below the block ‘MATLAB function’ indicate the .m file name in MATLAB domain, which does the function of assigning and obtaining data from global data space and does data processing in MATLAB layer.
BOND GRAPH—MODELLING AND SIMULATION
Appendix 2 The following table gives parameter entries for each bond element in toolbox Sl no. 1.
Element
Ports
Parameters to be entered
Effort source
One
2.
Flow source
One
1. 2. 1. 2.
Bond number Effort value Bond number Flow value
3.
Conductive causal R
One
4.
Resistance
One
5.
Integral causal inertia
One
6.
Differential causal inertia
One
1. 2. 3. 1. 2. 3. 1. 2. 3. 4. 1. 2. 3.
Bond number Junction number with which it is associated Resistance value Bond number Junction number with which it is associated Resistance value Bond number Junction number with which it is associated Inertance value Initial condition Bond number Junction number with which it is associated Inertance value
7.
Integral causal capacitor
One
1. 2. 3. 4.
Bond number Junction number with which it is associated Capacitor value Initial condition
8.
Differential causal capacitor
One
9.
Effort causal transformer
Two
1. 2. 3. 1. 2.
Bond number Junction number with which it is associated Capacitance value Bond numbers Value of modulation index, m
10.
Flow causal transformer
Two
11.
Effort causal gyrator
Two
12.
Flow causal gyrator
Two
1. 2. 1. 2. 1. 2.
Bond numbers Value of modulation index, m Bond numbers Value of modulation index, m Bond numbers Value of modulation index, m
13.
1-Junction
Multi
14.
0-Junction
Multi
15.
1s-Junction
Multi
16.
0s-junction
Multi
1. 2. 3. 1. 2. 3. 1. 2. 3. 4. 1. 2. 3. 4.
Junction number Flow decider bond Effort decider bonds along with sign Junction number Effort decider bond Flow decider bonds along with sign Junction number Number of switching sets it is associated with Flow decider bonds in switching order Effort decider bond numbers along with sign Junction number Number of switching sets it is associated with Effort decider bonds in switching order Flow decider bonds along with sign
67
68
AMOD C. UMARIKAR et al.
References 1. G. F. Franklin, J. D. Powell, and A. Emami-Naeini, Feedback control of dynamic systems, Pearson Education Asia (2002). 2. B. C. Kuo, Automatic control systems, 7th edn, Wiley (1995). 3. Jean Thoma, and H. Jürgen Halin, Bond graphs and practical simulation, Simulation Practice Theory, 7, 401–417 (1999). 4. Margolis Donald, Bond graph, modelling and simulation in industry: Some examples where costly mistakes could have been avoided, IEEE Int. Conf. Systems, Man and Cybernetics, Vol. 3, pp. 6–9 (2002). 5. Mathworks Inc., www.mathworks.com 6. D. C. Karnopp, and R. C. Rosenberg, System dynamics–A unified approach, Wiley Interscience (1975). 7. A. Mukherjee, and R. Karmakar, Modelling and simulation of engineering systems through bond graphs, Narosa (2000). 8. Enport website http://www.egr.msu.edu/~rosenber/ENPORT/ 9. Michael K. Hales and Ronald C. Rosenberg, Export model builder: An improved tool for multiport modelling of mechatronic systems, ICBGM-2001 (2001). 10. CAMP-G, website www.bondgraph.com 11. Jose J. Granda, Computer generated block diagrams from bond graph models. CAMP-G as a toolbox for SIMULINK, ICBGM-2001 (2001). 12. Yves Piguet, Jose J. Granda and Gianni Mocellin, CAMP-G/SYSQUAKE, an integrated environment to understand dynamic systems and design controllers, ICBGM-2001 (2001). 13. Jose J. Granda, The CAMP-G/MATLAB-SIMULINK computer generated solution of bond graph derivative causality, ICBGM 2003, pp. 161–172 (2003). 14. 20-sim website: www.20sim.com 15. Jan F. Broenink, 20-sim software for hierarchical bond graph/block-diagram models, Simulation Practice Theory, 7, 481–492 (1999). 16. Francois E. Cellier and Robert T. McBride, Object-oriented modelling of complex physical systems using the Dymola bond graph library, ICBGM-2003, pp. 155–160 (2003). 17. Francois E. Cellier, The Dymola bond graph library, http://www.ece.arizona.edu/~cellier/BondLib.mo (2001). 18. SYMBOLS-2000 website, www.symbols2000.com 19. Amalendu Mukherjee and A. K. Samantray, System modelling through bond graph objects on SYMBOLS2000, ICBGM, 2001 (2001). 20. Bond graph softwares, http://www.bondgraphs.com/software.html 21. Jenny Montbrun-Di Filippo and Marisol Delgado, A survey of bond graphs: Theory, applications and programs, J. Franklin Inst., 328, 565–606 (1991). 22. Amod C. Umarikar and L. Umanand, Modelling of switching systems in bond graphs using the concept of switched power junctions, J. Franklin Inst., 342, 131–147 (2005). 23. Paul J. Nolan, Symbolic and algebraic analysis of bond graphs, J. Franklin Inst., 328, 1027–1046 (1991). 24. Nicolas Venuti, Bond graph empowered by Mathematica, ICBGM-2001 (2001). 25. Amod C. Umarikar and L. Umanand, Modelling of switched mode power converters using bond graph, IEE Proc. on Electric Power Appl., 152, 51–60 (2005).