<html><body><div style="color:#000; background-color:#fff; font-family:times new roman, new york, times, serif;font-size:12pt"><div><span>Thanks a lot </span>George,</div><div><br></div><div>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. <br></div><div><br></div><div>Is there an automated way to translate the MATLAB into a FORTRAN code or you do it manually?. <br></div><div><br></div><div>Saleh <br></div><div><br></div><div><br></div> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div style="font-family: times new roman, new york, times, serif; font-size: 12pt;"> <div dir="ltr"> <font face="Arial" size="2"> <hr size="1"> <b><span
style="font-weight:bold;">From:</span></b> Georgios Kyriakarakos <gk@aua.gr><br> <b><span style="font-weight: bold;">To:</span></b> saleh saadi <salehsnjsaadi404@yahoo.com> <br><b><span style="font-weight: bold;">Cc:</span></b> trnsys-users@cae.wisc.edu <br> <b><span style="font-weight: bold;">Sent:</span></b> Saturday, February 4, 2012 12:46 AM<br> <b><span style="font-weight: bold;">Subject:</span></b> Re: [TRNSYS-users] TRNSYS-MATLAB Co-Simulation Speed<br> </font> </div> <br>
Dear Saleh,<br><br>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 <br>time step.<br>Hope I helped,<br><br>George<br>--------------------------------------------------------------------<br>George Kyriakarakos, Agricultural Engineer<br>MSc Energy Systems & Renewable Energy Sources<br>Agricultural University of Athens,<br>Dept. of Natural Resources and Agricultural Engineering<br>Iera odos street, 75, Athens 11855, Greece<br>Tel. +30.210.5294046 (direct), Fax: +30.210.5294023<br>Mobile +30.6942.046895<br>e-mail: <<a ymailto="mailto:gk@aua.gr" href="mailto:gk@aua.gr">gk@aua.gr</a>><br>--------------------------------------------------------------------<br><br><br><br><br>----- Original Message -----<br>Από: saleh saadi <<a ymailto="mailto:salehsnjsaadi404@yahoo.com" href="mailto:salehsnjsaadi404@yahoo.com">salehsnjsaadi404@yahoo.com</a>><br>Ημερομηνία: Friday, February 3, 2012 9:55 pm<br>Θέμα: [TRNSYS-users] TRNSYS-MATLAB Co-Simulation
Speed<br>Προς: TRNSYS Users <<a ymailto="mailto:trnsys-users@cae.wisc.edu" href="mailto:trnsys-users@cae.wisc.edu">trnsys-users@cae.wisc.edu</a>><br><br><br>> Dear Users,<br>> <br>> I have been able successfully to couple my code developed in MATLAB <br>> with TRNSYS using TYPE155. I'm modelling a wall system with Phase <br>> Change Materials. I used the Finite Control Volume method and it is 1 <br>> D heat transfer. The code iterate to get solution before supply it to <br>> TRNSYS. The problem is that TRNSYS model (the coupled TRNSYS-MATLAB <br>> model) runs slower than the same code in MATLAB only. I used <br>> "optimize components order" in the global infos but no improvement. <br>> Currently, the TRNSYS model has the wall and the weather component <br>> only with a time step of 1 hour. <br>> <br>> <br>> <br>> TRNSYS version: 16.01.0003 <br>> <br>> MATLAB
2009b (32 bits). <br>> <br>> <br>> I'm running the code on my machine which is a windows 7 (64bits). <br>> <br>> <br>> Any suggestions to speed up the simulation? <br>> <br>> <br>> Regards,<br>> Saleh <br>> _______________________________________________<br>> TRNSYS-users mailing list<br>> <a ymailto="mailto:TRNSYS-users@cae.wisc.edu" href="mailto:TRNSYS-users@cae.wisc.edu">TRNSYS-users@cae.wisc.edu</a><br>> <a href="https://mailman.cae.wisc.edu/listinfo/trnsys-users" target="_blank">https://mailman.cae.wisc.edu/listinfo/trnsys-users</a><br><br><br> </div> </div> </div></body></html>