nivs

Untitled

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