Partner: Sania Ghazvini Abhari
In this project, we studied elliptic equations, which model steady states. The Laplacian of u, where u(x,y) is a twice differentiable function, is Δu=uxx+uyy. For a continuous function f(x,y), Δu(x,y)=f(x,y), and Δu(x,y) is called the Poisson equation. When f(x,y)=0, the Poisson equation is called the Laplace equation and its solution is called the harmonic function.
In this project, we solved Poisson equations using the Dirichlet boundary conditions, which specify the specific boundary values of the solution u(x,y). Using a rectangular mesh of points with M=m-1 steps in the horizontal direction and N=n-1 steps in the vertical direction, Wij is the approximate solution, where i=1,2,...,m and j=1,2,...,n. Relabeling the unknowns into a linear order that we can use gives the equation vi+(j-1)m=wij. A matrix can then be constructed Av=b and solved for v.
Hydrostatic pressure can be expressed as the hydraulic head, defined as the equivalent height u of a column of water exerting that pressure. In an underground reservior, steady-state groundwater flow satisfies the Laplace equation Δu=0. Assume that the reservoir has dimensions 2 km x 1 km, and water table heights:
u(x,0)=0.01 for 0<x<2 u(x,1)=0.01 + 0.003x for 0<x<2 u(0,y)=0.01 for 0<y<1 u(1,y)=0.01 + .006y2 for 0<y<1
on the reservoir boundary, in kilometers. We computed the head
u(1,1/2)
at the center of the reservoir using the code: Part
1 Code
Using step size 1/10, we found u(1,1/2)=.0114 km
Using two different Poisson Equations, we found the finite different approximation and error at (x,y)=(1/4,3/4) as a function of step sizes h=k=2-p for p= 2,3,4,5, so the stepsizes are: h=1/4,1/8,1/16,1/32
Part a: Part 2a Code
Actual function: u(x,y)=e-xy
Δu=e-xy(x2+y2)
u(x,0)=1 for 0<x<1
u(x,1)=e-x for
0<x<1
u(0,y)=1 for 0<y<1
u(1,y)=e-y for
0<y<1
For step sizes h=1/4,1/8,1/16,1/32:
The actual solution was: .82902912
When h=1/4:
u(1/4,3/4)= .82907488 and the error is
4.5766x10-5
h=1/8: u(1/4,3/4)= .82904214 and the error is
1.3022x10-5
h=1/16: u(1/4,3/4)= .82903248 and the error is
3.3666x10-6
h=1/32: u(1/4,3/4)= .82902997 and the error is
8.4885x10-7
The error goes down with a factor of h2 as it is supposed to.
We also used a sparse matrix and found that the error was exactly the
same. Using a zero matrix, we could only increase p to 6, and when p=7,
there was not enough memory. Using a sparse matrix, the largest p that
worked was p=7, because p=8 did not finish running the code.
As the slope of the plot is clearly 2, logu=b+2logh, which means the error is consistently a factor of h2, which is what is supposed to be using this method of approximation.
Part b: Part 2b Code
Actual function:
u(x,y)=(x2+y2)3/2
Δu=9√x2+y2
u(x,0)=x3 for
0<x<1
u(x,1)=(1+x2)3/2 for
0<x<1
u(0,y)=y3 for
0<y<1
u(1,y)=(1+y2)3/2 for
0<y<1
For step sizes h=1/4,1/8,1/16,1/32:
The actual solution was: .49410588
When h=1/4: u(1/4,3/4)=
.49608016 and the error is .002
h=1/8: u(1/4,3/4)= .49462688 and the error is
5.2099x10-4
h=1/16: u(1/4,3/4)= .49423796 and the error is
1.3208x10-4
h=1/32: u(1/4,3/4)= .49413902 and the error is
3.3136x10-4
The error goes down with a factor of h2 as it is supposed to.
We also used a sparse matrix and found that the error was exactly the
same. Using a zero matrix, we could only increase p to 6, and when p=7,
there was not enough memory. Using a sparse matrix, the largest p that
worked was p=7, because p=8 did not finish running the code.
As the slope of the plot is clearly 2, logu=b+2logh, which means the error is consistently a factor of h2, which is what is supposed to be using this method of approximation.