Main Content

General PDEs

Solve general linear and nonlinear PDEs for stationary, time-dependent, and eigenvalue problems

You can use Partial Differential Equation Toolbox™ to solve linear and nonlinear second-order PDEs for stationary, time-dependent, and eigenvalue problems that occur in common applications in engineering and science.

A typical workflow for solving a general PDE or a system of PDEs includes the following steps:

  • Convert PDEs to the form required by Partial Differential Equation Toolbox.

  • Create a PDE model container specifying the number of equations in your model.

  • Defining 2-D or 3-D geometry and mesh it using triangular and tetrahedral elements with linear or quadratic basis functions.

  • Specify the coefficients, boundary and initial conditions. Use function handles to specify non-constant values.

  • Solve and plot the results at nodal locations or interpolate them to custom locations.

Functions

expand all

createpdeCreate model
applyBoundaryConditionAdd boundary condition to PDEModel container
specifyCoefficientsSpecify coefficients in a PDE model
setInitialConditionsGive initial conditions or initial solution
assembleFEMatricesAssemble finite element matrices
solvepdeSolve PDE specified in a PDEModel
solvepdeeigSolve PDE eigenvalue problem specified in a PDEModel
evaluateGradientEvaluate gradients of PDE solutions at arbitrary points
evaluateCGradientEvaluate flux of PDE solution
interpolateSolutionInterpolate PDE solution to arbitrary points
pdeplotPlot solution or mesh for 2-D problem
pdeplot3DPlot solution or surface mesh for 3-D problem
pdegplotPlot PDE geometry
pdemeshPlot PDE mesh
findBoundaryConditionsFind boundary condition assignment for a geometric region
findCoefficientsLocate active PDE coefficients
findInitialConditionsLocate active initial conditions
createPDEResultsCreate solution object
evaluateInterpolate data to selected locations
pdecontShorthand command for contour plot
pdesurfShorthand command for surface plot
pdeInterpolantInterpolant for nodal data to selected locations

Objects

PDEModelPDE model object
StationaryResultsTime-independent PDE solution and derived quantities
TimeDependentResultsTime-dependent PDE solution and derived quantities
EigenResultsPDE eigenvalue solution and derived quantities

Properties

BoundaryCondition PropertiesBoundary condition for PDE model
CoefficientAssignment PropertiesCoefficient assignments
GeometricInitialConditions PropertiesInitial conditions over a region or region boundary
NodalInitialConditions PropertiesInitial conditions at mesh nodes
PDESolverOptions PropertiesAlgorithm options for solvers

Topics

PDE Problem Setup

Solve Problems Using PDEModel Objects

Workflow describing how to set up and solve PDE problems using Partial Differential Equation Toolbox.

Specify Boundary Conditions

Set Dirichlet and Neumann conditions for scalar PDEs and systems of PDEs. Use functions when you cannot express your boundary conditions by constant input arguments.

f Coefficient for specifyCoefficients

Specify the coefficient f in the equation.

Set Initial Conditions

Set initial conditions for time-dependent problems or initial guess for nonlinear stationary problems.

Solutions and Their Gradients

Solution and Gradient Plots with pdeplot and pdeplot3D

Plot 2-D and 3-D PDE solutions and their gradients using pdeplot and pdeplot3D.

2-D Solution and Gradient Plots with MATLAB® Functions

Plot 2-D PDE solutions and their gradients using surf, mesh, quiver, and other MATLAB® functions.

3-D Solution and Gradient Plots with MATLAB® Functions

Plot 3-D PDE solutions, their gradients, and streamlines using surf, contourslice, quiver, and other MATLAB functions.

Dimensions of Solutions, Gradients, and Fluxes

Dimensions of stationary, time-dependent, and eigenvalue results at mesh nodes and arbitrary locations.

Eigenvalue Problems

Eigenvalues and Eigenmodes of Square

Find the eigenvalues and eigenmodes of a square domain.

Eigenvalues and Eigenmodes of L-Shaped Membrane

Use command-line functions to find the eigenvalues and the corresponding eigenmodes of an L-shaped membrane.

Finite Element Method and Partial Differential Equations

Equations You Can Solve Using PDE Toolbox

Types of scalar PDEs and systems of PDEs that you can solve using Partial Differential Equation Toolbox.

Put Equations in Divergence Form

Transform PDEs to the form required by Partial Differential Equation Toolbox.

Finite Element Method Basics

Description of the use of the finite element method to approximate a PDE solution using a piecewise linear function.