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
c is a function of the solution
, so the problem is nonlinear.
The following variables define the problem:
information, see the documentation page for
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
rtol: Tolerance for nonlinear solver.
c = '1./sqrt(1+ux.^2+uy.^2)'; a = 0; f = 0; rtol = 1e-3; % Create a PDE Model with a single dependent variable numberOfPDE = 1; pdem = createpde(numberOfPDE); % Create a geometry entity and append to the pde model g = @circleg; geometryFromEdges(pdem,g);
Plot the geometry and display the edge labels for use in the boundary condition definition.
figure; pdegplot(pdem, 'edgeLabels', 'on'); axis equal title 'Geometry With Edge Labels Displayed'; bcFunc = @(thePde, loc, state) loc.x.^2; applyBoundaryCondition(pdem,'Edge',(1:4), 'u', bcFunc);
msh=generateMesh(pdem,'Hmax',0.1); figure; pdemesh(pdem); axis equal
Because the problem is nonlinear, we solve it using the
u = pdenonlin(pdem,c,a,f,'tol',rtol);
figure; [p,e,t] = meshToPet(msh); pdesurf(p,t,u);