Numerically Solving a System of Differential Equations in Parallel?
Afficher commentaires plus anciens
Hello,
If I have a system of coupled differential equations:
dx1dt = f1(x1,x2)
dx2dt = f2(x1,x2)
Is there a way to solve this system of differential equations in parallel? (I'm thinking something like one function computes dx1dt and another function computes dx2dt and the two functions communicate with each other in order to share x1 and x2 after each time step.)
Thank you,
Kevin
Réponses (2)
Mischa Kim
le 4 Avr 2014
2 votes
5 commentaires
Kevin Bachovchin
le 4 Avr 2014
Modifié(e) : Kevin Bachovchin
le 4 Avr 2014
Mischa Kim
le 6 Avr 2014
What you are outlining in your question (parallel) are so-called coupled differential equations. x1 and x2 - or rather, their time derivatives - are functions of each other. The only way to solve these kinds of equations is by solving them, as you said, in parallel. And that's accomplished in MATLAB by using e.g. ode45.
function my_DE()
[t,X] = ode45(@EOM,[0 10],[1 1]);
x1 = X(:,1);
x2 = X(:,2);
plot(t,x1,t,x2)
grid
end
function dX = EOM(t, x)
dX = zeros(2,1);
x1 = x(1);
x2 = x(2);
dX = [x2*x1^2 - sin(x1);...
- x2 - x2*x1^3];
end
Jan
le 6 Avr 2014
Exactly. The problem does not look like a job for any kind of parallelization. Althought it is possible, the overhead would be far to high.
Kevin Bachovchin
le 9 Avr 2014
Mischa Kim
le 10 Avr 2014
As Jan and I tried to point out these type of coupled numerical problems do not lend themselves for parallelization. Parallelization works best if you can send off independent jobs to e.g. different processor cores.
nathan raynal-castang
le 11 Avr 2019
0 votes
as far I as know it is not possible, however, if you have to solve it multiple times, you could use paralel computing to solve the equation with different parameters multiple times .
Catégories
En savoir plus sur Ordinary Differential Equations dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!