chap2/zoh1.py
changeset 0 0efde00f9229
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/chap2/zoh1.py	Fri May 27 14:24:59 2011 +0530
@@ -0,0 +1,25 @@
+#!/usr/bin/python
+## 2.3
+
+import os, sys
+curdir = os.getcwdu()
+n = curdir.rfind("/")
+curdir[:n]+"/python"
+sys.path += [curdir[:n]+"/python"]
+
+import scipy as sp
+from scipy import signal
+from scipy import linalg
+
+from dscr import dscr
+
+
+F = sp.array([[-1,0],[1,0]])
+G = sp.array([[1],[0]])
+C = sp.array([0,1])
+D = 0
+Ts = 1
+H = signal.lti(F, G, C, D)
+
+h = dscr(H, Ts)
+print h.A, h.B, h.C, h.D, Ts