Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 21 MA471 Fall 03. Recall Jacobi Smoothing We recall that the relaxed Jacobi scheme: Smooths out the highest frequency modes fastest.

Similar presentations


Presentation on theme: "Lecture 21 MA471 Fall 03. Recall Jacobi Smoothing We recall that the relaxed Jacobi scheme: Smooths out the highest frequency modes fastest."— Presentation transcript:

1 Lecture 21 MA471 Fall 03

2 Recall Jacobi Smoothing We recall that the relaxed Jacobi scheme: Smooths out the highest frequency modes fastest

3 Two Grid Algorithm First we smooth the solution for a number of steps:

4 Next We Apply a Coarse Grid Correction Now suppose the current approximation x k satisfies the Ax=b system approximately: For some r We can figure out how much x k needs to be corrected by:

5 cont So in an ideal world we could compute: And we would be done, as x solves Ax=b However, we noted before that the relaxed Jacobi solver does a good job of reducing the error in high-frequency modes so we can assume that the correction is a low frequency correction, so let’s compute the correction in * on a coarse grid. *

6 Restriction Step (Rr) The first step is to compute the residual r on the fine mesh and transfer it to the coarse mesh: Periodic length Fine Coarse The arrows indicate which fine nodes are linearly combined to obtain the coarse version

7 Formula For Restriction This is the restriction operator corresponding to the above formula for 8 fine nodes and 4 coarse nodes: We use a weighted average of the residual on the fine grid:

8 The Coarse System A c There is a certain freedom in how to build the coarse approximation to the system. A simple approach is to set up a matrix for the discrete heat equation, but using the coarse nodes.

9 Prolongation After having computed the correction on the coarse grid we need to transfer it to the fine grid. In this case we will preserve the correction values at nodes which belong to both coarse and fine grid. For other nodes we will use averaging. Fine Coarse

10 Formula For Prolongation of a Vector v Prolongation operator mapping a vector of 4 coarse values to 8 fine values.

11 Comparison of Prolongation and Restriction Matrices Note R = 0.5*transpose(P)

12 Summary of Two-Grid Scheme Smooth a few times on the fine grid (using relaxed Jacobi iterations). Restrict the r=b-Ax residual to the coarse grid (Rr) Solve the coarse grid problem Prolongate this correction to the fine grid ( ) Update the solution Smooth a few more times to remove high- frequency errors from prolongation and restriction

13 Summary: of a single stage of the two grid iterative algorithm

14 1)Presmoothing: 2)Fine grid residual 3)Fine to coarse grid restriction 4)Solving the coarse grid analog 5)Prolongation and coarse grid correction 6)Post smoothing:

15 Example: 1D Heat Equation I wrote a simple matlab code which solves the 1D equation (see previous lectures): On the unit interval [0,1) with periodicity.

16 Heatmatrix1d Routine

17 Set up fine grid system

18 Set up coarse grid system Set up sparse restriction and prolongation matrices

19 80-82) presmooth 85) Coarse grid residual 88) Restriction and coarse grid correction solve 91) Prolongation and adding coarse grid correction to fine grid solution 94-96) post smoothing 98) Compute residual

20 Worst Possible Case So to see if the multigrid is working as advertised I set b=sin(2*pi*x) with initial guess x=0 i.e. I activated one of the lowest frequency error modes. I ran relaxed Jacobi – which applies very little damping to the lowest error mode. I then ran the two-grid solver…

21 Comparison of Relaxed Jacobi and the Two Grid Solver Two-grid: N=25600 15 iterations and 2.694 seconds to achieve 10 decimal place convergence. Relaxed Jacobi: N=25600 590 iterations and 89.5680 seconds to achieve 10 decimal place convergence.

22 Summary By design the two-grid solver does indeed increase the decay rate for the lower frequency error modes. The results seem great for the two-grid solver – however, in this case we used an exact solve for the coarse grid problem. In reality this would normally be very expensive (although much less expensive than solving the full problem). In a multigrid solver we would replace the coarse grid solve with recursively applied smoothing on a sequence of successively coarser grids and apply the coarse grid correction on an extremely coarse grid.

23 Next Time Spectral methods for solving simple PDE’s Description of final project options.


Download ppt "Lecture 21 MA471 Fall 03. Recall Jacobi Smoothing We recall that the relaxed Jacobi scheme: Smooths out the highest frequency modes fastest."

Similar presentations


Ads by Google