How to parallelise numerical integration (ode45)?
Mostra commenti meno recenti
I would like to apply ode45 to a matrix with 2 lines and 10000 rows. In the matrix each row contains two elements which are the initial values of two coupled equations and there are 10000 pairs of different initial values for 10000 independent numerical calculations. At this moment I can only use loops to execute ode45 for 10000 times, which is really slow. Anybody can tell me how to cleverly parallelise this process? Many thanks in advance!
Risposte (1)
Jan
il 24 Mar 2017
1 voto
Start with optimizing the code. If e.g. the function to be integrated contains discontinuities or a lot of expensive functions to calculate constants, it is the best strategy, to improve this.
Do you have the parallel processing toolbox? Then use a PARFOR to start the integration on multiple cores. Alternatively you can start several Matlab sessions and process only parts of the 10'000 pairs of initial values. See also:
- https://www.mathworks.com/matlabcentral/fileexchange/50797-jpar-parallelizing-matlab-calculations-on-multicores-and-in-clusters-without-file-communication
- https://www.mathworks.com/matlabcentral/fileexchange/44077-batch-job
- https://www.mathworks.com/matlabcentral/fileexchange/13775-multicore-parallel-processing-on-multiple-cores
Categorie
Scopri di più su Ordinary Differential Equations in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!