nivs

Untitled

Dec 18th, 2012
141
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def analitInitial((A, B, C, D), x0, T):
  2.     T = arange(T[0], T[1], T[2])
  3.     x0 = array(x0)
  4.  
  5.     J, V = eig(A)
  6.     J = mt(J * eye(3, 3))
  7.     S = mt(V)
  8.     y = ([], [])
  9.  
  10.     for i in range(len(T)):
  11.         y[0].append(T[i])
  12.         yy = C * S * mt(expm(J * T[i])) * mt(inv(V)) * mt(x0).transpose()
  13.         y[1].append(array(yy[0])[0][0])
  14.     plot(y[0], y[1])
  15.     title('Analytical construction')
  16.     xlabel('t, s.')
  17.     ylabel('y(t)')
  18.     grid(color='g', linestyle='--')
  19.     show()
Advertisement
Add Comment
Please, Sign In to add comment