parallel computation of a large number of ODEs in MATLAB (PDE)
조회 수: 4 (최근 30일)
이전 댓글 표시
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
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Geometry and Mesh에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!