55Routines in this module:
66
77sample_system()
8+ c2d()
89"""
910
1011"""Copyright (c) 2012 by California Institute of Technology
@@ -58,16 +59,19 @@ def sample_system(sysc, Ts, method='zoh', alpha=None, prewarp_frequency=None):
5859
5960 Parameters
6061 ----------
61- sysc : LTI (StateSpace or TransferFunction)
62+ sysc : LTI (:class:` StateSpace` or :class:` TransferFunction` )
6263 Continuous time system to be converted
63- Ts : real > 0
64+ Ts : float > 0
6465 Sampling period
6566 method : string
6667 Method to use for conversion, e.g. 'bilinear', 'zoh' (default)
67-
68- prewarp_frequency : real within [0, infinity)
68+ alpha : float within [0, 1]
69+ The generalized bilinear transformation weighting parameter, which
70+ should only be specified with method="gbt", and is ignored
71+ otherwise. See :func:`scipy.signal.cont2discrete`.
72+ prewarp_frequency : float within [0, infinity)
6973 The frequency [rad/s] at which to match with the input continuous-
70- time system's magnitude and phase
74+ time system's magnitude and phase (only valid for method='bilinear')
7175
7276 Returns
7377 -------
@@ -76,7 +80,7 @@ def sample_system(sysc, Ts, method='zoh', alpha=None, prewarp_frequency=None):
7680
7781 Notes
7882 -----
79- See :meth:`StateSpace.sample` or :meth:`TransferFunction.sample`` for
83+ See :meth:`StateSpace.sample` or :meth:`TransferFunction.sample` for
8084 further details.
8185
8286 Examples
@@ -89,7 +93,8 @@ def sample_system(sysc, Ts, method='zoh', alpha=None, prewarp_frequency=None):
8993 if not isctime (sysc ):
9094 raise ValueError ("First argument must be continuous time system" )
9195
92- return sysc .sample (Ts , method , alpha , prewarp_frequency )
96+ return sysc .sample (Ts ,
97+ method = method , alpha = alpha , prewarp_frequency = prewarp_frequency )
9398
9499
95100def c2d (sysc , Ts , method = 'zoh' , prewarp_frequency = None ):
@@ -98,20 +103,19 @@ def c2d(sysc, Ts, method='zoh', prewarp_frequency=None):
98103
99104 Parameters
100105 ----------
101- sysc : LTI (StateSpace or TransferFunction)
106+ sysc : LTI (:class:` StateSpace` or :class:` TransferFunction` )
102107 Continuous time system to be converted
103- Ts : real > 0
108+ Ts : float > 0
104109 Sampling period
105110 method : string
106111 Method to use for conversion, e.g. 'bilinear', 'zoh' (default)
107-
108112 prewarp_frequency : real within [0, infinity)
109113 The frequency [rad/s] at which to match with the input continuous-
110- time system's magnitude and phase
114+ time system's magnitude and phase (only valid for method='bilinear')
111115
112116 Returns
113117 -------
114- sysd : linsys
118+ sysd : LTI of the same class
115119 Discrete time system, with sampling rate Ts
116120
117121 Notes
@@ -126,6 +130,7 @@ def c2d(sysc, Ts, method='zoh', prewarp_frequency=None):
126130 """
127131
128132 # Call the sample_system() function to do the work
129- sysd = sample_system (sysc , Ts , method , prewarp_frequency )
133+ sysd = sample_system (sysc , Ts ,
134+ method = method , prewarp_frequency = prewarp_frequency )
130135
131136 return sysd
0 commit comments