Documentation

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, returned as a positive integer. See Equations You Can Solve Using PDE Toolbox.

Example: 1

Data Types: double

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

Geometry description, returned as a geometry object.

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

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

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

Initial conditions or initial solution, returned 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, returned 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

 applyBoundaryCondition Add boundary condition to PDEModel container generateMesh Create triangular or tetrahedral mesh geometryFromEdges Create 2-D geometry from decomposed geometry matrix geometryFromMesh Create 2-D or 3-D geometry from mesh importGeometry Import 2-D or 3-D geometry from STL data setInitialConditions Give initial conditions or initial solution specifyCoefficients Specify coefficients in a PDE model solvepde Solve PDE specified in a PDEModel solvepdeeig Solve 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: [12913x1 double] 