x= vector([1,1,1,1,1,1,1])
k=10
html('<p>$x_0 =%s$<p>'%( latex(x) ) )
for i in range(k):
y=A*x
ymod=y.apply_map(abs)
c1=max(ymod)
x=y/c1
print "Iteration number", i+1
html('$c_1=%s$ and $x_%s=%s$' %(c1.n(digits=7),i+1,latex(x.n(digits=7))) )
html('Dominant eigenvalue :$ \lambda_{1} \\approx %s $'%(latex(c1.n(digits=5))))
|
Iteration number 1
and
Iteration number 2
and
Iteration number 3
and
Iteration number 4
and
Iteration number 5
and
Iteration number 6
and
Iteration number 7
and
Iteration number 8
and
Iteration number 9
and
Iteration number 10
and
Dominant eigenvalue :
Iteration number 1
and
Iteration number 2
and
Iteration number 3
and
Iteration number 4
and
Iteration number 5
and
Iteration number 6
and
Iteration number 7
and
Iteration number 8
and
Iteration number 9
and
Iteration number 10
and
Dominant eigenvalue :
|