Hi group,
is there a faster way to calculate the
matrix exponential for different t's
than this:
def sol_matexp(A, tlist, y0):
w, v = np.linalg.eig(A)
out = np.zeros((tlist.size, y0.size))
for i, t in enumerate(tlist):
sol_t = np.dot(v,np.diag(np.exp(-w*t))).dot(np.linalg.inv(v)).dot(y0)
out[i, :] = sol_t
return out
This is the calculates exp(-Kt).dot(y0) for a list a ts.
greetings
Till
_______________________________________________
NumPy-Discussion mailing list
[email protected]
http://mail.scipy.org/mailman/listinfo/numpy-discussion