Question: a ) Create a Python function called SpectralRadius that finds the spectral radius of a matrix T . Here T will depend on a matrix
a Create a Python function called SpectralRadius that finds the spectral radius of a matrix Here will depend on a matrix such that
where
cdots,
ddots,vdots
vdots,ddots,ddots,
cdots,
cdots,
ddots,vdots
vdots,ddots,ddots,
cdots,cdots,
ddots,vdots
vdots,ddots,ddots,
cdots,cdots,
ddots,vdots
vdots,ddots,ddots,
cdots,
The function needs to:
accept a matrix ;
return the spectral radius of
Y def SpectralRadiusA:
'Calculate the spectral radius of a matrix where is the main diagonal of
is the lower triangular matrix of A multiplied elementwise by minus and is the upper
triangular matrix of A multiplied elementwise by minus
Parameters
A: nxn matrix
Returns
radius : spectral radius of
Usage### YOUR CODE HERE ###
b Consider the linear system given by
Jsing the two functions above, plot the spectral radius and number of iterations required for the cases Again, use a tolerance of and a
naximum number of iterations.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
