FUNCTION REFERENCE
solvepde
Solve a stationary (linear or nonlinear) or time-dependent 2-D PDE model (scalar or N-equation system).
Solve a stationary (linear or nonlinear) or time-dependent 2-D PDE model (scalar or N-equation system).
Syntax
results = solvepde(model); results = solvepde(model, tlist)For stationary problems (m = 0, d = 0), solvepde(model) assembles the finite-element stiffness, reaction, and load terms on model.Mesh (linear 3-node or isoparametric quadratic 6-node triangles), applies generalized Neumann, mixed, and strong Dirichlet boundary conditions, and returns a pde.StationaryResults object with NodalSolution (N_nodes-by-N_comp), XGradients, YGradients, and Mesh. When coefficients depend on state (u, ux, uy), a damped Newton solver controlled by model.SolverOptions (ResidualTolerance default 1e-4, MaxIterations default 25, MinStep default 2^-16, ReportStatistics default 'off') is used. For time-dependent problems (d ~= 0 or m ~= 0), solvepde(model, tlist) integrates the semi-discrete system with ode15s using model.SolverOptions (RelativeTolerance 1e-3, AbsoluteTolerance 1e-6) and returns a pde.TimeDependentResults object with NodalSolution (N_nodes-by-Nt for scalar, N_nodes-by-N_comp-by-Nt for systems), SolutionTimes, XGradients, YGradients, and Mesh.
Example
R1=[3;4;0;1;1;0;0;0;1;1]; dl=decsg(R1); m=createpde(); geometryFromEdges(m,dl); generateMesh(m,'Hmax',0.25,'GeometricOrder','linear'); specifyCoefficients(m,'m',0,'d',0,'c',1,'a',0,'f',1); applyBoundaryCondition(m,'dirichlet','Edge',1:4,'u',0); res=solvepde(m); max(res.NodalSolution) > 0Example
R1=[3;4;0;1;1;0;0;0;1;1]; dl=decsg(R1); m=createpde(); geometryFromEdges(m,dl); generateMesh(m,'Hmax',0.25,'GeometricOrder','linear'); specifyCoefficients(m,'m',0,'d',1,'c',1,'a',0,'f',0); applyBoundaryCondition(m,'dirichlet','Edge',1:4,'u',0); setInitialConditions(m,@(loc) sin(pi*loc.x).*sin(pi*loc.y)); res=solvepde(m,[0 0.05 0.1]); size(res.NodalSolution, 2) == 3Differences from MATLAB: 2-D geometries only; nonlinear time-dependent solves and 3-D geometries are not supported yet. Time-dependent solves use the dense ode15s path and are limited to 4096 state DOFs. Time-dependent m, d, a, c and Neumann q are rejected. m and d must be nonzero on every face.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.