Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

To resolve issues starting MATLAB on Mac OS X 10.10 (Yosemite) visit: http://www.mathworks.com/matlabcentral/answers/159016

Simulink file run in hours

Asked by Siva Malla on 15 Nov 2012

Dear Sir,

I implemented a model in simulink, and it is in discrete (Ts= 20e-6). My model is running very slowly, I kept run time as 5, I think this is in sec. and its normal. but this is taking more than 30 minuts to complete to run. Now I want to run my model in Hours (for 24 Hours =86400 sec). Because in my model PV system is there, so I have to test this system for 24 hours base, because my input is solar irradiance. but if I kept my run time as 86400, then may be it will take couple of months to complete simulation. So please give me a suggestion or any alternate method to run my system in hours. Or please tell me is any alternate option available to run model in basis of hours?

1 Comment

Azzi Abdelmalek on 15 Nov 2012

what represent you sample time

Siva Malla

Products

No products are associated with this question.

1 Answer

Answer by Jan Simon on 15 Nov 2012
Edited by Jan Simon on 15 Nov 2012
Accepted answer

Please read your question again and imagine, that you do not have any further information. Then it gets obvious, that any answer must be based opn guessing what you are doing.

Here are some of these guesses:

  • Run the model in steps of 20e-5 will reduce the runtime by a factor of 10.
  • Can parts of the model be vectorized or parallelized?
  • Are you running Matlab/Simulink on an old Pentium4 which is low on memory? Then buy a modern i7 with Gig's of RAM and try it again.
  • Does your program write logfiles to disk and 3 installed virus scanner collide with eachother such that the disk access is the bottleneck? Then uninstall two of the scanners.
  • The bottleneck of the simulation could be much faster if you replace the most used code sections by faster C-Mex functions. When you show us the code, perhaps we find improvements.
  • When I understand correctly, you simulate 5 seconds of realtime with a fixed stepsize of 20e-6. Do you really need a fixed stepsize? An automatic stepsize control will lead to a more accurate result in most likely less processing time. Currently you accumulate the rounding errors of 1e8 steps!

I suggest to post the most time consuming part of the model and ask for accelerations (guessed speedup: factor 1 to 100). In addition try to run the code on a faster computer (guessed speedup: factor 1 to 4).

2 Comments

Siva Malla on 15 Nov 2012

Thank you sir for your reply. But I cant change my discrete time steep. because it represents sample time. And my system is 16GB ram, so I think model is slow, there is no problem with my system. My model is not phasor, I can't run this model in Phasor. because it is saying that diode can't run in phasor mode. so please give me any solution....

Jan Simon on 16 Nov 2012

Any solution to what? We have only a rough description of you you have programmed. Therefore a specific suggestion is impossible. And there are no magic, general, but secret switches for Matalb and Simulink, which let them run with quadrupel speed.

Jan Simon

Contact us