Question: def jacobi ( A , b , p 0 , tol, maxIter = 1 0 0 ) : n = len ( A ) p
def jacobiA b p tol, maxIter:
nlenA
p p
for k in rangemaxIter:
pold pcopy # In python assignment is not the same as
copyfor i in rangen:
sumi bi;
for j in rangen:
if ij: # Diagonal elements are not included in
Jacobi
continue;
sumi sumi Aij poldj
pi sumiAii
relerror nplinalg.normppoldn # Actually n should be
replace by norm of pif relerror
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
