
Programming Report for Project1
3190103472 Kangjie Ding
2022.3.29
The experiment design
The main idea in this experiment is applying FD methods to solve BVP.Here we’re given two problem domains,the
regular one and the irregular one,as well as three boundary conditions,Dirichlet,Neumann and mixed.Thus,we’ll con-
sider six combinations.However,the key point in the implementation of BVP solver related to these different situations
lies in constructing the corresponding linear systems and solving them.
Compared to irregular domain,it may be less strenuous to obtain the linear system for the regular domain.Since we
have talked all these three boundary conditions in one dimension,what we should do is transplant the argument to
two dimension.Besides,we should pay attention to the use of ghost cell in the case of Neumann condition and mixed
condition.
As required in programming assignments,we’ll implement a Validity-Check function for the irregular domain,which
can check whether Ω\D cover at least four grid number and keeps connected.
To make our program more flexible,a input file,which stores user-specified parameters,is included in the project.Here
we use json to support our input file.Besides problem domain and boundary condition,the center and the radius of the
disk as well as parameters(they are α and β) in the mixed condition(αu + β
∂u
∂n
= σ) are also listed in the input.json.
In the experiment,we’ll test three different function,they are u
1
= e
x
2
+y
2
,u
2
= e
sinx+y
and u
3
= e
x+y
.
PS:All the statistic data will be kept in a file named result.txt.
Experiment results
In this section,we’re going to show 1-,2- and ∞− norms of errors for different combinations of problem domain and
boundary condition,and then get the corresponding convergence rates on the four grids.This procedure will be applied
for these three functions.Besides,we’ll also verify some analytic results in the next section based on the results in this
section combined with the statistic data stored in result.txt.
Here we use r
2
to represent the convergence rate of 2-norm and r
i
the convergence of ∞−norm.We neglect the
convergence rate of 1-norm,since we can conclude that 1-norm of errors diverges from following figures.We also use
||E
1
|| to represent error norm on n=8,and ||E
2
||, ||E
3
||, ||E
4
|| for n=16,32,64 respectively.
1. Regular domain
(a) Dirichlet b oundary condition
i. u
1
= e
x
2
+y
2
1