Created
October 3, 2014 10:12
-
-
Save drvinceknight/7b479fd1cd0868e4590c to your computer and use it in GitHub Desktop.
Modification of the interact at http://interact.sagemath.org/node/39
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@interact | |
def _(A=matrix(RDF,3,3,[8,2,0,1,7,2,1,3,6])/10,x_init=("$\pi^{(0)}$",vector([.2,.5,.3]))): | |
x_init = vector(x_init) | |
data = [x_init * (A^i) for i in range(20)] | |
pi = zip(*data) | |
p = line(enumerate(pi[0]),color='red',legend_label='$\pi_1$',thickness=3) | |
p += line(enumerate(pi[1]),color='blue',legend_label='$\pi_2$',thickness=3) | |
p += line(enumerate(pi[2]),color='green',legend_label='$\pi_3$',thickness=3) | |
p.ymax(1) | |
show(p) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment