place/unstb.py
changeset 0 0efde00f9229
equal deleted inserted replaced
-1:000000000000 0:0efde00f9229
       
     1 #!/usr/bin/python 
       
     2 # 9.7
       
     3 import os, sys
       
     4 sys.path += [os.getcwdu() + os.sep + ".." + os.sep + "python"]
       
     5 
       
     6 import scipy as sp
       
     7 from scipy import signal
       
     8 from zpowk import zpowk
       
     9 from pp_basic import pp_basic
       
    10 from desired import desired
       
    11 
       
    12 Ts = 1
       
    13 B = sp.array([1, -3])
       
    14 A = sp.array([1, 2, -8])
       
    15 k = 1
       
    16 
       
    17 # Since k=1, tf is of the form z^-1
       
    18 zk, dzk = zpowk(k) 
       
    19 
       
    20 
       
    21 # Transient specifications
       
    22 rise = 10
       
    23 epsilon = 0.1
       
    24 phi = desired(Ts, rise, epsilon)
       
    25 
       
    26 # Controller design
       
    27 Rc, Sc, Tc, gamm = pp_basic(B, A, k, phi)
       
    28 
       
    29 # Setting up simulation parameters for basic
       
    30 st = 1.0 # desired change in h, in m.
       
    31 t_init = 0  # simulation start time
       
    32 t_final = 1000 # simulation end time
       
    33 
       
    34 # Setting up simulation parameters for c_ss_cl
       
    35 N_var = 0
       
    36 N = 1
       
    37 C = 0 
       
    38 D = 1
       
    39