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

Georgios Kyriakarakos gk at aua.gr
Sat Feb 4 10:33:39 PST 2012


Dear Saleh,

We write the fortran code manually. As far as I know there is no automated way to do this.

George

----- Original Message -----
Από: saleh saadi <salehsnjsaadi404 at yahoo.com>
Ημερομηνία: Saturday, February 4, 2012 8:15 pm
Θέμα: Re: [TRNSYS-users] TRNSYS-MATLAB Co-Simulation Speed
Προς: Georgios Kyriakarakos <gk at aua.gr>
Κοιν.: "trnsys-users at cae.wisc.edu" <trnsys-users at cae.wisc.edu>


> Thanks a lot George,
> 
> I have a very simple model in TRNSYS-MATLAB and it takes 13 min for an 
> hourly simulation for a year.  The code in MATLAB  takes less than a 
> minute for the same condition. TRNSYS supplies weather data (Boundary 
> Conditions) to MATLAB and then MATLAB solves a nonlinear heat equation 
> and supplies surface temperature. 
> 
> 
> Is there an automated way to translate the MATLAB into a FORTRAN code  
> or you do it manually?. 
> 
> 
> Saleh 
> 
> 
> 
> 
> ________________________________
>  From: Georgios Kyriakarakos <gk at aua.gr>
> To: saleh saadi <salehsnjsaadi404 at yahoo.com> 
> Cc: trnsys-users at cae.wisc.edu 
> Sent: Saturday, February 4, 2012 12:46 AM
> Subject: Re: [TRNSYS-users] TRNSYS-MATLAB Co-Simulation Speed
>  
> 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