Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use invpowershift.py to evaluate all eigenvalues and all eigenvectors for: ( [ 3 , 1 , 2 ] , [ 1 , 4 , 3

Use invpowershift.py to evaluate all eigenvalues and all eigenvectors for:
([3,1,2],[1,4,3],[2,3,1]) in python.
invpowershift.py:
from triang import forsub, backsub, testcreate
from ludec import ludec
from jacobi import termcrit
from power import mag, testeigone
import numpy as np
def invpowershift (A, shift =20,kmax=200, tol =1.e-8):
n=A. shape 0
znews = np.ones (n)
qnews = znews ?mag(znews)
Astar = A - np.identity(n)*shift
L,U= ludec (Astar)
for k in range (1,kmax) :
qs=np. copy (qnews)
ys = forsub(L, qs)
znews = backsub(U,ys)
qnews = znews ?? mag (znews)
if qs@qnews 0 :
qnews =- qnews
err = termcrit(qs, qnews)
print (k, qnews, err)
if err tol:
lam = qnews@A@qnews
break
else:
lam = qnews = None
return lam, qnews
if _=='-':
A, bs = testcreate (4,21)
testeigone(invpowershift,A)
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Mike Morrison, Joline Morrison

1st Edition

061901556X, 978-0619015565

More Books

Students also viewed these Databases questions

Question

What are Decision Trees?

Answered: 1 week ago

Question

What is meant by the Term Glass Ceiling?

Answered: 1 week ago