Please use Matlab, the variable "N" for a square matrix and the variable "tolerance" for any numerical tolerance needed
Please use Matlab • Algorithm needs to work for any N by N square matrix, use the variable N. • For computations needing numerical tolerance use the variable tolerance = sqrt(eps) or tolerance = np.finfo(float).eps • Use format long command to display all available digits 1. Generate Random Matrices with Specified Eigenvalues (a) (5 pts) Generate a random symmetric matrix, with eigenvalues {1,2, ...,N}. Use the similarity relation Α = QΛQ* = where Q is a random unitary (N < N) matrix, and A a diagonal matrix with the eigenvalues on the diagonal. VERIFY, using a library call (Matlab / Python / R / ???) that your matrices indeed have the desired eigenvalues. SUBMIT: Code, and verification (output) for N= 20. (b) (5 pts) Generate a random non-symmetric matrix, with eigenvalues {1, 2, ...,N}. Use the similarity relation A= QTQ* where Q is a random unitary (N < N) matrix, and T a triangular matrix with the eigenvalues on the diagonal, and non-zeros in the upper triangular part. VER- IFY, using a library call (Matlab / Python / R / ???) that your matrices indeed have the desired eigenvalues. SUBMIT: Code, and verification (output) for N= 20. (c) Transform the Matrix into a more convenient Form for Iterations (5 pts) Transform A into upper Hessenberg form; you may use a library call, or code from previous homework. VERIFY the form by plotting the elements that are greater in magnitude than tolerance; use e.g. the Matlab spy, or the python matplotlib.pyplot.spy commands?. SUBMIT: Code, and verification (output) for N= 20.
Please use Matlab • Algorithm needs to work for any N by N square matrix, use the variable N. • For computations needing
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Please use Matlab • Algorithm needs to work for any N by N square matrix, use the variable N. • For computations needing
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!