Nonlinear Finite Element Method Verification Tests

This notebook contains tests that verify that the nonlinear Finite Element method works as expected. To run all tests, SelectAll and press Shift+Enter. The results will then be in the section Test Result Inspection.

Differential equations in tests are typically given in inactive form. In some cases, an inactive form of a differential equation is the only way to set a specific differential equation. The exact details of when an inactive equation is used are explained in the Finite Element Method Usage Tips tutorial. The sections about Formal Partial Differential Equations and NeumannValue and Formal Partial Differential Equations are particularly relevant. In the test suite, most tests would not strictly need an inactive form, but they are present so that the parsing of the equations can also be tested.

Note that these tests can also serve as a basis for developing your own differential equation models. As such, the tests are grouped into stationary (time-independent) and transient (time-dependent) tests. The next level of grouping is in the number of equations. Either a single equation or a coupled equation is considered. In those categories, one- and two-dimensional tests can be found. The fact that no three-dimensional tests are present is due to implementation of the finite element code. The code base for all dimensions is the same, and not much benefit would come from including three-dimensional tests.

Some cells in the actual tests are not evaluatable. These are mainly cells that contain a symbolic derivation and would take additional runtime and consume memory. If an actual analytical solution exists, it is given as a function. The derivation is there for inspection. To make these cells evaluatable, select the cells in question and choose Cell Cell Properties and make sure "Evaluatable" is ticked.

The individual subtest also needs to be evaluated in order to work as intended.

This loads the Finite Element package:
In[1]:=
Click for copyable input
Set up options that force the use of the Finite Element Method.
In[2]:=
Click for copyable input
To reduce memory consumption set the history length to 0.
In[3]:=
Click for copyable input

Stationary Tests

This section contains examples of stationary (non-time-dependent) nonlinear partial differential equations.

1D Single Equation

This section contains examples of ordinary nonlinear differential equations with one equation. Ordinary differential equations with one independent variable are a special case of partial differential equations that usually deal with more than one independent variable.

DiffusionFEM-NL-Stationary-1D-Single-Diffusion-0001

Test Reference:

[1], chapter 7, page 341.

Equation:

Set up the equation in inactive form.
In[69]:=
Click for copyable input
Out[69]=
Analytical solution:

Set up the analytical solution.
In[70]:=
Click for copyable input
Out[70]=
Boundary conditions:

and

Set up the boundary conditions.
In[71]:=
Click for copyable input
Out[71]=
Region:

Set up the region.
In[72]:=
Click for copyable input
Out[72]=
Test 1:
Test the inactive PDE.
In[73]:=
Click for copyable input
Out[73]=
Test 2:
Test the active PDE.
In[74]:=
Click for copyable input
Out[74]=
Test 3:
Test the low-level functions with step and evaluation count monitoring.
In[75]:=
Click for copyable input
Out[75]=

DiffusionFEM-NL-Stationary-1D-Single-Diffusion-0002

Test Reference:

[4], page 38

Equation:

The right-hand-side will be computed from the analytical solution.

Set up the equation in inactive form.
In[76]:=
Click for copyable input
Out[76]=
Analytical solution:

Set up solution parameters.
In[77]:=
Click for copyable input
Out[77]=
Set up the analytical solution.
In[78]:=
Click for copyable input
Out[78]=
Set up the right-hand-side .
In[79]:=
Click for copyable input
Out[79]=
Boundary conditions:

and

Set up the boundary conditions.
In[80]:=
Click for copyable input
Out[80]=
Region:

Set up the region.
In[81]:=
Click for copyable input
Out[81]=
Test 1:
Test the PDE in inactive form.
In[82]:=
Click for copyable input
Out[82]=
Test 2:
Test the PDE.
In[83]:=
Click for copyable input
Out[83]=
Test 3:
Test the low-level functions with multiple mesh blocks.
In[84]:=
Click for copyable input
Out[84]=

ConvectionFEM-NL-Stationary-1D-Single-Convection-0001

Test Reference:

[2], problems: 3.7, page 83.

Equation:

Set up the equation in inactive form.
In[85]:=
Click for copyable input
Out[85]=
Analytical solution:

Set up the analytical solution.
In[86]:=
Click for copyable input
Out[86]=
Boundary conditions:

and

Set up the boundary conditions.
In[87]:=
Click for copyable input
Out[87]=
Region:

Set up the region.
In[88]:=
Click for copyable input
Out[88]=
Test 1:
Test the PDE in inactive form.
In[89]:=
Click for copyable input
Out[89]=
Test 2:
Test the PDE.
In[90]:=
Click for copyable input
Out[90]=
Test 3:
Test the low-level functions and monitor steps and evaluations.
In[91]:=
Click for copyable input
Out[91]=

ConvectionFEM-NL-Stationary-1D-Single-Convection-0002

Test Reference:

None

Equation:

Set up the equation in inactive form.
In[92]:=
Click for copyable input
Out[92]=
Analytical solution:

Set up the analytical solution.
In[93]:=
Click for copyable input
Out[93]=
Check the analytical solution.
In[94]:=
Click for copyable input
Out[94]=
Boundary conditions:

and

Set up the boundary conditions.
In[95]:=
Click for copyable input
Out[95]=
Region:

Set up the region.
In[96]:=
Click for copyable input
Out[96]=
Test 1:
Test the PDE in inactive form.
In[97]:=
Click for copyable input
Out[97]=
Test 2:
Test the PDE.
In[98]:=
Click for copyable input
Out[98]=
Test 3:
Test the low-level functions and monitor steps and evaluations.
In[99]:=
Click for copyable input
Out[99]=

ReactionFEM-NL-Stationary-1D-Single-Reaction-0001

Test Reference:

[1], problem 7.1, page 383.

Equation:

Set up the equation in inactive form.
In[100]:=
Click for copyable input
Out[100]=
Analytical solution:

None

Boundary conditions:

and

Set up the boundary conditions.
In[101]:=
Click for copyable input
Out[101]=
Region:

Set up the region.
In[102]:=
Click for copyable input
Out[102]=
Alternative numerical solution:
Set up an alternative numerical solution.
In[103]:=
Click for copyable input
Out[103]=
Test 1:
Test the PDE in inactive form.
In[104]:=
Click for copyable input
Out[104]=
Test 2:
Test the PDE.
In[105]:=
Click for copyable input
Out[105]=
Test 3:
Test the low-level functions and monitor steps and evaluations.
In[106]:=
Click for copyable input
Out[106]=

ReactionFEM-NL-Stationary-1D-Single-Reaction-0002

Test Reference:

[1], problem 7.3, page 384.

Equation:

Set up the equation in inactive form.
In[107]:=
Click for copyable input
Out[108]=
Analytical solution:

None

Boundary conditions:

and

Set up the boundary conditions.
In[109]:=
Click for copyable input
Out[109]=
Region:

Set up the region.
In[110]:=
Click for copyable input
Out[110]=
Alternative numerical solution:
Set up an alternative numerical solution.
In[111]:=
Click for copyable input
Out[111]=
Test 1:
Test the PDE in inactive form.
In[112]:=
Click for copyable input
Out[112]=
Test 2:
Test the PDE.
In[113]:=
Click for copyable input
Out[113]=
Test 3 & 4:
Set up the low-level function data structures.
In[114]:=
Click for copyable input
Test the low-level functions and monitor steps and evaluations.
In[119]:=
Click for copyable input
Out[119]=
Test an alternative formulation of low-level functions.
In[120]:=
Click for copyable input
Out[120]=

ReactionFEM-NL-Stationary-1D-Single-Reaction-0003

Test Reference:

None

Equation:

Set up the equation in inactive form.
In[121]:=
Click for copyable input
Out[121]=
Analytical solution:

Null

Set up the analytical solution.
In[122]:=
Click for copyable input
Out[122]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

and

Set up the boundary conditions.
In[123]:=
Click for copyable input
Out[123]=
Region:

The test uses an arbitrary region.

Set up the region.
In[124]:=
Click for copyable input
Out[124]=
Test 1:
Test the PDE in inactive form.
In[125]:=
Click for copyable input
Out[125]=
Test 2:
Test the PDE.
In[126]:=
Click for copyable input
Out[126]=
Test 3 & 4:
Set up the low-level function data structures.
In[127]:=
Click for copyable input
Test the low-level functions and monitor steps and evaluations.
In[132]:=
Click for copyable input
Out[132]=
Test an alternative formulation of low-level functions.
In[133]:=
Click for copyable input
Out[133]=

ReactionFEM-NL-Stationary-1D-Single-Reaction-0004

Test Reference:

None

Equation:

Set up the equation in inactive form.
In[134]:=
Click for copyable input
Out[134]=
Analytical solution:

Null

Set up the analytical solution.
In[135]:=
Click for copyable input
Out[135]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

and

Set up the boundary conditions.
In[136]:=
Click for copyable input
Out[136]=
Region:

The test uses an arbitrary region.

Set up the region.
In[137]:=
Click for copyable input
Out[137]=
Test 1:
Test the PDE in inactive form.
In[138]:=
Click for copyable input
Out[138]=
Test 2:
Test the PDE.
In[139]:=
Click for copyable input
Out[139]=
Test 3 & 4:
Set up the low-level function data structures.
In[140]:=
Click for copyable input
Test the low-level functions and monitor steps and evaluations.
In[145]:=
Click for copyable input
Out[145]=
Test an alternative formulation of low-level functions.
In[146]:=
Click for copyable input
Out[146]=

LoadFEM-NL-Stationary-1D-Single-Load-0001

Test Reference:

[3], Exact Solutions > Ordinary Differential Equations > Second-Order Nonlinear Ordinary Differential Equations; Equation 3.1.1; Autonomous equation.

Equation:

Set up the equation in inactive form.
In[147]:=
Click for copyable input
Out[147]=
Analytical solution:

where and are arbitrary constants.

Set up the analytical solution.
In[148]:=
Click for copyable input
Out[148]=
Check the analytical solution.
In[149]:=
Click for copyable input
Out[149]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

and

Set up the boundary conditions.
In[150]:=
Click for copyable input
Out[150]=
Region:

The test uses an arbitrary region.

Set up the region.
In[151]:=
Click for copyable input
Out[151]=
Test 1:
Test the PDE in inactive form.
In[152]:=
Click for copyable input
Out[152]=
Test 2:
Test the PDE.
In[153]:=
Click for copyable input
Out[153]=
Test 3:
Test the low-level functions and monitor steps and evaluations.
In[154]:=
Click for copyable input
Out[154]=

LoadFEM-NL-Stationary-1D-Single-Load-0002

Test Reference:

[2], problem 3.17, page 84.

Equation:

Set up the equation in inactive form.
In[155]:=
Click for copyable input
Out[155]=
Analytical solution:

with

where are the roots of the equation

Set up the analytical solution.
In[156]:=
Click for copyable input
Out[157]=
Boundary conditions:

and

Set up the boundary conditions.
In[158]:=
Click for copyable input
Out[158]=
Region:

The test uses an arbitrary region.

Set up the region.
In[159]:=
Click for copyable input
Out[159]=
Test 1:
Test the inactive PDE with an initial seed to obtain one solution.
In[160]:=
Click for copyable input
Out[160]=
Test 2:
Test the inactive PDE with a different initial seed to obtain a different solution.
In[161]:=
Click for copyable input
Out[161]=
Test 3:
Test the PDE.
In[162]:=
Click for copyable input
Out[162]=
Test 4:
Test the active PDE with a different initial seed to obtain a different solution.
In[163]:=
Click for copyable input
Out[163]=

Radiation BCFEM-NL-Stationary-1D-Single-Radiation-0001

Test Reference:

[1], problem 7.13, page 385.

The model problem is modified to allow for an analytical solution for comparison and extends the testing of the nonlinear boundary condition.

Equation:

Two changes are made to the parameters given in [1]. First, is given a nonzero value to extend the scope of the test, and second, is set to 0 to allow for an analytical solution.

Specify the parameters.
In[164]:=
Click for copyable input
Set up the equation in inactive form.
In[165]:=
Click for copyable input
Out[165]=
Analytical solution:

At position , the solution of can be found to be (derivation follows):

The solution at .
In[166]:=
Click for copyable input
Out[166]=

What follows is the derivation of the solution at . The cells are not evaluatable to not consume time when running the tests.

The structure of the general solution is as follows.
In[11]:=
Click for copyable input
Out[11]=
Note the following.
In[12]:=
Click for copyable input
Out[12]=
Specify a first constraint implied by the DirichletCondition at .
In[13]:=
Click for copyable input
Out[13]=
Specify a second constraint implied from .
In[14]:=
Click for copyable input
Out[14]=
Use the definition of the generalized Neumann value and insert constraints.
In[15]:=
Click for copyable input
Out[15]=
Use Reduce the find the real, positive root.
In[16]:=
Click for copyable input
Out[16]=
Boundary conditions:

and

Set up the boundary conditions.
In[167]:=
Click for copyable input
Out[167]=
Region:

The test uses an arbitrary region.

Set up the region.
In[168]:=
Click for copyable input
Out[168]=
Test 1:
Test the inactive PDE with an initial seed to obtain one solution.
In[169]:=
Click for copyable input
Out[169]=
Test 2:
Test the active PDE with an initial seed to obtain one solution.
In[170]:=
Click for copyable input
Out[170]=
Test 3:
Test the low-level functions and monitor steps and evaluations.
In[171]:=
Click for copyable input
Out[171]=

1D Systems of Equations

This section contains examples of systems of ordinary nonlinear differential equations.

ReactionFEM-NL-Stationary-1D-System-Reaction-0001

Test Reference:

[3], Exact Solutions > Systems of Ordinary Differential Equations > Nonlinear Systems of Two Ordinary Differential Equations, 3.2.7

Equation:

Set up the equation for specific values of and .
In[172]:=
Click for copyable input
Out[174]=
Analytical solution:

Set up the analytical solutions.
In[175]:=
Click for copyable input
Out[177]=
Out[178]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

Set up the boundary conditions.
In[179]:=
Click for copyable input
Out[179]=
Region:

Set up the region.
In[180]:=
Click for copyable input
Out[180]=
Test 1:
Test the PDE in inactive form.
In[181]:=
Click for copyable input
Out[181]=
Test 2:
Test the PDE.
In[182]:=
Click for copyable input
Out[182]=
Test 3 & 4:
Set up the low-level function data structures.
In[183]:=
Click for copyable input
Test the low-level functions and monitor steps and evaluations.
In[188]:=
Click for copyable input
Out[188]=
Test an alternative formulation of low-level functions.
In[189]:=
Click for copyable input
Out[189]=

2D Single Equation

This section contains examples of nonlinear partial differential equations with one equation.

DiffusionFEM-NL-Stationary-2D-Single-Diffusion-0001

Test Reference:

[3], Exact Solutions > Nonlinear Partial Differential Equations > Other Second-Order Partial Differential Equations; Equation 4.1.2; Equation of steady transonic gas flow.

Equation:

Set up the equation in inactive form.
In[190]:=
Click for copyable input
Out[190]=
Analytical solution:

Set up the analytical solution with arbitrary constants , , , , and .
In[191]:=
Click for copyable input
Out[192]=
Verify the analytical solution.
In[193]:=
Click for copyable input
Out[193]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

Set up the boundary conditions.
In[194]:=
Click for copyable input
Out[194]=
Region:

Set up the region.
In[195]:=
Click for copyable input
Out[195]=
Tests 1:
Test the PDE in inactive form.
In[196]:=
Click for copyable input
Out[196]=
Tests 2:

In the activated case, the linearization leads to a higher-than-first-order derivative in the PDE coefficients, which can not be handled.

Test the PDE.
In[197]:=
Click for copyable input
Out[197]=
Test 3:
Set up the low-level function data structures.
In[198]:=
Click for copyable input
Test the low-level functions and monitor steps and evaluations.
In[203]:=
Click for copyable input
Out[203]=

ReactionFEM-NL-Stationary-2D-Single-Reaction-0001

Test Reference:

[3], Exact Solutions > Nonlinear Partial Differential Equations > Second-Order Elliptic Partial Differential Equations; Equation 3.1.2;

Equation:

Set up the equation in inactive form.
In[204]:=
Click for copyable input
Out[205]=
Analytical solution:

Set up the analytical solution with arbitrary constants and .
In[206]:=
Click for copyable input
Out[207]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

Set up the boundary conditions.
In[208]:=
Click for copyable input
Out[208]=
Region:

Set up the region.
In[209]:=
Click for copyable input
Out[209]=
Tests 1:
Test the PDE in inactive form.
In[210]:=
Click for copyable input
Out[210]=
Tests 2:
Test the PDE.
In[211]:=
Click for copyable input
Out[211]=
Tests 3 & 4:
Set up the low-level function data structures.
In[212]:=
Click for copyable input
Test the low-level functions and monitor steps and evaluations.
In[217]:=
Click for copyable input
Out[217]=
Test an alternative formulation of low-level functions.
In[218]:=
Click for copyable input
Out[218]=

Transient Tests

This section contains examples of time-dependent nonlinear partial differential equations used for testing.

1D Single Equation

This section contains examples of time dependent ordinary nonlinear differential equations with one equation. Ordinary differential equations with one independent variable are a special case of partial differential equations that usually deal with more than one independent variable.

DiffusionFEM-NL-Transient-1D-Single-Diffusion-0001

Test Reference:

[3], Exact Solutions > Nonlinear Partial Differential Equations >Second-Order Parabolic Partial Differential Equations > Heat Equation with a Power-Law Nonlinearity; Equation 1.2.1; Heat equation with a power-law nonlinearity.

Equation:

Set up the equation in inactive form.
In[219]:=
Click for copyable input
Out[219]=
Analytical solution:

Set up solution parameters.
In[220]:=
Click for copyable input
Out[220]=
Set up an analytical solution.
In[221]:=
Click for copyable input
Out[221]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

and

Set up the boundary conditions.
In[222]:=
Click for copyable input
Out[222]=
Initial conditions:

No initial conditions are specified; they are deduced from the analytical solution.

Set up the initial conditions.
In[223]:=
Click for copyable input
Out[223]=
Region:

Set up the region.
In[224]:=
Click for copyable input
Out[224]=
Test 1:
Test the PDE in inactive form.
In[225]:=
Click for copyable input
Out[225]=
Test 2:
Test the PDE.
In[226]:=
Click for copyable input
Out[226]=

DiffusionFEM-NL-Transient-1D-Single-Diffusion-0002

Test Reference:

[3], Exact Solutions > Nonlinear Partial Differential Equations >Second-Order Parabolic Partial Differential Equations > Heat Equation with a Exponential Nonlinearity; Equation 1.2.7; Heat Equation with a Exponential Nonlinearity.

Equation:

Set up the equation in inactive form.
In[227]:=
Click for copyable input
Out[227]=
Analytical solution:

Set up solution parameters.
In[228]:=
Click for copyable input
Out[228]=
Set up an analytical solution.
In[229]:=
Click for copyable input
Out[229]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

and

Set up the boundary conditions.
In[230]:=
Click for copyable input
Out[230]=
Initial conditions:

No initial conditions are specified; they are deduced from the analytical solution.

Set up the initial conditions.
In[231]:=
Click for copyable input
Out[231]=
Region:

Set up the region.
In[232]:=
Click for copyable input
Out[232]=
Test 1:
Test the PDE in inactive form.
In[233]:=
Click for copyable input
Out[233]=
Test 2:
Test the PDE.
In[234]:=
Click for copyable input
Out[234]=

DiffusionFEM-NL-Transient-1D-Single-Diffusion-0003

Test Reference:

[3], Exact Solutions > Nonlinear Partial Differential Equations > Second-Order Hyperbolic Partial Differential Equations; Equation 2.2.1;

Equation:

Set up the equation in inactive form.
In[235]:=
Click for copyable input
Out[235]=
Analytical solution:

Set up solution parameters.
In[236]:=
Click for copyable input
Out[236]=
Set up an analytical solution.
In[237]:=
Click for copyable input
Out[237]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

and

Set up the boundary conditions.
In[238]:=
Click for copyable input
Out[238]=
Initial conditions:

No initial conditions are specified; they are deduced from the analytical solution.

Set up the initial conditions.
In[239]:=
Click for copyable input
Out[239]=
Region:

Set up the region.
In[240]:=
Click for copyable input
Out[240]=
Test 1:
Test the PDE in inactive form.
In[241]:=
Click for copyable input
Out[241]=

ConvectionFEM-NL-Transient-1D-Single-Convection-0001

Test Reference:

[3], Exact Solutions > Nonlinear Partial Differential Equations >Second-Order Parabolic Partial Differential Equations > Burgers Equation; Equation 1.3.1; Burgers equation.

Equation:

Set up the equation in inactive form.
In[242]:=
Click for copyable input
Out[242]=
Analytical solution:

Set up solution parameters.
In[243]:=
Click for copyable input
Out[243]=
Set up an analytical solution.
In[244]:=
Click for copyable input
Out[244]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

and

Set up the boundary conditions.
In[245]:=
Click for copyable input
Out[245]=
Initial conditions:

No initial conditions are specified; they are deduced from the analytical solution.

Set up the initial conditions.
In[246]:=
Click for copyable input
Out[246]=
Region:

Set up the region.
In[247]:=
Click for copyable input
Out[247]=
Test 1:
Test the PDE in inactive form.
In[248]:=
Click for copyable input
Out[248]=
Test 2:
Test the PDE.
In[249]:=
Click for copyable input
Out[249]=

ConvectionFEM-NL-Transient-1D-Single-Convection-0002

Test Reference:

https://mathematica.stackexchange.com/q/10453/18437

Equation:

Set up the equation in inactive form.
In[250]:=
Click for copyable input
Out[250]=
Analytical solution:

Set up solution parameters.
In[251]:=
Click for copyable input
Out[251]=
Set up an analytical solution.
In[252]:=
Click for copyable input
Out[252]=
Boundary conditions:

Boundary conditions are deduced from the analytical solution.

and

Set up the boundary conditions.
In[253]:=
Click for copyable input
Out[253]=
Initial conditions:

Initial conditions are deduced from the analytical solution.

Set up the initial conditions.
In[254]:=
Click for copyable input
Out[254]=
Region:

Set up the region.
In[255]:=
Click for copyable input
Out[255]=
Test 1:
Test the PDE in inactive form.
In[256]:=
Click for copyable input
Out[256]=
Test 2:
Test the PDE.
In[257]:=
Click for copyable input
Out[257]=

ReactionFEM-NL-Transient-1D-Single-Reaction-0001

Test Reference:

[3], Exact Solutions > Nonlinear Partial Differential Equations >Second-Order Parabolic Partial Differential Equations > Fisher Equation; Equation 1.1.1; Fisher equation.

Equation:

Set up the equation in inactive form.
In[258]:=
Click for copyable input
Out[258]=
Analytical solution:

Set up solution parameters.
In[259]:=
Click for copyable input
Out[259]=
Set up an analytical solution.
In[260]:=
Click for copyable input
Out[260]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

and

Set up the boundary conditions.
In[261]:=
Click for copyable input
Out[261]=
Initial conditions:

No initial conditions are specified; they are deduced from the analytical solution.

Set up the initial conditions.
In[262]:=
Click for copyable input
Out[262]=
Region:

Set up the region.
In[263]:=
Click for copyable input
Out[263]=
Test 1:
Test the PDE in inactive form.
In[264]:=
Click for copyable input
Out[264]=
Test 2:
Test the PDE.
In[265]:=
Click for copyable input
Out[265]=

ReactionFEM-NL-Transient-1D-Single-Reaction-0002

Test Reference:

[3], Exact Solutions > Nonlinear Partial Differential Equations >Second-Order Hyperbolic Partial Differential Equations > KleinGordon Equation with a Power-Law Nonlinearity; Equation 2.1.1; Klein--Gordon equation with a power-law nonlinearity.

Equation:

Set up the equation in inactive form.
In[266]:=
Click for copyable input
Out[266]=
Analytical solution:

, ,

Set up solution parameters.
In[267]:=
Click for copyable input
Out[267]=
In[268]:=
Click for copyable input
Out[268]=
Set up an analytical solution.
In[269]:=
Click for copyable input
Out[269]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

and

Set up the boundary conditions.
In[270]:=
Click for copyable input
Out[270]=
Initial conditions:

No initial conditions are specified; they are deduced from the analytical solution.

Set up the initial conditions.
In[271]:=
Click for copyable input
Out[271]=
Region:

Set up the region.
In[272]:=
Click for copyable input
Out[272]=
Test 1:
Test the PDE in inactive form.
In[273]:=
Click for copyable input
Out[273]=
Test 2:
Test the PDE.
In[274]:=
Click for copyable input
Out[274]=

LoadFEM-NL-Transient-1D-Single-Load-0001

Test Reference:

[3], Exact Solutions > Nonlinear Partial Differential Equations >Second-Order Parabolic Partial Differential Equations > Equation 1.1.5;

Equation:

Set up the equation in inactive form.
In[275]:=
Click for copyable input
Out[275]=
Analytical solution:

Set up solution parameters.
In[276]:=
Click for copyable input
Out[276]=
Set up an analytical solution.
In[277]:=
Click for copyable input
Out[277]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

and

Set up the boundary conditions.
In[278]:=
Click for copyable input
Out[278]=
Initial conditions:

No initial conditions are specified; they are deduced from the analytical solution.

Set up the initial conditions.
In[279]:=
Click for copyable input
Out[279]=
Region:

Set up the region.
In[280]:=
Click for copyable input
Out[280]=
Test 1:
Test the PDE in inactive form.
In[281]:=
Click for copyable input
Out[281]=
Test 2:
Test the PDE.
In[282]:=
Click for copyable input
Out[282]=

LoadFEM-NL-Transient-1D-Single-Load-0002

Test Reference:

[3], Exact Solutions > Nonlinear Partial Differential Equations >Second-Order Hyperbolic Partial Differential Equations > Modified Liouville Equation; Equation 2.1.3;

Equation:

Set up the equation in inactive form.
In[283]:=
Click for copyable input
Out[283]=
Analytical solution:

Set up solution parameters.
In[284]:=
Click for copyable input
Out[284]=
Set up an analytical solution.
In[285]:=
Click for copyable input
Out[285]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

and

Set up the boundary conditions.
In[286]:=
Click for copyable input
Out[286]=
Initial conditions:

No initial conditions are specified; they are deduced from the analytical solution.

Set up the initial conditions.
In[287]:=
Click for copyable input
Out[287]=
Region:

Set up the region.
In[288]:=
Click for copyable input
Out[288]=
Test 1:
In[289]:=
Click for copyable input
Out[289]=
Test 2:
Test the PDE.
In[290]:=
Click for copyable input
Out[290]=
Test 3:

Note that the activated test "FEM-NL-Transient-1D-Single-Load-0002-B" has a smaller norm than the inactive test "FEM-NL-Transient-1D-Single-Load-0002-A". This is because of the different formulation the time integration takes smaller time steps in the activated case. This is expected. You can change the behavior by either setting a "MaxStepSize" or by using a slightly different inactive formulation.

Lower the limit time step size.
In[291]:=
Click for copyable input
Out[291]=
Reformulate the inactive PDE.
In[292]:=
Click for copyable input
Out[292]=

Reaction-DiffusionFEM-NL-Transient-1D-Single-Reaction-Diffusion-0001

Test Reference:

[3], Exact Solutions > Nonlinear Partial Differential Equations >Second-Order Parabolic Partial Differential Equations > Fisher Equation; Equation 1.2.5;

Equation:

Set up the equation in inactive form.
In[293]:=
Click for copyable input
Out[293]=
Analytical solution:

Set up solution parameters.
In[294]:=
Click for copyable input
Out[294]=
Set up an analytical solution.
In[295]:=
Click for copyable input
Out[295]=
Boundary conditions:

No boundary conditions are specified; they are deduced from the analytical solution.

and

Set up the boundary conditions.
In[296]:=
Click for copyable input
Out[296]=
Initial conditions:

No initial conditions are specified; they are deduced from the analytical solution.

Set up the initial conditions.
In[297]:=
Click for copyable input
Out[297]=
Region:

Set up the region.
In[298]:=
Click for copyable input
Out[298]=
Test 1:
Test the PDE in inactive form.
In[299]:=
Click for copyable input
Out[299]=
Test 2:
Test the activated PDE.
In[300]:=
Click for copyable input
Out[300]=

2D Single Equation

This section contains examples of time-dependent partial nonlinear differential equations with one equation.

DiffusionFEM-NL-Stationary-2D-Single-Diffusion-0001

Test Reference:

[5], Example 6.3.6, page 100

Equation:

Set up the equation in inactive form.
In[301]:=
Click for copyable input
Analytical solution:

None

Manufactured solution

Set up the analytical solution.
In[302]:=
Click for copyable input
Out[302]=
Construct the right-hand side of the manufactured solution.
In[303]:=
Click for copyable input
Out[303]=
Boundary conditions:

Set up the boundary conditions.
In[304]:=
Click for copyable input
Out[304]=
Initial conditions:

No initial conditions are specified; they are deduced from the analytical solution.

Set up the initial conditions.
In[305]:=
Click for copyable input
Out[305]=
Region:

Set up the region.
In[306]:=
Click for copyable input
Out[306]=
Tests 1:
Test the PDE in inactive form.
In[307]:=
Click for copyable input
Out[307]=

A higher-quality result can be achieved by reducing the max cell measure of the mesh and further reducing the max step size. This is not done here because the test will run longer.

Test Result Inspection

This section contains the evaluation of the test runs. It works by collecting all instances of TestResultObject and generating a TestReport.

Extract TestResultObject from the notebook and generate a TestReport.
In[308]:=
Click for copyable input
Out[311]=
Inspect the failed tests run.
In[312]:=
Click for copyable input
Out[312]=

If the preceding table is empty, all tests succeeded.

References

[1]: Advanced Topics in Finite Element Analysis of Structures; Bhatti, M. Asghar; Wiley; ISBN: 978-81-265-4537-7.

[2]: Nonlinear Finite Element Analysis; Reddy, J. N.; Oxford; ISBN: 978-0-19-852529-5.

[3]: "EqWorld, The World of Mathematical Equations"; http://eqworld.ipmnet.ru.

[4]: Automated Solution of Differential Equations by the Finite Element Method; Logg, A; Mardal, K-A; Wells, G. N.; Springer; ISBN: 978-3-642-23098-1.

[5]: "Nonlinear, Transient Conduction Heat Transfer Using a Discontinuous Galerkin Hierarchical Finite Element Method"; Sanders, J. C.; http://www.phys.uconn.edu/~sanders/ThesisMain.pdf.