3469 - Assignment 3 Instructions Mike Peardon ( )

advertisement
3469 - Assignment 3
Mike Peardon (mjp@maths.tcd.ie)
Instructions
Complete both parts of the assignment by Monday 14th December. You should submit the
C++ source files and a short (about 2 page) pdf file containing your solutions and plots via
tcd.blackboard.com. Do not submit executables. Marks will be deducted for late submissions and any submission more than a week late will not be marked.
1
Laplace equation — Dirichlet boundary data
A field φ(x, y) takes values inside the unit square in
two dimensions and obeys the Laplace equation
∂ 2φ ∂ 2φ
+
= 0.
∂x2 ∂y 2
Figure 1 shows Ω, the unit square and the Dirichlet boundary conditions for φ, with equally-spaced
grid lines. The field takes the fixed values φ = 0
on the outer edge of Ω, φ = 1 on the boundary of
rectangle A, and φ = −1 on the boundary of rectangle B. Write C++ software to compute φ inside
Ω. Your software should use the Successive OverRelaxed (SOR) Gauss-Seidel method to find the solution.
Figure 1: Region Ω, with boundary data
By numerical experiment, find a good choice of the over-relaxation parameter ω. Compute
3 6
the value of φ( 10
, 10 ) (located at the grey circle in Fig. 1) accurate to 3sf, making sure to take
account of both the convergence criteria for your GS solver and finite-h artefacts.
2
Laplace equation — Von Neumann boundary data
Repeat the calculation keeping the Dirichlet boundary conditions on A and B but imposing
Von Neumann conditions on the external boundary of Ω. These are
∂φ
=0
∂y
∂φ
=0
∂x
on the North and South edges of Ω
on the East and West edges of Ω
Use a O(h2 )-accurate representation of the first partial derivatives on your grid. Compute the
3 6
new value of φ( 10
, 10 ) again to 3sf.
Download