WetterHaugstetter 2006

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

MODELICA VERSUS TRNSYS – A COMPARISON BETWEEN AN

EQUATION-BASED AND A PROCEDURAL MODELING LANGUAGE FOR


BUILDING ENERGY SIMULATION

Michael Wetter and Christoph Haugstetter


United Technologies Research Center
411 Silver Lane
East Hartford, CT 06108, USA

ABSTRACT ing an optimal control problem in a model predictive


We present the implementation of a multizone control algorithm or performing an input-output lin-
building energy simulation model in the equation- earization for designing a controller is hard because
based modeling language Modelica and compare it to building simulation programs typically do not allow
an implementation with comparable modeling detail specifying initial conditions for all state variables,
in TRNSYS. Our development time comparison in- nor do they allow the user to control the error of a
dicates a five to ten times faster development through numerical approximation to a state variable which
use of the equation-based modeling language Mod- is critical for approximating derivatives and for con-
elica. The development time for TRNSYS was ex- structing optimization algorithms with provable con-
trapolated using data from BuildOpt and comparison vergence properties (Polak and Wetter 2006).
between BuildOpt and TRNSYS since TRNSYS data In 1996, a consortium formed to develop Model-
were not available. We provide a comparative model ica, an equation-based object-oriented language for
validation of the Modelica and TRNSYS implemen- modeling of dynamic systems. The goal of the con-
tation, and compare their numerical performance. sortium is to combine the benefits of existing model-
The difference in predicted annual heating and cool- ing languages and to define a new uniform language
ing energy usage between our Modelica model and for model representation by creating a non-causal
TRNSYS is 5% to 20%, which we primarily attribute modeling language for multi-domain physics (Fritz-
to our simplified window model. The computation son and Engelson 1998).
time of the Modelica model was three to four times Modelica has been applied for some building
longer than TRNSYS, but we believe that dismissing energy modeling applications. For example, Merz
equation-based modeling languages as computation- (2002) and Felgner et al. (2002) describe the Mod-
ally inefficient is a premature conclusion. elica library ATPlus which can be used for thermal
building simulation. Hoh et al. (2005) expanded the
INTRODUCTION components of the ATPlus library to include room
Equation-based object-oriented modeling lan- model and heat exchangers that are embedded in
guages such as Modelica (Mattson and Elmqvist wall constructions. Nytsch-Geusen et al. (2005b)
1997; Fritzson and Engelson 1998) offer signifi- developed a hygrothermal building model as part of
cant benefits with regard to model development time, a Modelica library for multizone building heat and
model reuse and hierarchical model construction to mass transfer analysis. The work is conducted by a
manage the complexity of large systems. The build- consortium of six Fraunhofer Institutes that develops
ing simulation community, however, uses mainly the MOSILAB generic simulation tool that is based
modeling and simulation software that use a flat rep- on Modelica (Nytsch-Geusen et al. 2005a).
resentation of the building energy system topology,
that do not use object-oriented modeling, and that We are interested in how Modelica compares to the
mix modeling the physics with the implementation TRNSYS (Klein, Duffie, and Beckman 1976) simu-
of numerical solution algorithms. The implications lation program which is well established in the build-
are difficulties in representing large building energy ing simulation community. Of particular interest is
systems in a structured way, high costs for extending the model development time in an equation-based
existing code to implement new physical phenom- versus a procedural modeling environment because
ena and limited capabilities for analysis apart from the model development time often dominates the
time domain simulations. For example, rather ordi- time that is ultimately spent for conducting numer-
nary tasks such as rewinding an integrator for solv- ical experiments. We are also interested in how com-
plex models can be dealt with in an equation-based thermal zone model that is based on Model-
object-oriented modeling environment and how their ica 2.2 (Modelica Association 2005) and Model-
numerical performance compares. ica Fluid (Elmqvist, Tummescheit, and Otter 2003).
In the literature, equation-based and procedural The thermal zone model can be parameterized to
modeling languages have been compared by oth- model zones with an arbitrary number of opaque sur-
ers. Sahlin (1996) reports that developing a simula- face constructions and windows. The thermal zone
tion model in the equation-based modeling language models were connected to each other to construct
NMF (Sahlin and Sowell 1989) was about three times a multizone building model. Heat conduction in
faster than it was in the BRIS simulation program opaque constructions is computed using a finite dif-
(Brown 1990), but the computation time in BRIS was ference scheme for the spatial discretization of the
three times faster. Sahlin et al. (2004) compared the heat equation. The spatial discretization grid is auto-
computation time of IDA ICE with EnergyPlus. In matically generated based on material properties and
their numerical experiments, IDA ICE required ap- layer thickness, using the same algorithm as is used
proximately half the computation time that was re- in BuildOpt and described by Wetter (2004). The
quired by EnergyPlus for a three zone building with air volume of each zone is completely mixed. Long-
natural ventilation and double the computation time wave radiative heat transfer between interior surfaces
in initial experiments for a 53 zone building with- is computed using an area and long-wave emissiv-
out natural ventilation. In the latter experiments, the ity weighted average radiative temperature (Wetter
COMIS airflow program was not included in Energy- 2004). To reduce the development time required for
Plus. Sowell and Haves (2001) compared the com- coding the thermal zone model, our thermal zone
putation time of SPARK and HVACSIM+ for a vari- model takes as input time-series for the sky temper-
able air volume flow system that serves six thermal ature, the solar irradiation on the building’s outside
zones. They report that SPARK computes about 15 surfaces and a window’s transmitted solar radiation.
to 20 times faster than HVACSIM+ and attribute the Those time-series can be precomputed on a simple
decrease in computation time to SPARK’s graph de- building model that does not need to have the correct
composition and cut set reduction. building geometry. In our experiments, we precom-
In this paper, we compare the two modeling puted those time-series in TRNSYS. The window’s
and simulation environments TRNSYS and Dymola transmitted solar radiation is used to compute the so-
(Brück et al. 2002), which provides a Modelica im- lar radiation absorbed by the window panes using a
plementation. To illustrate the complexity of the simplified optical model that allowed us, at the ex-
models used in our comparison, we discuss the rel- pense of accuracy, to not having to implement the
evant physics and provide a comparative model val- lengthy algorithm that is based on Windows 4.1 (Fin-
idation. We discuss the time that was required to layson et al. 1993) and used by many building energy
implement the model equations in Modelica and we simulation programs, including TRNSYS.
benchmark the computation time of the two model
implementations. COMPARATIVE MODEL VALIDATION
We will now show results of a comparative model
BUILDING AND HVAC MODEL USED
validation for the above described multizone building
FOR PROGRAM COMPARISON model. While not as rigorous a validation as the AN-
We will now discuss the building and HVAC SI/ASHRAE Standard 140-2001 (Standard Method
model that we implemented in TRNSYS and in Mod- of Test for the Evaluation of Building Energy Anal-
elica. In both simulation environments, we imple- ysis Computer Programs, see ASHRAE 2001) our
mented the same one-story building for a quick ser- comparative model validation shows that the Mod-
vice restaurant. The building is modeled using sep- elica implementation represent the physical phenom-
arate thermal zones for the dining area, the kitchen enas with sufficient accuracy to justify a benchmark-
area, the storage area and the bathrooms. ing with TRNSYS. Measurement data that show the
In TRNSYS, we used the multizone building HVAC energy usage or indoor air temperatures did
model TYPE56 to model the building. The heat- not exist for the analyzed building.
ing energy consumption and the cooling energy con- Fig. 1 shows the indoor and outdoor temperatures
sumption for temperature and humidity control was and the sensible load for a mild day, with good agree-
modeled with the heating and cooling system that ment between both models. Comparing the build-
is part of TYPE56. The air-side coupling between ing’s annual energy consumption of the two imple-
zones is modeled using a fixed air flow rate and the mentations shows that Modelica underpredicts heat-
COUPLING key word of TYPE56’s wall model. ing by 17%, overpredicts sensible cooling by 1%,
In Modelica, we developed a physics-based and underpredicts latent cooling by 9% and total
25
Tout
Tdin,Mod
20
Tkit,Mod
air temperature [°C] Tsto,Mod
15
Tbat,Mod
Tdin,TRN
10 Tkit,TRN
Tsto,TRN
5 Tbat,TRN

0
1100 1120 1140 1160 1180
hour of the year

(a) Room air temperatures.


air temperature [°C], sensible load [W/m ]

200
2

T
150
out
Figure 2: Schematic view of building model in Dy-
q
din,Mod
q
mola’s graphical editor.
100 kit,Mod
q
50 din,TRN
q cal editor. Fig. 2 shows how our multizone building
kit,TRN
0
model was created by graphically connecting heat
−50 and air flow ports of thermal zone models. Each icon
−100 contains a model that can consist of other models,
−150
thus allowing to create complex models in a hierar-
chical way. This hierarchical model building facil-
−200
1100 1120 1140 1160 1180 itates model reuse and testing of submodels before
hour of the year
they are assembled to a large system model that may
(b) Sensible load (heating and cooling). Not shown are the loads be difficult to debug. To reduce the model develop-
for the storage area and bath rooms which are for both zones
smaller than 15 W/m2 in magnitude.
ment time, the object-oriented model construction in
Modelica allows discipline experts, such as an HVAC
engineer and a controls engineer, to model their re-
Figure 1: Comparison of room air temperatures and
spective process, and latter interface the models, ef-
sensible load for a mild day. In the legend, “T ” de-
fectively allowing to concurrently as opposed to se-
notes air temperature, “q” denotes sensible load, the
quentially build a model. By drawing lines between
subscript “out” denotes outside, “din” denotes din-
model ports, mathematical relationships are gener-
ing area, “kit” denotes kitchen, “sto” denotes stor-
ated based on the ports’ physical quantities.
age area, “bat” denotes bathroom, “Mod” denotes
Modelica libraries for multi-domain physics in-
Modelica and “T RN” denotes TRNSYS.
clude models for control systems, for thermal sys-
tems, for electrical systems and for mechanical sys-
cooling by 3%. Sensible cooling, however, is over- tems. Libraries are created using objects that define
predicted in the dining area by 7% and underpre- standard interfaces. For example, in Modelica’s ther-
dicted in the kitchen area by 5%. mal library there is a connector called HeatPort that
defines temperature and heat flow as
COMPARISON OF SIMULATION
1 p a r t i a l connector
ENVIRONMENTS 2 Modelica . Thermal .
Modelica (Fritzson and Engelson 1998) is an 3 HeatTransfer . I n t e r f a c e s . HeatPort
equation-based, non-causal, object oriented model- 4 ” T h e r m a l p o r t f o r 1−D h e a t t r a n s f e r ” ;
ing language that is designed for component oriented 5 SI . Temperature T ”Port t em perat ure” ;
multi-domain modeling of dynamic systems. Mod- 6 f l o w S I . H e a t F l o w R a t e Q flow
els are described by differential equations, algebraic 7 ” Heat f l o w r a t e ( p o s i t i v e i f
equations and discrete equations. Using standardized 8 f l o w i n g i n t o t h e component ) ” ;
9 end H e a t P o r t ;
interfaces, a model’s mathematical relations between
its interface variables is encapsulated, and the model On line 6, the type prefix flow declares that all vari-
can be represented graphically by an icon to facil- ables connected to Q flow need to sum to zero. For
itate model reuse, model exchange and connecting example, if two HeatPorts are connected, the re-
component models to system models using a graphi- lationships T1 = T2 and the conservation equation
Q f low,1 + Q f low,2 = 0 are generated. This connector time integrator can be selected from a library with
can then be used to define the interface for a one- 14 integration algorithms. The library includes im-
dimensional heat transfer element in the form plicit integration algorithms with variable step size,
which are of particular interest for building energy
1 p a r t i a l model Element1D
2 ” P a r ti a l heat t r a n s f e r element with
and controls systems since those systems are often
3 two H e a t P o r t c o n n e c t o r s t h a t d o e s stiff. For controls design, simulating with time steps
4 not s t o r e energy ” of less than a minute is often required to properly
5 S I . H e a t F l o w R a t e Q flow represent state machines and the rejection of distur-
6 ”Heat f l o w r a t e f r o m p o r t a −>p o r t b ” ; bances, and using a variable step size solver allows
7 S I . T e m p e r a t u r e dT ” p o r t a . T−p o r t b . T” ; increasing the time step during times when no mode
8 public switching or no fast transients occur.
9 HeatPort p o rt a ;
10 HeatPort port b ; Because the formulation of the system of equa-
11 equation tions is separated from its numerical solution
12 dT = p o r t a . T − p o r t b . T ; algorithm, restarting the integrator, as required if
13 p o r t a . Q flow = Q flow ; the model is used as a state estimator in a model
14 p o r t b . Q flow = −Q flow ; predictive control algorithm, or linearizing the
15 end Element1D ;
model, as required for many controls design meth-
This one-dimensional heat transfer element can then ods, can easily be performed. Furthermore, the
be used to define a thermal conductor as separation between equations and solution procedure
also allows automatic design of controllers that
1 model T h e r m a l C o n d u c t o r are based on nonlinear inverse plant models (see
2 ”Lumped t h e r m a l e l e m e n t Looye et al. 2005). The steps involved symbolic
3 t ra n s p o r ti n g heat without s to r i n g i t ”
equation manipulations to obtain an inverse model,
4 e x t e n d s I n t e r f a c e s . Element1D ;
5 parameter SI . ThermalConductance G
automatic differentiation and generation of C code
6 ”Constant thermal conductance”; with real-time integration algorithms that has been
7 equation downloaded to control platform and successfully
8 Q flow = G∗dT ; flight tested on an aircraft. Furthermore, models
9 end T h e r m a l C o n d u c t o r ; formulated in Modelica can also be compiled and
run from MATLAB/Simulink which allows using
Note that by replacing the parameter declaration on Simulink for controls design.
line 5 and the mathematical model on line 8, the
semantics can be changed to represent other one-
dimensional heat transfer elements such as a model In comparison, TRNSYS uses a procedural lan-
for long-wave radiation between two surfaces. guage to define its simulation models and discrete
Modelica is a language for model representation time integration algorithm. Models can be encapsu-
and cannot be executed directly. To create executable lated in so-called TYPEs, which are FORTRAN rou-
code, it need to be parsed to a programming lan- tines with standardized arguments. Many TYPEs im-
guage that can be compiled. To do so, we used plement their own mathematical solvers for differen-
the Dymola 5.3e simulation environment. Dymola tial and algebraic equations. For example, the multi-
performs symbolic manipulations to reduce the di- zone building model TYPE56 uses transfer functions
mensionality of the linear and non-linear systems of by Mitalas for the time integration of the opaque con-
equations that is defined by the Modelica model. Dy- struction’s temperature and an iterative solver for the
mola creates two models, one for computing the ini- window pane temperatures. The output of TYPEs
tial values, and one for performing the time integra- can be declared as input of TYPEs in a text editor
tion. For the building and HVAC model described or in a graphical editor such as in the TRNSYS Sim-
in this paper, Tab. 1 shows the dimensionality be- ulation Studio to define a system model. The system
fore and after the symbolic manipulations for those model is then solved using either successive substitu-
two models. Dymola’s implementation of Model- tion with relaxation, or a differential equation solver
ica also performs automatic differentiation. For our that converts the system of differential equations to
problem, it found analytic expressions for all Jaco- non-linear algebraic equations which it solves using
bian matrices, eliminating the need for numerically Powell’s method, a combination between steepest de-
approximating derivatives. This reduces the compu- scent and Newton’s method. There is no symbolic
tation time and increases the robustness of the numer- manipulations to reduce the size of the system of
ical solver. Finally, Dymola generates C/C++ code equations nor is there automatic differentiation per-
and compiles it. Before running the simulation, a formed.
Table 1: Reduction of the number of equations and number of variables to be solved for in Dymola’s implemen-
tation of Modelica.

Before manipulation After manipulation


system of equations variables system of equations variables
Initialization linear 1 409 1 77
problem nonlinear 6 18 6 6
Differential linear 27 127 1 8
equation nonlinear 72 252 72 78

MODEL DEVELOPMENT TIME they are not implemented in our Modelica model.
To comment on the model development time, we We neither accounted for the size of the commer-
compare the model development time for our Model- cial solver DASPK. We expect that the comparison
ica model with the multizone thermal building model would be similar for adding new models in Modelica
BuildOpt (Wetter 2005) because giving a time esti- vs. TRNSYS, since the overhead in each TRNSYS
mate for the TRNSYS building model is difficult if type is comparable to the overhead in each BuildOpt
not impossible since it evolved over many years with model.
contributions of several developers. BuildOpt, how-
ever, was developed by one of the authors, has a ther- NUMERICAL PERFORMANCE
mal building model with similar complexity than our
Modelica model, and its overhead for data manage-
We will now make an attempt to compare the com-
ment between the model equations and the program
putation time of the TRNSYS and Modelica repre-
kernel is comparable with the overhead in TRNSYS.
sentation of our multizone building model. As dis-
BuildOpt is implemented in C/C++ and took about
cussed by Sahlin et al. (2004), the creation of a prac-
one year to develop. This estimate does not include
tical and politically acceptable framework for fair
the time it took to implement BuildOpt’s optical win-
comparison of the numerical performance of a sim-
dow model, sky temperature model and rather sim-
ulator with a fixed time step and a variable time
ple daylighting model, which are not implemented in
step integration algorithm is delicate since the tem-
our Modelica model.1 This compares to one to two
poral resolutions are very different. In our com-
months of development time for the Modelica build-
parison, because the computation time depends on
ing model by the same author. Thus, using Model-
the solver tolerance and in the case of TRNSYS on
ica led to a 5 to 10 times reduction in development
the integration step size, we compare the computa-
time compared to using C/C++. The reduced de-
tion times for various settings of those precision pa-
velopment time is mainly attributed to the fact that
rameters. To verify the numerical accuracy of the
Modelica is an equation-based object-oriented lan-
obtained solutions, we also compare for each ex-
guage which eliminates the need for writing routines
periment the numerical error of the state variables
for data input and output and for managing the large
with the state variables computed at the highest tol-
amount of data that is involved in a building simu-
erance settings. Specifically, for Modelica, let εm ∈
lation. The shorter development time also manifests
{10−k }9k=1 be the solver tolerance and for TRNSYS,
itself in a four times smaller code size. Specifically,
let εt ∈ {(10−k , 1/n)}, with k ∈ {1, 2, . . ., 9} and n ∈
the Modelica model required us to write 6, 000 lines
{1, 2, . . . , 8} be the vector of solver tolerance and in-
of code (0.25 MB), whereas in BuildOpt, 24, 000
tegration step size in hours. We define ε∗m ! 10−9 and
lines of code (1.0 MB) were required. To make the
εt∗ ! (10−9 , 1/8), which corresponds to the highest
comparison representative, in Modelica we did in
precision settings used in our experiments.
the line count only include the code that we wrote,
and not the commercially available libraries Mod-
For a fixed solver tolerance ε, let u(ε, ·) ∈ R4 de-
elica 2.2 and Modelica Fluid. In BuildOpt, we did
note the numerical approximation to the state trajec-
not count the daylighting model, the optical win-
tory on the time interval [0, 1], which corresponds
dow model and the sky temperature model, which
to one year. The state variable can be for the four
account for 3, 500 lines of code (0.2 MB), because
thermal zones the air temperature which we denote
1 Based on the by T (·, ·), the heating energy which we denote by
code size of BuildOpt’s implementation of those
models, we estimate that implementing those models in Modelica Eh (·, ·) or the sensible and latent cooling energy
would take about one to two weeks of labor. which we denote by Ec (·, ·). We will compare for
different solver settings ε the absolute errors ’−’ : eT(ε), ’− ⋅’ : ec(ε), ’− −’ : eh(ε)
−1
10
1 4
Z 1
eT (ε) ! ∑ |T i (ε∗ , s) − T i (ε, s)| ds, (1) 10
−2

4 i=1 0

eT(ε), ec(ε) and eh(ε)


−3
10
4
1 −4
eh (ε) ! ∑ |Ehi (ε∗ , 1) − Ehi (ε, 1)|,
4 i=1
(2) 10
−5
10
1 4 10
−6 TRNSYS (ε2t = 1/1)
ec (ε) ! ∑ |Eci (ε∗ , 1) − Eci (ε, 1)|,
4 i=1
(3)
−7 TRNSYS (ε2t = 1/8)
10
−8 Dymola
where ε∗ is the highest solver tolerance. The units 10
Simulink
−9
are Kelvins for eT (·) and Joules for eh (·) and ec (·). 10 −8 −7 −6 −5 −4 −3 −2 −1
10 10 10 10 10 10 10 10
We run the Modelica model from the Dymola sim- ε1m and ε1t
ulation environment and from MATLAB/Simulink.
In Dymola 5.3e, we used the GCC compiler and the Figure 4: Numerical error as a function of the solver
DASSL differential algebraic equation solver with its tolerance for TRNSYS, Dymola and Simulink.
standard solver parameters. In MATLAB/Simulink
7.0.4.365 (R14) Service Pack 2, we used the GCC 10
3

compiler and the ode15s solver which is applicable TRNSYS (εt = 1/1)
2

for stiff systems. In TRNSYS 16.00.0038, we used

Computation time [min]


2
TRNSYS (ε = 1/8)
the solver that is based on successive substitution. 2
t
10 Dymola
All numerical experiments were run on a Dell Preci-
Simulink
sion Workstation 670 with a 2.8 GHz dual processor
and 4 GB RAM running Windows XP.
1
10
0.05
ε2t = 1/1

ε2t = 1/2
0.04
2 0
εt = 1/3 10 −9 −7 −5 −3 −1
ε2 = 1/4 10 10 10 10 10
0.03 t 1 1
ε and ε
ε2
eT(εt)

= 1/5 m t
t
0.02 ε2t = 1/6

ε2t = 1/7 Figure 5: Computation time as a function of the


0.01 εt
2
= 1/8
solver tolerance and the number of time step per
hour.
0
−8 −6 −4 −2
10 10 10 10
ε1 [−] on εt1 for models that have a more pronounced non-
t
linearities than the building model that we used in
Figure 3: Numerical error eT (·) as a function of the our experiments.
solver tolerance for the TRNSYS numerical experi- For Dymola and Simulink, in contrast, we see
ments. in Fig. 4 that the numerical error does as expected
depend on the solver tolerance because in those
Fig. 3 shows that for TRNSYS, the error in room simulators, the solver tolerance settings control the
air temperature eT (·) introduced by changing the integration step size and the number of iterations
number of time steps per hour εt2 from eight to one in the nonlinear equations solvers. For Dymola
dominates the error introduced by relaxing the solver and Simulink, the solver failed to converge for
tolerance εt1 from 10−9 to 10−1 . In fact, for εt1 ≤ 10−5 εm ∈ {10−2, 10−1 }. For εm ≤ 10−3 , each tenfold in-
and εt2 = 1/8, we obtained eT (εt ) = eh (εt ) = ec (εt ) = crease in solver tolerance increases the computation
0, which explains why no TRNSYS results are shown time on average by a factor of 1.6 for Dymola and
for these solver tolerance settings in Fig. 4. Also, the 1.35 for Simulink. In Modelica, the computation
TRNSYS computation time is only weakly depen- time is larger than in Simulink, but our experience is
dent on the TRNSYS solver tolerance εt1 , as is shown that the Dymola solver is more robust.
in Fig. 5. Based on our experience, however, we ex-
pect a stronger dependence of the computation time For TRNSYS, the computation time doubles if
the number of time steps per hours is changed from REFERENCES
one to eight. Compared to the TRNSYS simulation ASHRAE. 2001. ANSI/ASHRAE Standard 140-
with εt = (10−4 , 1/8), the Modelica simulation with 2001, Standard Method of Test for the Eval-
εm = 10−4 is four times slower if run from Dymola uation of Building Energy Analysis Computer
and three times slower if run from Simulink. While Programs.
a time step length of 1/8 hours seems short for most
annual energy analysis, it is not small enough for Brown, Gösta. 1990. “The BRIS simulation pro-
certain controls analysis. gram for thermal design of buildings and their
services.” Energy and Buildings 14 (4): 385–
400.
Conclusively, we can support the statement of
Brück, Dag, Hilding Elmqvist, Sven Erik Matts-
Sahlin et al. (2004) that dismissing DAE methods
son, and Hans Olsson. 2002, March. “Dy-
as being inherently inefficient is a premature conclu-
mola for Multi-Engineering Modeling and Sim-
sion.
ulation.” Edited by Martin Otter, Proceedings
of the 2nd Modelica conference. Modelica As-
CONCLUSIONS
sociation and Deutsches Zentrum fur Luft- und
We achieved a five- to tenfold reduction in model Raumfahrt, Oberpfaffenhofen, Germany, 55–1
development time by using the equation-based model – 55–8.
representation language Modelica compared to the Elmqvist, Hilding, Hubertus Tummescheit, and
time that was required to implement a model with Martin Otter. 2003, November. “Object-
similar physics in C/C++. For our situation, this Oriented Modeling of Thermo-Fluid Systems.”
translated in about one year of labor savings. We ex- Edited by Peter Fritzson, Proceedings of the
pect that a similar comparison holds between Mod- 3rd Modelica conference. Modelica Association
elica and TRNSYS, but we cannot provide data on and Institutionen för datavetenskap, Linköpings
this comparison because TRNSYS’ building model universitet, Linköping, Sweden, 269–286.
evolved over several years which makes a time esti-
mate difficult if not impossible. Our experience with Felgner, F., S. Agustina, R. Cladera Bohigas,
Modelica is that it is easier in Modelica to construct R. Merz, and L. Litz. 2002, March. “Simu-
large models than it is in TRNSYS because Modelica lation of Thermal Building Behaviour in Mod-
allows models to be built in a hierarchical way that elica.” Edited by Martin Otter, Proceedings of
facilitates debugging and reuse of submodels. Fur- the 2nd Modelica conference. Modelica Asso-
thermore, having a variable step size solver, a sym- ciation and Deutsches Zentrum fur Luft- und
bolic equation manipulator, automatic differentiation Raumfahrt, Oberpfaffenhofen, Germany, 147–
and being able to provide initial values for the state 154.
variables enables certain controls design and analysis Finlayson, E. U., D. K. Arasteh, C. Huizenga, M. D.
that is not possible with TRNSYS. Rubin, and M. S. Reilly. 1993, July. “WINDOW
4.0: Documentation of Calculation Procedures.”
We see the main strength of TRNSYS in its large
Technical Report LBL-33943, Lawrence Berke-
HVAC and building model libraries that passed sig-
ley National Laboratory, Berkeley, CA, USA.
nificant validation tests. However, writing a new
model as a TRNSYS TYPE requires significantly Fritzson, Peter, and Vadim Engelson. 1998. “Mod-
more time than it takes to write the same model in elica – A Unified Object-Oriented Language
Modelica. A further advantage of TRNSYS is its for System Modeling and Simulation.” Lecture
faster computation time, but since we did not explore Notes in Computer Science, vol. 1445.
ways to improve the numerical performance of the Hoh, Alexander, Timo Haase, Thomas Tschirner,
Modelica model, and in view of Sahlin et al. (2004) and Dirk Müller. 2005, March. “A combined
and Sowell and Haves (2001), we do not believe that thermo-hydraulic approach to simulation of ac-
the longer computation time is an inherent feature of tive building components applying Modelica.”
equation-based simulation environments. Edited by Gerhard Schmitz, Proceedings of the
4th Modelica conference. Modelica Association
ACKNOWLEDGMENTS and Hamburg University of Technology, Ham-
This research was supported by the U.S. Depart- burg, Germany. unpublished.
ment of Commerce, National Institute of Standards Klein, S. A., J. A. Duffie, and W. A. Beckman.
and Technology, Advanced Technology Program un- 1976. “TRNSYS – A Transient Simulation Pro-
der the agreement number 70NANB4H3024. gram.” ASHRAE Transactions 82 (1): 623–633.
Looye, Gertjan, Michael Thümmel, Matthias Vuolle. 2004. “Whole-building simulation with
Kurze, Martin Otter, and Johann Bals. 2005, symbolic DAE equations and general purpose
March. “Nonlinear Inverse Models for Control.” solvers.” Building and Environment 39 (8):
Edited by Gerhard Schmitz, Proceedings of the 949–958 (August).
4th Modelica conference. Modelica Association Sahlin, Per, and Edward F. Sowell. 1989, June. “A
and Hamburg University of Technology, Ham- Neutral Format for Building Simulation Mod-
burg, Germany, 267–279. els.” Proceedings of the Second International
Mattson, Sven Erik, and Hilding Elmqvist. 1997, IBPSA Conference. International Building Per-
April. “Modelica – An international effort formance Simulation Association, Vancouver,
to design the next generation modeling lan- BC, Canada, 147–154.
guage.” Edited by L. Boullart, M. Loccufier, and Sowell, Edward F., and Philip Haves. 2001. “Effi-
Sven Erik Mattsson, 7th IFAC Symposium on cient solution strategies for building energy sys-
Computer Aided Control Systems Design. Gent, tem simulation.” Energy and Buildings 33 (4):
Belgium. 309–317.
Merz, Rolf Mathias. 2002, September. “Ob- Wetter, Michael. 2004. “Simulation-Based Build-
jektorientierte Modellierung thermischen ing Energy Optimization.” Ph.D. diss., Univer-
Gebäudeverhaltens.” Ph.D. diss., Universität sity of California at Berkeley.
Kaiserslautern.
Wetter, Michael. 2005. “BuildOpt – A New Build-
Modelica Association. 2005, February. Modelica –
ing Energy Simulation Program that is Built on
A Unified Object-Oriented Language for Physi-
Smooth Models.” Building and Environment 40
cal Systems Modeling, Language Specification,
(8): 1085–1092 (August).
Version 2.2. Modelica Association.
Nytsch-Geusen, Christoph, T. Ernst, A. Nordwig, NOMENCLATURE
P. Schneider, P. Schwarz, M. Vetter, C. Wittwer, Conventions
A. Holm, T. Nouidui, J. Leopold, G. Schmidt,
1. Vectors elements are denoted by superscripts.
U. Doll, and A. Mattes. 2005a, March. “MOSI-
LAB: Development of a Modelica based generic 2. f (·) denotes a function where (·) stands for the
simulation tool supporting model structural dy- undesignated variables. f (x) denotes the value
namics.” Edited by Gerhard Schmitz, Proceed- of f (·) for the argument x.
ings of the 4th Modelica conference. Modelica
Association and Hamburg University of Tech- Symbols
nology, Hamburg, Germany, 527–535. e error
Nytsch-Geusen, Christoph, Thierry Nouidui, An- E energy
dreas Holm, , and Wolfram Haupt. 2005b, Au- T temperature
gust. “A hygrothermal building model based ε solver precision parameter
on the object-oriented modeling language Mod- ε∗ highest setting for solver precision pa-
elica.” Edited by Ian Beausoleil-Morrison and rameter
Michel Bernier, Proceedings of the Ninth Inter- a∈A a is an element of A
national IBPSA Conference, Volume 1. Inter- R set of real numbers
national Building Performance Simulation As- ! equal by definition
sociation and Ecole Polytechnique de Montreal,
Montreal, Canada, 867–876.
Polak, Elijah, and Michael Wetter. 2006. “Precision
Control for Generalized Pattern Search Algo-
rithms with Adaptive Precision Function Eval-
uations.” SIAM Journal on Optimization 16 (3):
650–669.
Sahlin, Per. 1996, May. “Modelling and Simula-
tion Methods for Modular Continuous Systems
in Buildings.” Ph.D. diss., KTH, Stockholm,
Sweden.
Sahlin, Per, Lars Eriksson, Pavel Grozman, Hans
Johnsson, Alexander Shapovalov, and Mika

You might also like