|
From: <kk...@us...> - 2011-02-08 22:17:19
|
Revision: 91
http://python-control.svn.sourceforge.net/python-control/?rev=91&view=rev
Author: kkchen
Date: 2011-02-08 22:17:13 +0000 (Tue, 08 Feb 2011)
Log Message:
-----------
freqresp now sorts omega, to be more like MATLAB.
Kevin K. Chen <kk...@pr...>
Modified Paths:
--------------
branches/control-0.4a/src/matlab.py
branches/control-0.4a/src/statesp.py
branches/control-0.4a/src/xferfcn.py
Modified: branches/control-0.4a/src/matlab.py
===================================================================
--- branches/control-0.4a/src/matlab.py 2011-02-08 22:17:07 UTC (rev 90)
+++ branches/control-0.4a/src/matlab.py 2011-02-08 22:17:13 UTC (rev 91)
@@ -646,7 +646,7 @@
Parameters
----------
sys: StateSpace or TransferFunction object
- omega: list, tuple, or ndarray
+ omega: list or ndarray
Returns
-------
@@ -662,7 +662,8 @@
Notes
-----
This function is a wrapper for StateSpace.freqresp and
- TransferFunction.freqresp.
+ TransferFunction.freqresp. The output omega is a sorted version of the
+ input omega.
Examples
--------
Modified: branches/control-0.4a/src/statesp.py
===================================================================
--- branches/control-0.4a/src/statesp.py 2011-02-08 22:17:07 UTC (rev 90)
+++ branches/control-0.4a/src/statesp.py 2011-02-08 22:17:13 UTC (rev 91)
@@ -301,7 +301,8 @@
reports the value of the magnitude, phase, and angular frequency of the
system's transfer function matrix evaluated at s = i * omega, where
- omega is a list of angular frequencies.
+ omega is a list of angular frequencies, and is a sorted version of the
+ input omega.
"""
@@ -311,6 +312,8 @@
phase = empty((self.outputs, self.inputs, numfreq))
fresp = empty((self.outputs, self.inputs, numfreq), dtype=complex)
+ omega.sort()
+
for k in range(numfreq):
fresp[:, :, k] = self.evalfr(omega[k])
Modified: branches/control-0.4a/src/xferfcn.py
===================================================================
--- branches/control-0.4a/src/xferfcn.py 2011-02-08 22:17:07 UTC (rev 90)
+++ branches/control-0.4a/src/xferfcn.py 2011-02-08 22:17:13 UTC (rev 91)
@@ -386,7 +386,7 @@
reports the value of the magnitude, phase, and angular frequency of the
transfer function matrix evaluated at s = i * omega, where omega is a
- list of angular frequencies.
+ list of angular frequencies, and is a sorted version of the input omega.
"""
@@ -395,6 +395,8 @@
mag = empty((self.outputs, self.inputs, numfreq))
phase = empty((self.outputs, self.inputs, numfreq))
+ omega.sort()
+
for i in range(self.outputs):
for j in range(self.inputs):
fresp = map(lambda w: (polyval(self.num[i][j], w * 1.j) /
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|