Numerical Computing :: Project Five

$24.99 $18.99

Using the matrices from last assignment (or any others you find interesting), perform the following study: Generate a right-hand-side b of all ones of appropriate size. Solve Ax = b with a generic linear solver (eg, numpy.linalg.solve or Matlab’s backslash). Call the resulting vector truth. This is the vector against which you will compute the…

5/5 – (2 votes)

You’ll get a: zip file solution

 

Categorys:

Description

5/5 – (2 votes)

Using the matrices from last assignment (or any others you find interesting), perform the following study:

  1. Generate a right-hand-side b of all ones of appropriate size.

  1. Solve Ax = b with a generic linear solver (eg, numpy.linalg.solve or Matlab’s backslash). Call the resulting vector truth. This is the vector against which you will compute the error. Run a timing study with the generic linear solver.

  1. Write a function that solves Ax = b using either the LU decomposi-tion or the Cholesky factorization, depending on whether the matrix is symmetric or not.

  1. Write a function that solves Ax = b using the Jacobi method. Run a timing study with your function.

  1. Write a function that solves Ax = b using the Gauss-Seidel method. Run a timing study with your function.

For parts 3-5, report the relative error compared to the truth that you com-puted in part 2.

Here are some questions that might help you think about this problem.

  • Look up “diagonally dominant.” It relates to the convergence of the iterative methods.

  • Remember your paramedic training. Which methods work better for which matrices? Why do you think that is? And what do you mean by “work better”?

  • Try interpreting the results from the iterative methods in light of the theory we know about fixed point methods.

1

Numerical Computing :: Project Five
$24.99 $18.99