2
2
3
3
The lti module contains the LTI parent class to the child classes StateSpace
4
4
and TransferFunction. It is designed for use in the python-control library.
5
-
6
- Routines in this module:
7
-
8
- LTI.__init__
9
- isdtime()
10
- isctime()
11
- timebase()
12
- common_timebase()
13
5
"""
14
6
15
7
import numpy as np
16
8
17
- from numpy import absolute , real , angle , abs
9
+ from numpy import real , angle , abs
18
10
from warnings import warn
19
11
from . import config
20
- from .namedio import NamedIOSystem , isdtime
12
+ from .namedio import NamedIOSystem
21
13
22
14
__all__ = ['poles' , 'zeros' , 'damp' , 'evalfr' , 'frequency_response' ,
23
15
'freqresp' , 'dcgain' , 'bandwidth' , 'pole' , 'zero' ]
@@ -110,21 +102,21 @@ def damp(self):
110
102
Returns
111
103
-------
112
104
wn : array
113
- Natural frequencies for each system pole
105
+ Natural frequency for each system pole
114
106
zeta : array
115
107
Damping ratio for each system pole
116
108
poles : array
117
- Array of system poles
109
+ System pole locations
118
110
'''
119
111
poles = self .poles ()
120
112
121
113
if self .isdtime (strict = True ):
122
114
splane_poles = np .log (poles .astype (complex ))/ self .dt
123
115
else :
124
116
splane_poles = poles
125
- wn = absolute (splane_poles )
126
- Z = - real (splane_poles )/ wn
127
- return wn , Z , poles
117
+ wn = abs (splane_poles )
118
+ zeta = - real (splane_poles )/ wn
119
+ return wn , zeta , poles
128
120
129
121
def frequency_response (self , omega , squeeze = None ):
130
122
"""Evaluate the linear time-invariant system at an array of angular
@@ -346,25 +338,23 @@ def zero(sys):
346
338
347
339
def damp (sys , doprint = True ):
348
340
"""
349
- Compute natural frequency, damping ratio, and poles of a system
350
-
351
- The function takes 1 or 2 parameters
341
+ Compute natural frequencies, damping ratios, and poles of a system
352
342
353
343
Parameters
354
344
----------
355
- sys: LTI (StateSpace or TransferFunction)
345
+ sys : LTI (StateSpace or TransferFunction)
356
346
A linear system object
357
- doprint:
358
- if true , print table with values
347
+ doprint : bool (optional)
348
+ if True , print table with values
359
349
360
350
Returns
361
351
-------
362
- wn: array
363
- Natural frequencies of the poles
364
- damping : array
365
- Damping values
366
- poles: array
367
- Pole locations
352
+ wn : array
353
+ Natural frequency for each system pole
354
+ zeta : array
355
+ Damping ratio for each system pole
356
+ poles : array
357
+ System pole locations
368
358
369
359
See Also
370
360
--------
@@ -374,37 +364,37 @@ def damp(sys, doprint=True):
374
364
-----
375
365
If the system is continuous,
376
366
wn = abs(poles)
377
- Z = -real(poles)/poles.
367
+ zeta = -real(poles)/poles
378
368
379
369
If the system is discrete, the discrete poles are mapped to their
380
370
equivalent location in the s-plane via
381
371
382
- s = log10 (poles)/dt
372
+ s = log (poles)/dt
383
373
384
374
and
385
375
386
376
wn = abs(s)
387
- Z = -real(s)/wn.
377
+ zeta = -real(s)/wn.
388
378
389
379
Examples
390
380
--------
391
381
>>> G = ct.tf([1], [1, 4])
392
- >>> wn, damping , poles = ct.damp(G)
393
- _____Eigenvalue______ Damping___ Frequency_
394
- -4 1 4
382
+ >>> wn, zeta , poles = ct.damp(G)
383
+ Eigenvalue (pole) Damping Frequency
384
+ -4 1 4
395
385
396
386
"""
397
- wn , damping , poles = sys .damp ()
387
+ wn , zeta , poles = sys .damp ()
398
388
if doprint :
399
- print ('_____Eigenvalue______ Damping___ Frequency_ ' )
400
- for p , d , w in zip (poles , damping , wn ):
389
+ print (' Eigenvalue (pole) Damping Frequency ' )
390
+ for p , z , w in zip (poles , zeta , wn ):
401
391
if abs (p .imag ) < 1e-12 :
402
- print ("%10.4g %10.4g %10.4g" %
403
- (p .real , 1.0 , - p . real ))
392
+ print (" %10.4g %10.4g %10.4g" %
393
+ (p .real , 1.0 , w ))
404
394
else :
405
- print ("%10.4g%+10.4gj %10.4g %10.4g" %
406
- (p .real , p .imag , d , w ))
407
- return wn , damping , poles
395
+ print ("%10.4g%+10.4gj %10.4g %10.4g" %
396
+ (p .real , p .imag , z , w ))
397
+ return wn , zeta , poles
408
398
409
399
410
400
def evalfr (sys , x , squeeze = None ):
0 commit comments