You are on page 1of 16

Simulation Modelling Practice and Theory 12 (2004) 6176 www.elsevier.

com/locate/simpat

Simulink and bond graph modeling of an air-conditioned room


B. Yu *, A.H.C. van Paassen
Energy in Built Environment, Energy Technology, Delft University of Technology, Delft, The Netherlands Received 6 May 2002; received in revised form 24 December 2002; accepted 23 December 2003

Abstract Dynamic models of the heating, ventilation and air-conditioning (HVAC) systems in the building are very useful for controller design, commissioning, and fault detection and diagnosis. Dierent applications have dierent requirements on the models and dierent modeling approaches can be applied. Mathematical modeling with two dierent approaches, block-wise Simulink and bond graph, is discussed. Advantage and disadvantage of both approaches are expressed. It is shown that combination with two approaches to realize complicated models of building HVAC system for the application of model-based fault detection and diagnosis is a good solution. 2004 Elsevier B.V. All rights reserved.
Keywords: Bond graph; Simulink; Air-conditioned room; Modeling; Fault detection; Diagnosis

1. Introduction A signicant amount, as much as 30%, of all energy consumed by commercial buildings in the US is related to inecient and improper operation of building equipment [1]. It is from the inability to optimally control, maintain, detect and diagnose problems with the buildings and their systems, e.g. HVAC and others. Many of these problems are often ignored or left unresolved because building sta and operators lack the enough information to address them. Model-based fault detection and diagnosis (FDD) is a good solution to handle this problem [5] and general modeling concept has been raised to hierarchically realize

Corresponding author. Tel.: +31-15-2786662; fax: +31-15-2787204. E-mail address: bing.yu@wbmt.tudelft.nl (B. Yu).

1569-190X/$ - see front matter 2004 Elsevier B.V. All rights reserved. doi:10.1016/j.simpat.2003.12.001

62

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

FDD [6]. However, real buildings are diverse from each other. They have dierent properties like sizes, locations and materials, etc. This puts higher requirement for the models. The contents of a model depend on the application context for which it is intended. As a consequence, models cannot easily be reused and exchanged. At present, eciently constructing high-quality models requires special skills and experience. Computer support is only available at the computational and mathematical level. Every model has to be built from scratch, which means that modeling is very labor and cost intensive and error prone. Nevertheless, reusing and exchanging models between applications is possible since we accept a certain degree of similarity, to guarantee an adequate answer (an exact answer is hardly ever required). Moreover, by complying with basic domain principles a certain level of condence can be guaranteed without full validation, with respect to measured data. Provided that we acknowledge the underlying assumptions for a particular modeling problem, models may be partially reapplied in dierent situations. This means that for reuse of models the following requirements have to be fullled: Models have to be constructed in a modular way. The model fragments should be pluggable: they can be substituted solely by respecting their interfaces (rather than their contents). The model construction process is to be controlled by the application: model selection must be controlled by assumption, i.e. explicit modeling experience. Hiding complexity. The simulation code is to be generated rather than hand crafted, internal details are normally not shown. Modeling should occur at the conceptual rather than computational level. Engineering and design phases are becoming dominant cost factors in the industrial production cycle. This is particularly true for the automotive industry. Therefore, in the early 1990s a number of European industries and research institutes initiated the OLMECO project. The aim of the project was to conceive and construct an Open Library for models of Mechantronic COmponents. A rather unconventional view of modeling was developed in the project [4]. Its core was the bond graph modeling language for physical systems. Two simulation methods, block-wise Simulink and bond graph, are two interesting tools for modeling. Simulink is a software package of Matlab for modeling and simulating dynamical systems in academia and industry. It uses graphic user interface (GUI) for building models as block diagrams and adopts click-and-drag mouse operations. Nowadays, lots of toolboxes are available in Simulink. Bond graph is a systematic way to represent power interactions between the models components. IMMS [7], whose core concept is bond graph approach, is used to realize the modeling process. Bonds, the connection lines between dierent components, carry both power variables and causalities between power variables. Paynter [2] started the bond graph technique and used for modeling dynamic multiport systems. This approach adopted circuit diagram concept to develop a general theory for engineering system. It suggested that energy and power are the fundamental dynamic variables

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

63

which represent all physical interactions and transactions. Rosenberg and Karnopp [3] expressed the theoretical basis and denitions of the method. From then on, bond graphs become a good modeling tool for dierent kind of dynamic systems. Pseudo-thermal bond graph method is used. The pseudo-thermal bond graph below represents a heat storage process
C

The constitutive relation of the C element is T Q C

where T is the pseudo-thermal eort temperature [K], Q is the pseudo-thermal state heat [J] and C m c where C is the heat capacity [J K1 ], c is the material parameter specic heat capacity [J K1 kg1 ], which depends on the material selected by the modeler and mq V where m is mass [kg], q is material parameter density [kg m3 ], which, like specic heat capacity c, depends on the material chosen by the modeler and V is geometric parameter volume [m3 ], which must be specied by the modeler or depends on the standard geometry chosen by the modeler. For the heat conduction process the following bond graph is appropriate
R

The 1 junction represents eort dierence, in this pseudo-thermal case, temperature dierence. The constitutive relation of the R element is T R 0 where Q is the pseudo-thermal ow heat ow [J s1 ], T is the pseudo-thermal eort temperature [K] and Q0 R l k A

where R is the resistance [K s3 m2 kg1 ], l is geometric parameter length [m], k is material parameter heat conduction coecient [m kg s3 K1 ] and A is geometric parameter area [m2 ], which, like length l, must be specied by the modeler or depends on the standard geometry chosen by the modeler.

64

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

Dierent applications ask dierent requirements on modeling. Some applications require simple model and less quantitative results and some other applications require more accurate and complicated model. Some models are only used for specic applications and some models need higher exibility and reusability. The real buildings are diverse but with some similarity. In order to build up model-based fault detection and diagnosis, the models with higher reusability and good communication with Building Management System (BMS) are necessary. In this paper, two modeling approaches are studied to analyze the dierences. 2. Modeling analysis on an air-conditioned room A typical room, no. 104, in an oce building is analyzed. The scheme of this oor is shown in Fig. 1. The northeast and northwest walls insulate the room and outside environment. The southeast and southwest walls separate the room with the neighbors. Scheme of the fundamental air-conditioning components in the room, e.g. insulation (walls), zone (air), heating (radiator), cooling ceiling and window system (shutters and windows) is shown in Fig. 2. Following are the modeling analyses for these components with Simulink and bond graph approaches. 2.1. Walls All walls, oor and ceiling form the insulation system of the room. Lumped parameter assumption is usually adopted for insulation models. This is realized by splitting the wall into some layers. In each layer, the parameters, like temperature, properties, are the same. Since the parameters are actually dierent, the more layers the wall is split, and the closer the model is to the reality. However, too many layers make the models more complicated and lower simulation speed. It is a trade-o.

Fig. 1. Scheme of the oor of room 104.

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

65

Fig. 2. Scheme of fundamental air-conditioning components of room 104.

A typical wall and its division are shown in Fig. 3. Electrical RC analysis chart for this wall is as follow. The equations of inner and outer surface temperatures has the form as X dTio 0:5qV Aqsolar ar Fshutter;j Aj Tj Tio ac ATair Tio dt j X
i

k as Fradiator;j Aradiator Tradiator Tio A Tio T1 d

The equations of each layer has similar form as k T T1 dT1 aTin T1 D 1 2 i1 dt 0:5qcd1

Ti T1 T2 Tn-1 Tn

To

Fig. 3. Typical wall and its division.

66

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

d Ti dt

k
D i

k Ti1 Ti D T Ti i1 i1 0:5qcdi 0:5qcdi1

i 2; . . . ; n 1

k T Tn dTn aTout Tn D n n1 dt 0:5qcdn

in

Simulink block representation for Fig. 4 with four layers is shown in Fig. 5 and for each layer is shown in Fig. 6. From the view of bond graph, the wall has radiation heat exchange with the other walls and radiator. Meantime, all layers are constructed with storage, conduction and power summation. Bond graph representation for the same wall is shown in Fig. 7.
1/ T1 / T2 C2 / Tn-1 / Tn 1/ T o Cn-1 Cn

Ti

C1

Fig. 4. Electrical RC analysis chart for the wall.

2 Trad

Trad . Trad. Ti Ti T1 Ti T2 T1 T2 T1 T2 T3 Tou t To alf a&q _s ola r alfa&q_solar

1 Ti

layer1

layer2

2 To

layer3 1 Tout 3 W&qz

gasbet.sierbet.1

Mux Mux

f(u) Fcn

3 Qrad

Fig. 5. Simulink block representation for a wall.

1 T1 Sum1
2 T3

-Kk1
-K-

k1

1/s Int

Sum3

1 T2

Sum2

k 3

Fig. 6. Simulink block for certain layer.

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

67

2 Layer Wall Heat Storage Heat Conduction Heat Storage Heat Conduction Heat Storage

Fig. 7. Bond graph structure for a two layer wall.

Fig. 8. StorageConduction module.

In Fig. 7, the bond relations are represented with some standard modules from library. This is useful for reusable modeling. All these modules are fundamental bond graph composition. For example, StorageConduction module is shown in Fig. 8. In the gures, the symbols of and P are connection plugs that use to split a bond into two parts. 2.2. Room air Room air has considered as a lumped parameter. Its state is determined by many other thermodynamic relations, e.g. heat exchanges with walls, radiator, shutters, windows, cooling ceiling and so on. For the mathematical equation of room air model, all heat exchanges should be included to make the equation achieve energy conservation qair cp;air V dTa Qinf :in Qinf :out acon:s:r: As:ne: Ts:ne: Ta dt acon:s:r: As:se: Ts:se: Ta acon: Ane Tne Ta acon: Ase Tse Ta acon: Asw Tsw Ta acon: Anw Tnw Ta acon: Afl Tfl Ta acon: Acei Tcei Ta acon: Adoor Tdoor Ta acon: Agl:dr: Tgl:dr: Ta acon: Acol Tcol Ta Qcool Qintern Qwarm Qh Qhr 5

68

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

Simulink realizes the mathematical equations directly. All heat exchanges are treated as inputs of integration. Fig. 9 shows the Simulink component model for room air. For the bond graph modeling, power information (temperature, heat ow rate) are inside the bonds. After the bonds are connected from room air node to the other components, the thermodynamic relations are modeled in the meantime. Therefore, the bond graph node model of room air is very simple as Fig. 10.

Fig. 9. Simulink model of room air.

Fig. 10. Bond graph node model of room air.

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

69

2.3. Heating system Heating system is realized by radiator. By means of adjusting the opening rate of hot water valve, heating capacity added into room is controlled. Supposing the lumped temperature of radiator is the average of inlet and outlet water temperature. Analyzing the control domain of radiator in Fig. 11. Q is the total energy exchanges include radiation heat exchanges to all solid surfaces (walls, ceiling, oor, windows, etc.) and convection heat exchange to the room air. Mathematical equations of radiator are dTR _ w Cw Tw;in Tw;out Q Cw Mw m 6 dt Q AR aTR Ta QR;wall 7

_ w depends on the valve-opening rate that is controlled with The mass ow rate m proportion strategy. Simulink model of radiator is shown in Fig. 12. Like room air node, the bond graph model of radiator is relatively simple as follow, Fig. 13. 2.4. Cooling system In the summer days, cooling system is necessary. It is the cooling ceiling. Cooling ceiling has two functions. One function is cooling-down the recycle air. Another
Tw,in Tw,out

Q
Fig. 11. Control domain of radiator analysis.

2 mass flow 1 Twater in 4 Tair Mux Mux1 3 Qrad total f(u) conv. coef Saturation1 Mux f(u) Fcn 1 s Integrator Low-Pass Filter with Initiate LPFI 1 T rad.

1/7 Gain1 Mux

f(u) Qr.convection

7 Gain2

2 Qr.conv

Fig. 12. Simulink model of radiator.

70

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

Fig. 13. Bond graph model of radiator.

function is supplying fresh air from outside. There is almost no capacity to accumulate energy at cooling ceiling node. Main thermodynamic process is heat exchange. The amount of heat exchange is QC Qrecycle Qfresh Qrecycle Ta Tw cfactor1 factor2L Qfresh Gfresh qCp Ta Tfresh L 8 9 10

This cooling capacity will add into room air. In Eq. (9), c is controlled by the difference between setpoint and real room air temperature. When the temperature of the room is lower than setpoint, no ow in the tube and c will be zero. 2.5. Window system Window system includes windows and shutters. Solar energy enters room through windows and shutters. Due to the distribution eect, the solar energy will be absorbed by all the surfaces. Since the capacity of glasses and shutters are small, the heat transfers are instant in the nodes of windows and shutters. This means they are algebraic equations. For window, shutter and the air in-between window and shutter, the node equations are as follow aout Tout Tglass aa Ta;between Tglass qsolar 0 aa Tglass Ta;between aa Tshutter Ta;between ainfiltration Ta Ta;between 0 11 12

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

71

aa Ta;between Tshutter aa Ta Tshutter


4 4 reTradiator Tshutter qsolar 0

4 4 reTwall Tshutter

13

Simulink models of these components are shown in Fig. 14. Bond graph structures for these components and sub-structures of shutter, window and the air inside the channel are shown in Fig. 15 and Figs. 1618. In these gures, the real bond graphs are inside each pluggable block to make the modeling reusable.

1 W&qz

Demux Demux 2 Ta 4 Tw 3 Tr

Mux

f(u) Fcn

f (z)

Solve f(z) = 0

1 Tb a

Algebraic Constraint

Mux

5 To
W Alf a o

Mux

f(u) Fcn1

f (z)

Solve f(z) = 0

Algebraic Constraint1

Alfa out

Mux1

Mux

f(u) Fcn2

f (z)

Solve f(z) = 0

2 Ta a

Algebraic Constraint2

Mux2

Fig. 14. Simulink models of window and shutter system.

Fig. 15. Bond graph structure of window and shutter system.

72

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

Fig. 16. Bond graph structure of shutter.

Fig. 17. Bond graph structure of the air between shutter and window.

Fig. 18. Bond graph structure of window.

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

73

2.6. Example results After building the models, the simulation can be fullled. Fig. 19 shows the room temperature results for 11 days and Fig. 20 shows the temperature dierence of Fig. 19. It shows the model can simulate the reality properly.

23 22 21 Temperature ( oC) 20 19 18 17 16 15 0 50 100 150 Time (h) 200 250 300 measured data model output

Fig. 19. Example result of the simulation of room temperature.

5 4 3 2 Temperature (oC) 1 0 -1 -2 -3 -4 -5 0 50 100 150 Time (h) 200 250 300

Fig. 20. Temperature dierence between measurement and model output.

74

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

3. Comparison between Simulink and BG modeling Simulink and bond graph modeling use dierent ways to realize the simulation. The comparison between these two methods has been made as follow: Simulink Use mathematical modeling concept Realize the mathematical equations and relations with block diagram. Its a direct expression for the mathematical models The rst step of Simulink modeling is trying to list the corresponding mathematical equations for all sub-domains after physical assumption. For each subdomain, analyzing the energy conservation of the control domain to obtain the mathematical equations The temperature and heat ow calculations are modeled separately. Sometimes, this will cause modeling bugs of non-balance of energy in the models Bond graph Use physical modeling concept Realize the physical meanings and relations with bond

The rst step of bond graph modeling is analyzing the physical relationship among the sub-domains. For each sub-domain, determine the 0-, 1-junction, corresponding C -, R-elements and suitable connection plugs

Simulink is easier to realize some mathematical tricks and assumptions since it directly realize the mathematical equations Simulink integrates a lot of tool box for mathematical analysis, e.g. signal process, fuzzy logic, neural network and so on

With pseudo-thermal BG modeling, temperature and heat ow calculations are modeled in the meantime. Inside a bond, the temperature and heat ow are exchanged simultaneously. The bonds will always keep the energy balance. Bugs of non-balance of energy will be avoided Bond graph models are easier to understand the physical relation between components No toolbox available

Bond graph models can be realized as a block (like Matlab function or S -function) of Simulink models. So that it can take advantage of the Simulink toolbox to realize more complicated functions. Because two modeling methods have their own advantages and disadvantages, the combination with them would be a good solution. By means of bond graph method, models that directly represent the physical relation are made. Then the BG models will be translated into S -function of Simulink. Combined with the toolbox in Simulink, more functions like control, fuzzy

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

75

Physical relation analysis

Bond Graph modelling

Simulink block

s-function y=f(x,u) generation final simulation model

Fig. 21. Suggested way of modeling combined with Simulink and bond graph.

logic, neural network algorithm can be easily realized. The owchart is shown in Fig. 21.

4. Conclusions Model-based fault detection and diagnosis technology is a possible solution to decrease the energy consumption in building HVAC system. Dierent applications have dierent requirements on the models and dierent modeling approaches can be applied. Reusability is an important characteristic for the model of building that applied for model-based FDD. By developing the modeling procedure, models of an air-conditioned room in oce building are built in two approaches, block diagramwise Simulink and bond graph. The comparison between two methods is made. Combination with two methods is a suggested way to build the models for fault detection and diagnosis in building HVAC system.

Acknowledgements This paper is written within the framework of Ecoview project (BTS97252) sponsored by Dutch Senter organization and with close cooperation with ing. H. Rijgersberg and Prof. J.L. Top of A&F BV.

References
[1] S. Katipamula, M. Brambley, Automated diagnostics: improving building system and equipment performance energy user news 23 (4) April 1998. [2] H.M. Paynter, Analysis and Design of Engineering Systems, MIT Press, Cambridge, Mass, 1961. [3] R.C. Rosenberg, D.C. Karnopp, Introduction to Physical System Dynamics, McGraw-Hill, 1983. [4] A.P.J. Breunese, J.L. Top, J.F. Broenink, J.M. Akkermans, Libraries of reusable models: theory and application, Simulation 71 (1) (1998) 722.

76

B. Yu, A.H.C. van Paassen / Simulation Modelling Practice and Theory 12 (2004) 6176

[5] B. Yu, A.H.C. van Paassen, State-of-the-art of energy fault diagnosis for building HVAC system, in: International Symposium of Air Conditioning in High Rise Buildings 2000, Shanghai, China, October 2000. [6] B. Yu, A.H.C. van Paassen, S. Riahy, General modeling for model-based FDD on building HVAC system, Simulation Modelling Practice and Theory 9 (68) (2002) 387397. [7] H. Rijgersberg, J.L. Top, HVAC library modeling in IMMS, EcoView Progress Report 1.1, ATODLO, June 1999.

You might also like