Question: Python Code 4. (25 points) (30 points for UG) Conjugate Gradient (CG): Let Abe nxn positive definite matrix. Implement the CG method for solving the

Python Code

Python Code 4. (25 points) (30 points for UG) Conjugate Gradient (CG):

4. (25 points) (30 points for UG) Conjugate Gradient (CG): Let Abe nxn positive definite matrix. Implement the CG method for solving the linear system Ar-b as outlined below Initialize xo; Set ro - Azo -b; while rk / 0 do k+1 TK Tk end Apply your algorithm to solve a linear system in which Aij -1/(i+j-1) and b- (1,1,... ,1)7. Set the initial point zo 0 and try dimensions 5,8. Report the number of iterations required to reduce the residual below 10-6. Verify your solutions by comparing your results with the builtin scipy solveir. 4. (25 points) (30 points for UG) Conjugate Gradient (CG): Let Abe nxn positive definite matrix. Implement the CG method for solving the linear system Ar-b as outlined below Initialize xo; Set ro - Azo -b; while rk / 0 do k+1 TK Tk end Apply your algorithm to solve a linear system in which Aij -1/(i+j-1) and b- (1,1,... ,1)7. Set the initial point zo 0 and try dimensions 5,8. Report the number of iterations required to reduce the residual below 10-6. Verify your solutions by comparing your results with the builtin scipy solveir

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!