FUNCTION REFERENCE

pdepe

Solve one-dimensional parabolic and elliptic PDE systems.

Solve one-dimensional parabolic and elliptic PDE systems.

Syntax

sol = pdepe(m,pdefun,icfun,bcfun,xmesh,tspan); sol = pdepe(m,pdefun,icfun,bcfun,xmesh,tspan,options)

Solves c*u_t = x^(-m)*(x^m*f)_x+s for slab (m=0), cylindrical (m=1), or spherical (m=2) geometry. Callbacks return [c,f,s]=pdefun(x,t,u,dudx), u0=icfun(x), and [pl,ql,pr,qr]=bcfun(xl,ul,xr,ur,t). Each output is an npde-by-1 column; c is nonnegative. Boundary conditions are p+q*f=0. At x=0 with m>0 the left condition is ignored and symmetry is enforced. Use strictly increasing finite xmesh (at least 3 points) and tspan (at least 2). The result has dimensions length(tspan)-by-length(xmesh)-by-npde, with a 2-D result for one equation. Zero c components and Dirichlet boundaries use the NDF differential-algebraic solve, including consistent initialization. At least one equation must be parabolic. RelTol and scalar or npde-vector AbsTol can be set with odeset; they control time error, so refine xmesh separately for spatial accuracy.

Example

p=@(x,t,u,d) deal(1,d,0); ic=@(x) sin(pi*x); bc=@(xl,ul,xr,ur,t) deal(ul,0,ur,0); sol=pdepe(0,p,ic,bc,linspace(0,1,11),[0 .05 .1]); size(sol)

Differences from MATLAB: real values only; supports RelTol and AbsTol options and one solution output. Events and other odeset settings are rejected explicitly. The parabolic/elliptic and zero/nonzero q patterns must stay fixed. Work limits are 512 mesh points and total mesh states, 16 equations, 10000 time points, 4194304 output values, 50000 residual evaluations (also bounding steps), and 2000000 callback calls. Uses dense serial NDF solves; no automatic mesh refinement. Also accepts two requested times.

These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.