Main Content


PDE model object


A PDEModel object contains information about a PDE problem: the number of equations, geometry, mesh, and boundary conditions.


Create a PDEModel object using createpde. Initially, the only nonempty property is PDESystemSize. It is 1 for scalar problems.


expand all

Number of equations, N, specified as a positive integer. See Equations You Can Solve Using PDE Toolbox.

Example: 1

Data Types: double

PDE boundary conditions, specified as a vector of BoundaryCondition Properties objects. You create boundary conditions using the applyBoundaryCondition function

Geometry description, specified as AnalyticGeometry for a 2-D geometry or DiscreteGeometry for a 2-D or 3-D geometry.

Mesh for solution, specified as an FEMesh Properties object. You create the mesh using the generateMesh function.

Indicator if model is time-dependent, specified as 1 (true) or 0 (false). The property is true when the m or d coefficient is nonzero, and is false otherwise.

PDE coefficients, specified as a vector of CoefficientAssignment Properties objects. See specifyCoefficients.

Initial conditions or initial solution, specified as a GeometricInitialConditions Properties or NodalInitialConditions Properties object.

In case of GeometricInitialConditions, for time-dependent problems, you must give one or two initial conditions: one if the m coefficient is zero, and two if the m coefficient is nonzero. For nonlinear stationary problems, you can optionally give an initial solution that solvepde uses to start its iterations. See setInitialConditions.

In case of NodalInitialConditions, you use the results of previous analysis to set the initial conditions or initial guess. The geometry and mesh of the previous analysis and current model must be the same.

Algorithm options for the PDE solvers, specified as a PDESolverOptions Properties object. The properties of PDESolverOptions include absolute and relative tolerances for internal ODE solvers, maximum solver iterations, and so on.

Object Functions

applyBoundaryConditionAdd boundary condition to PDEModel container
generateMeshCreate triangular or tetrahedral mesh
geometryFromEdgesCreate 2-D geometry from decomposed geometry matrix
geometryFromMeshCreate 2-D or 3-D geometry from mesh
importGeometryImport geometry from STL or STEP file
setInitialConditionsGive initial conditions or initial solution
specifyCoefficientsSpecify coefficients in a PDE model
solvepdeSolve PDE specified in a PDEModel
solvepdeeigSolve PDE eigenvalue problem specified in a PDEModel


collapse all

Create and populate a PDEModel object.

Create a container for a scalar PDE (N = 1).

model = createpde()
model = 
  PDEModel with properties:

           PDESystemSize: 1
         IsTimeDependent: 0
                Geometry: []
    EquationCoefficients: []
      BoundaryConditions: []
       InitialConditions: []
                    Mesh: []
           SolverOptions: [1x1 pde.PDESolverOptions]

Include a torus geometry, zero Dirichlet boundary conditions, coefficients for Poisson's equation, and the default mesh.


Solve the PDE.

results = solvepde(model)
results = 
  StationaryResults with properties:

    NodalSolution: [12913x1 double]
       XGradients: [12913x1 double]
       YGradients: [12913x1 double]
       ZGradients: [12913x1 double]
             Mesh: [1x1 FEMesh]

Version History

Introduced in R2015a