FEM Problems

FEM Problems

Below are the definitions of the types which specify problems. Some general notes are:

Poisson Equation Problem

Wraps the data that defines a 2D linear Poisson equation problem:

\[-Δu = f\]

with bounday conditions gD on the Dirichlet boundary and gN on the Neumann boundary. Linearity is determined by whether the forcing function f is a function of one variable (x) or two (u,x) (with x=[:,1] and y=[:,2]).

If the keyword σ is given, then this wraps the data that defines a 2D stochastic heat equation

\[-Δu = f + σdW\]

Constructors

PoissonProblem(f,analytic,Du,mesh): Defines the Dirichlet problem with analytical solution analytic, solution gradient Du = [u_x,u_y], and forcing function f

PoissonProblem(u0,f,mesh): Defines the problem with initial value u0 (as a function) and f. If your initial data is a vector, wrap it as u0(x) = vector.

Note: If all functions are of (x), then the program assumes it's linear. Write your functions using the math to program syntax translation: $x$ = x[:,1] and $y$ = x[:,2]. Use f=f(u,x) and σ=σ(u,x) (if specified) for nonlinear problems (with the boundary conditions still (x)). Systems of equations can be specified with u_i = u[:,i] as the ith variable. See the example problems for more help.

Keyword Arguments

Heat Equation Problem

Wraps the data that defines a 2D heat equation problem:

\[u_t = Δu + f\]

with bounday conditions gD on the Dirichlet boundary and gN on the Neumann boundary. Linearity is determined by whether the forcing function f is a function of two variables (t,x) or three (t,x,u) (with x=[:,1] and y=[:,2]).

If the keyword σ is given, then this wraps the data that defines a 2D stochastic heat equation.

\[u_t = Δu + f + σdW_t\]

Constructors

Note: If all functions are of (t,x), then the program assumes it's linear. Write your functions using the math to program syntax translation: $x$ = x[:,1] and $y$ = x[:,2]. Use f=f(t,x,u) and σ=σ(t,x,u) (if specified) for nonlinear problems (with the boundary conditions still (t,x)). Systems of equations can be specified with u_i = u[:,i] as the ith variable. See the example problems for more help.

Keyword Arguments

Example Problems

Examples problems can be found in DiffEqProblemLibrary.jl.

To use a sample problem, you need to do:

# Pkg.add("DiffEqProblemLibrary")
using DiffEqProblemLibrary

Poisson Equation

Nonlinear Poisson equation with $f(u)=1-u/2$ and $f(v)=.5u-v$ and initial condition homogenous 1/2. Corresponds to the steady state of a humogenous reaction-diffusion equation with the same $f$.

source

Problem with deterministic solution: $u(x,y)= \sin(2πx)\cos(2πy)/(8π^2)$ and additive noise $σ(x,y)=5$

source

Nonlinear Poisson equation with $f(u)=1-u/2$ and $f(v)=1-v$ and initial condition homogenous 1/2. Corresponds to the steady state of a humogenous reaction-diffusion equation with the same $f$.

source

Problem defined by the solution: $u(x,y)= \sin(2πx)\cos(2πy)/(8π^2)$

source

Nonlinear Poisson equation with $f(u)=1-u/2$. Corresponds to the steady state of a humogenous reaction-diffusion equation with the same $f$.

source

Heat Equation

Homogenous reaction-diffusion which starts at 1/2 and solves the system $f(u)=1-u/2$ and $f(v)=1-v$

source

Homogenous reaction-diffusion which starts with 1/2 and solves the system $f(u)=1-u/2$ and $f(v)=.5u-v$

source

Example problem defined by the solution:

\[u(x,y,t)=\exp(-10((x-\frac{1}{2})^2 + (y-\frac{1}{2})^2 )-t)\]

This is a Gaussian centered at $(\frac{1}{2},\frac{1}{2})$ which diffuses over time.

source

Homogenous stochastic reaction-diffusion problem which starts with 0 and solves with $f(u)=1-u/2$ with noise $σ(u)=10u^2$

source

Example problem defined by the solution:

\[u(x,y,t)=\frac{1}{10}(1-\exp(-100(t-\frac{1}{2})^2))\exp(-25((x-t+0.5)^2 + (y-t+0.5)^2))\]

This will have a mound which moves across the screen. Good animation test.

source

Example problem which starts with a Dirac δ cenetered at (0.5,0.5) and solves with $f=gD=0$. This gives the Green's function solution.

source

Homogenous reaction-diffusion problem which starts with 0 and solves with $f(u)=1-u/2$

source