Documentation

pdenonlin

Solve nonlinear PDE problem

Syntax

[u,res] = pdenonlin(model,c,a,f)
[u,res] = pdenonlin(model,c,a,f,Name,Value)
[u,res] = pdenonlin(b,p,e,t,c,a,f)
[u,res] = pdenonlin(b,p,e,t,c,a,f,Name,Value)

Description

[u,res] = pdenonlin(model,c,a,f) solves the nonlinear scalar PDE problem

(cu)+au=f on  Ω

or the nonlinear system PDE problem

(cu)+au=f on  Ω,

where the coefficients c, a, and f can depend on the solution u. The algorithm solves the equation by using damped Newton iteration with the Armijo-Goldstein line search strategy.

The geometry, mesh, and boundary conditions are in model, a PDEModel object. See Solve Problems Using PDEModel Objects.

The solution u is represented as the solution vector u. For details on the representation of the solution vector, see assempde. res is the norm of the Newton step residuals.

The coefficients c, a, and f of the PDE problem can be given in a variety of ways. The coefficients can depend on u, the solution, and on the components of the gradient of u, namely ux, uy, and, for 3-D geometry, uz. For a complete listing of all options, see Scalar PDE Coefficients and Coefficients for Systems of PDEs.

Boundary conditions can depend on u. A fixed-point iteration strategy is employed to solve for the nonlinear boundary conditions.

[u,res] = pdenonlin(model,c,a,f,Name,Value) alters the solution process using Name,Value pairs.

[u,res] = pdenonlin(b,p,e,t,c,a,f) solves the problem using a mesh described by p, e, and t, with boundary conditions given by b. The mesh of the PDE problem is given by the mesh data p, e, and t. For details on the mesh data representation, see Mesh Data.

b describes the boundary conditions of the PDE problem. For the recommended way of specifying boundary conditions, see Specify Boundary Conditions Objects. For all methods of specifying boundary conditions, see Forms of Boundary Condition Specification.

The solver can be fine-tuned by setting some of the options described next.

Property NameProperty ValueDefaultDescription

Jacobian

fixed | lumped | full

'fixed' for 2-D, 'full' for 3-D

Approximation of Jacobian

3-D geometries accept only 'full'.

U0

string or numeric

0

Initial solution guess — Use the syntax of Initial Conditions

Tol

positive scalar

1e-4

Residual size at termination

MaxIter

positive integer

25

Maximum Gauss-Newton iterations

MinStep

positive scalar

1/2^16

Minimum damping of search direction

Report

on|off

off

Print convergence information

Norm

string or numeric

Inf

Residual norm

There are three methods currently implemented to compute the Jacobian:

  • Numerical evaluation of the full Jacobian based on the sparse version of the function numjac

  • A "lumped" approximation described in Nonlinear Equations based on the numerical differentiation of the coefficients

  • A fixed-point iteration matrix where the Jacobian is approximated by the stiffness matrix

Select the desired method by setting the Jacobian property to full, lumped, or fixed, bearing in mind that the more precise methods are computationally more expensive.

U0 is the starting guess that can be given as an expression, a generic scalar, or a vector. By default it is set to 0, but this is useless in problems such as ∇ · (1/uu) = 0 with Dirichlet boundary conditions u = ex+y. Tol fixes the exit criterion from the Gauss-Newton iteration, i.e., the iterations are terminated when the residual norm is less than Tol. The norm in which the residual is computed is selected through Norm. This can be any admissible MATLAB® vector norm or energy for the energy norm.

MaxIter and MinStep are safeguards against infinite Gauss-Newton loops and they bound the number of iterations and the step size used in each iteration. Setting Report to on forces printing of convergence information.

Examples

Minimal Surface Problem

Solve a minimal surface problem. Because this problem has a nonlinear c coefficient, use pdenonlin to solve it.

Create a model and include circular geometry using the built-in circleg function.

model = createpde;
geometryFromEdges(model,@circleg);

Set the coefficients.

a = 0;
f = 0;
c = '1./sqrt(1+ux.^2+uy.^2)';

Set a Dirichlet boundary condition with value x2.

boundaryfun = @(region,state)region.x.^2;
applyBoundaryCondition(model,'Edge',1:model.Geometry.NumEdges,...
    'u',boundaryfun,'Vectorized','on');

Generate a mesh and solve the problem.

generateMesh(model,'Hmax',0.1);
u = pdenonlin(model,c,a,f);
pdeplot(model,'xydata',u,'zdata',u);

Diagnostics

If the Newton iteration does not converge, the error message Too many iterations or Stepsize too small is displayed. If the initial guess produces matrices containing NaN or Inf elements, the error message Unsuitable initial guess U0 (default: U0 = 0) is printed.

See Also

Introduced before R2006a

Was this topic helpful?