Question: import numpy as np from copy import copy copy your vector norm function here def VNorm ( v , p ) : nrm = 0
import numpy as np
from copy import copy
copy your vector norm function here
def VNormvp:
nrm
if p npinf:
nrm npmaxnpabsv # Infinity norm max absolute value in v
else:
nrm npsumnpabsvpp # pnorm calculation
returnnrm
define a function
name : Jacobi
inputs : A d numpy array size nxn positive definite
xd numpy array starting value
bd numpy array righthandside vector
output : x d numpy array approximate solution to Axb
k integer number of iterations performed
note : do not use the matrix formulation of the algorithm
note : The function should work for any size rectangular array
note : use a tolerance of e as a stopping criterion
def JacobiAxb:
# add code here
returnxk
define a function
name : Jacobimatrix
inputs : A d numpy array size nxn positive definite
xd numpy array starting value
bd numpy array righthandside vector
output : x d numpy array approximate solution to Axb
k integer number of iterations performed
note : use the matrix formulation of the algorithm
note : The function should work for any size rectangular array
note : use a tolerance of e as a stopping criterion
def JacobimatrixAxb:
# add code here
returnxk
define a function
name : GaussSeidel
inputs : A d numpy array size nxn positive definite
xd numpy array starting value
bd numpy array righthandside vector
output : x d numpy array approximate solution to Axb
k integer number of iterations performed
note : do not use the matrix formulation of the algorithm
note : The function should work for any size rectangular array
note : use a tolerance of e as a stopping criterion
def GaussSeidelAxb:
# add code here
returnxk
define a function
name : GaussSeidelmatrix
inputs : A d numpy array size nxn positive definite
xd numpy array starting value
bd numpy array righthandside vector
output : x d numpy array approximate solution to Axb
k integer number of iterations performed
note : use the matrix formulation of the algorithm
note : The function should work for any size rectangular array
note : use a tolerance of e as a stopping criterion
def GaussSeidelmatrixAxb:
# add code here
returnxk
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
