Question: 3. Implement all of this in python/numpy (or your favorite computer environment). Write a function jacobi(alfa,n) which has the Jacobi matrix J n as output.
3. Implement all of this in python/numpy (or your favorite computer environment). Write a function jacobi(alfa,n) which has the Jacobi matrix J n as output. Next write a function gauss(alfa,n) which has the x j,n and j,n as output. Hint: use the function diag from NumPy for the manipulation of diagonals in a matrix, and linalg.eig for the calculation of eigenvalues and eigenvectors. The Gamma function can be computed with math.gamma. 4. Verify numerically that for a polynomial f of degree 2n 1 the numerical integration formula I n (f ) has the exact values of the integral I(f ).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
