Ask Your Question

Revision history [back]

Here is a way, based on your code:

x0 = matrix(QQ, [[0],[1]])
x1 = matrix(QQ, [[2],[0]])
A_1 = matrix(QQ, [[0,1],[1,0],])
A_2 = matrix(QQ, [[1,0],[0,1]])

xt=x1
xt1=x0
time_series = []
for k in range(10):
    xtp1=A_1*xt+A_2*xt1
    xk=xt
    xt=xtp1
    xt1=xt
    time_series.append(xt.transpose().list())
table(time_series)