This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Solve PDE specified in a PDEModel


result = solvepde(model)
result = solvepde(model,tlist)



result = solvepde(model) returns the solution to the stationary PDE represented in model. A stationary PDE has the property model.IsTimeDependent = false. That is, the time-derivative coefficients m and d in model.EquationCoefficients must be 0.


result = solvepde(model,tlist) returns the solution to the time-dependent PDE represented in model at the times tlist. At least one time-derivative coefficient m or d in model.EquationCoefficients must be nonzero.


collapse all

Create a PDE model, and include the geometry of the L-shaped membrane.

model = createpde();

View the geometry with edge labels.

axis equal

Set zero Dirichlet conditions on all edges.


Poisson's equation is

Toolbox solvers address equations of the form

Include the coefficients for Poisson's equation in the model.


Mesh the model and solve the PDE.

results = solvepde(model);

View the solution.


Create a model with 3-D rectangular block geometry.

model = createpde();

Suppose that radiative cooling causes the solution to decrease as the cube of temperature on the surface of the block.

gfun = @(region,state)-state.u.^3*1e-6;

The model coefficients have no source term.


The block starts at a constant temperature of 350.


Mesh the geometry and solve the model for times 0 through 20.

tlist = 0:20;
results = solvepde(model,tlist);

Plot the solution on the surface of the block at times 1 and 20.



Input Arguments

collapse all

PDE model, specified as a PDEModel object. The model contains the geometry, mesh, and problem coefficients.

Example: model = createpde(1)

Solution times, specified as a real vector. tlist must be a monotone vector (increasing or decreasing).

Example: 0:20

Data Types: double

Output Arguments

collapse all

PDE results, returned as a StationaryResults object or as a TimeDependentResults object. The type of result depends on whether model represents a stationary problem (model.IsTimeDependent = false) or a time-dependent problem (model.IsTimeDependent = true).


  • If the Newton iteration does not converge, solvepde displays the error message Too many iterations or Stepsize too small.

  • If the initial guess produces matrices containing NaN or Inf elements, solvepde displays the error message Unsuitable initial guess U0 (default: U0 = 0).

  • If you have very small coefficients, or very small geometric dimensions, solvepde can fail to converge, or can converge to an incorrect solution. In this case, you might obtain better results by scaling the coefficients or geometry dimensions to be of order one.

Introduced in R2016a