Starting from:

$30

CS6210-Assignment 2 Solved

Assignment 2  
Note: Please use Matlab, or a public domain approximation to it in this assignment. The code must compile on one of the lab machines with your instructions. Document your code thoroughly! 

1. This is practical example of a small but real-life-type ill-conditioned problem The flow of water through two very different materials gives this system of linear equations : 

                                                                                                                                       𝑎                                            

                                                                                                                             𝑎  𝑎                                  
                                                                                                                                            𝑎         

The coefficient a  can be very small indeed a =  1.0e-7 giving an ill-conditioned matrix.  

 

Use ∆𝑥 = 1 .If 𝐻1 = 8 𝑎𝑛𝑑 𝐻𝑟 = 4  Solve the system of equations for n= 161, where  a = 1.0, a = 1.0e-5, a = 1.0e-10 and a = 1.0e-15. Use iterative refinement to check and improve your answer if possible.  Compute the estimated condition number using the matlab condition number estimator. How does the condition number vary with the value of a 

 



2. (i) The web page has a zip file with a multigrid solver that solves the problem  

2u 2u

                               x2  y2 (sin(88x)sin(72y x y),( , )[0,1] [0,1] with sox                lution and 

                        
and (zero) boundary conditions given by utrue (x y, )  

Investigate  how large a mesh this this can run on (mine failed at 16Kx16K) and time the code to verify the linear complexity of multiugrid. Note the accuracy achieved.  

 Modify the program given on the web page Laplace2D.m which uses the Jacobi method 

2u 2u

                       to solve      x2 y2  0,( ,x y)[0,1] [0,1] with solution and x                        to solve 

boundary conditions given by  utrue (x y, )  sin(x)e(y) 

the above (multigrid problem) using the Jacobi method and the red-black Gauss Seidel method.  Try and achieve the accuracy of the multigrid method and compare performance if possible by modifying the program to include the convergence test given in the lecture notes with an infinity norm and a user-supplied tolerance, Tol 

More products