parallel computation of a large number of ODEs in MATLAB (PDE)
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
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
0 Kommentare
Antworten (0)
Siehe auch
Kategorien
Mehr zu Geometry and Mesh finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!