10. Implement the conjugate gradient algorithm for the matrix A in Exercise 5; that is, A = 2-1 -1 2. -1 -12 Try some different matrix sizes, say, n = 10, 20, 40, 80, and base your convergence criterion on the 2-norm of the residual divided by the 348 CHAPTER 12 - 2-norm of the right-hand side vector: ||b- Ax)||/|bl|. Comment on how the number of iterations required to reduce this quantity below a given level, say, 10-6, appears to be related to the matrix size. For a right-hand side vector, take b = (b₁,..., b), where b; = (i/(n + 1))², i = 1,...,n, and take the initial guess x(0) to be the zero vector. (We will see in chapter 13 that this corresponds to a finite difference method for the two-point boundary value problem: u"(x) = x², 0 < x < 1, u(0) = u(1) = 0, whose solution is u(x) = (x - x). The entries in the solution vector (x-x). 12 x of the linear system are approximations to u at the points i/(n + 1), i = 1,..., n.)

Operations Research : Applications and Algorithms
4th Edition
ISBN:9780534380588
Author:Wayne L. Winston
Publisher:Wayne L. Winston
Chapter2: Basic Linear Algebra
Section2.1: Matrices And Vectors
Problem 7P
icon
Related questions
Question

Please code this in MATLAB

10. Implement the conjugate gradient algorithm for the matrix A in Exercise
5; that is,
A =
2-1
-1 2.
-1
-12
Try some different matrix sizes, say, n
=
10, 20, 40, 80, and base
your convergence criterion on the 2-norm of the residual divided by the
Transcribed Image Text:10. Implement the conjugate gradient algorithm for the matrix A in Exercise 5; that is, A = 2-1 -1 2. -1 -12 Try some different matrix sizes, say, n = 10, 20, 40, 80, and base your convergence criterion on the 2-norm of the residual divided by the
348
CHAPTER 12
-
2-norm of the right-hand side vector: ||b- Ax)||/|bl|. Comment on how
the number of iterations required to reduce this quantity below a given
level, say, 10-6, appears to be related to the matrix size. For a right-hand
side vector, take b = (b₁,..., b), where b; = (i/(n + 1))², i = 1,...,n,
and take the initial guess x(0) to be the zero vector. (We will see in chapter
13 that this corresponds to a finite difference method for the two-point
boundary value problem: u"(x) = x², 0 < x < 1, u(0) = u(1) = 0,
whose solution is u(x) = (x - x). The entries in the solution vector
(x-x).
12
x of the linear system are approximations to u at the points i/(n + 1),
i = 1,..., n.)
Transcribed Image Text:348 CHAPTER 12 - 2-norm of the right-hand side vector: ||b- Ax)||/|bl|. Comment on how the number of iterations required to reduce this quantity below a given level, say, 10-6, appears to be related to the matrix size. For a right-hand side vector, take b = (b₁,..., b), where b; = (i/(n + 1))², i = 1,...,n, and take the initial guess x(0) to be the zero vector. (We will see in chapter 13 that this corresponds to a finite difference method for the two-point boundary value problem: u"(x) = x², 0 < x < 1, u(0) = u(1) = 0, whose solution is u(x) = (x - x). The entries in the solution vector (x-x). 12 x of the linear system are approximations to u at the points i/(n + 1), i = 1,..., n.)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Operations Research : Applications and Algorithms
Operations Research : Applications and Algorithms
Computer Science
ISBN:
9780534380588
Author:
Wayne L. Winston
Publisher:
Brooks Cole