To follow up on this question I am new to python and I am trying to calculate the exponential of a product Matrix - Scalar using vectorization (if possible)
What I did:
n=10
t_ = np.arange(1,n+1)*5*np.pi/n
a_11,a_12, a_21, a_22=0,1,-1,-1
x_0,v_0=1,1
A = np.array([[a_11,a_12], [a_21, a_22]])
A_ = np.array([A for k in range (1,n+1,1)])
X_0 = np.array([[x_0],[v_0]]) # build X_0
print A
x_=scipy.linalg.expm(t_[:,None,None]*A[None,:,:])*X_0
I get the following error within linalg.expm:
ValueError: expected a square matrix
Any help is much appreciated.