Main Content

PDEModel

PDE model object

Description

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

Creation

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

Properties

expand all

Number of equations, N, specified as a positive integer. See Equations You Can Solve Using Partial Differential Equation 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 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 PDE model
solvepdeSolve PDE specified in a PDEModel
solvepdeeigSolve PDE eigenvalue problem specified in a PDEModel

Examples

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.

importGeometry(model,"Torus.stl");
applyBoundaryCondition(model,"dirichlet","Face",1,"u",0);
specifyCoefficients(model,"m",0,...
                          "d",0,...
                          "c",1,...
                          "a",0,...
                          "f",1);
generateMesh(model);

Solve the PDE.

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

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

Version History

Introduced in R2015a