how to speed up the simulation time ?

조회 수: 1 (최근 30일)
Kutaiba sabah
Kutaiba sabah 2017년 7월 6일
편집: Stephen 2017년 7월 6일
I am designing microgrid network that has a diesel generator, wind turbine, PV, tidal generator and battery plus a dynamic load that depends on the load profile of my case study. the issues now I am facing: First, how can I speed up the simulation time as the simulation takes days to finish the run. Second, the power of diesel generators goes to negative values as well as the power of load profile.
I will appreciate any answer or suggestion to my questions.
Thanks

답변 (1개)

Stephen
Stephen 2017년 7월 6일
편집: Stephen 2017년 7월 6일
The amount of speedup you can expect depends on the algorithms you're using. If you are doing a simulation that can be parallelized (like a Monte Carlo) with many independent iterations, you can use the parallel computing toolbox to run these iteration in parallel rather than one after the other. A VERY simple solution to code that runs slowly due to loops can be solved by changing "for" to "parfor". This works in some cases depending on what variables are referenced inside of the loop.
If it is not parallelizable, I would suggest running your code with the profiler tool. This will give you a detailed report showing what portions of your code are using the most time and resources, then you can focus on optimizing the code used in those lines/functions for speed.
Also, it is possible to run certain functions in Matlab on the GPU relatively easily, and perform other custom operations as well with a little more effort. If this applies to your situation, I would investigate that avenue as well. There is good documentation from mathworks for this.
Besides the above, if you have a computer lab or cluster and the distributed computing toolbox, it may be possible to create a makeshift "supercomputer". This depends on the level to which your code can be run in parallel and the level of resources you have
It will be relatively impossible for anyone to help you diagnose the second error without knowing more.

카테고리

Help CenterFile Exchange에서 Wind Power에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by