parallel computation of a large number of ODEs in MATLAB (PDE)

2 vues (au cours des 30 derniers jours)
ahmad
ahmad le 25 Mar 2015
Modifié(e) : ahmad le 25 Mar 2015
I have to solve a 1-D PDE and I defined a spatial grid of about n~1000 points. Since my PDE is second order both in time and space, the number of ODEs that I have to solve is about 2n which needs to be run for enough time to get steady-state solutions. For this large system of coupled ODEs I used an ODE solver (tested both implicit and explicit) and although the fastest is ODE113, yet it takes a long time. Since I have access to a multicore system, I was wondering if I could parallelize this program using Matlab parallel toolbox specifically spmd through decomposition of my spactial box. This is a summary of code:
% spatial grid
x=xl:dx:xu;
%intial condition
u0(1:n) = somdefunction (x)
u0(n+1:2n)=0;
%ode solver
[t,u]=ode113(@fun,tspan,u0,options)
% pde
function ut = fun(t,u)
uxx = 4*del2(u(1:n),dx);
%boundary conditions
% pde
ut1(1:n) = u(n+1:2n);
ut2(1:n) = uxx - sin(u);
ut = (ut1;ut2);
end

Réponses (0)

Community Treasure Hunt

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

Start Hunting!

Translated by