This example shows how to solve a nonlinear elliptic problem numerically, using the pdenonlin function in Partial Differential Equation Toolbox™.
In many problems, the coefficients not only depend on spatial coordinates, but also on the solution itself. In toolbox wording, this kind of problem is called nonlinear. An example of this is the minimal surface equation
on the unit disk, with
on the boundary. The PDE coefficient c is the multiplier of , namely
c is a function of the solution , so the problem is nonlinear.
|On this page…|
The following variables define the problem:
g: A geometry specification function used by initmesh. For more information, see the documentation page for circleg and pdegeom.
c, a, f: The coefficients of the PDE. Note that c is a character array. For more information on passing coefficients into pdenonlin, see the documentation page for assempde.
rtol: Tolerance for nonlinear solver.
g = @circleg; c = '1./sqrt(1+ux.^2+uy.^2)'; a = 0; f = 0; rtol = 1e-3;
Plot the geometry and display the edge labels for use in the boundary condition definition.
figure; pdegplot(g, 'edgeLabels', 'on'); axis equal title 'Geometry With Edge Labels Displayed'; % Create a pde entity for a PDE with a single dependent variable numberOfPDE = 1; pb = pde(numberOfPDE); % Create a geometry entity pg = pdeGeometryFromEdges(g); bcFunc = @(thePde, loc, state) loc.x.^2; pb.BoundaryConditions = pdeBoundaryConditions(pg.Edges(1:4), 'u', bcFunc);
[p,e,t] = initmesh(g); [p,e,t] = refinemesh(g,p,e,t); figure; pdemesh(p,e,t); axis equal
Because the problem is nonlinear, we solve it using the pdenonlin function.
u = pdenonlin(pb,p,e,t,c,a,f,'tol',rtol);