def _analytical_solution(a, y0, t):
 (lam, v) = np.linalg.eig(a)
 c = np.linalg.solve(v, y0)
 e = (c * np.exp((lam * t.reshape((-1), 1))))
 sol = e.dot(v.T)
 return sol

def _analytical_solution ( a , y0 , t ) : ( lam , v ) = np . linalg . eig ( a ) c = np . linalg . solve ( v , y0 ) e = ( c * np . exp ( ( lam * t . reshape ( ( - 1 ) , 1 ) ) ) ) sol = e . dot ( v . T ) return sol
analytical solution to the linear differential equations dy/dt = a*y .