[TRNSYS-users] TRNSYS-MATLAB Co-Simulation Speed

Georgios Kyriakarakos gk at aua.gr
Fri Feb 3 23:46:54 PST 2012


Dear Saleh,

A simulation with an iterative component in Matlab can easily take up to 4 minutes or more for an hourly simulation for a year, depending on the actual code. Even for controllers which run after all components in TRNSYS have converged a simulation can take up to 1 minute. If you want to run an optimization procedure you can understand that it can take days for iterative code in Matlab. What we usually do is after having the code ready in Matlab, we just translate it in fortran. It can take anywhere from a few minutes to an hour depending on the code, but then the simulation in TRNSYS will take just a few seconds. The interconnection between the two software packages takes time because data is going to and from each software package for every iteration step in TRNSYS. From experience the only thing that we have observed to speed things up just a bit is to load any files in the matlab workspace at the first call of the Matlab code and not read from the hard disk data in every 
time step.
Hope I helped,

George
--------------------------------------------------------------------
George Kyriakarakos, Agricultural Engineer
MSc Energy Systems & Renewable Energy Sources
Agricultural University of Athens,
Dept. of Natural Resources and Agricultural Engineering
Iera odos street, 75, Athens 11855, Greece
Tel. +30.210.5294046 (direct), Fax: +30.210.5294023
Mobile +30.6942.046895
e-mail: <gk at aua.gr>
--------------------------------------------------------------------




----- Original Message -----
Από: saleh saadi <salehsnjsaadi404 at yahoo.com>
Ημερομηνία: Friday, February 3, 2012 9:55 pm
Θέμα: [TRNSYS-users] TRNSYS-MATLAB Co-Simulation Speed
Προς: TRNSYS Users <trnsys-users at cae.wisc.edu>


> Dear Users,
> 
> I have been able successfully to couple my code developed in MATLAB 
> with TRNSYS using TYPE155. I'm modelling a wall system with Phase 
> Change Materials. I used the Finite Control Volume method and it is 1 
> D heat transfer. The code iterate to get solution before supply it to 
> TRNSYS. The problem is that TRNSYS model (the coupled TRNSYS-MATLAB 
> model) runs slower than the same code in MATLAB only.    I used 
> "optimize components order" in the global infos but no improvement.  
> Currently, the TRNSYS model has the wall and the weather component 
> only with a time step  of 1 hour. 
> 
> 
> 
> TRNSYS version:  16.01.0003 
> 
> MATLAB 2009b (32 bits). 
> 
> 
> I'm running the code on my machine which is a windows 7 (64bits). 
> 
> 
> Any suggestions to speed up the simulation? 
> 
> 
> Regards,
> Saleh 
> _______________________________________________
> TRNSYS-users mailing list
> TRNSYS-users at cae.wisc.edu
> https://mailman.cae.wisc.edu/listinfo/trnsys-users



More information about the TRNSYS-users mailing list