Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1a6d806
eliminate _evalfr in lti system classes, replaced with __call__, whic…
sawyerbfuller Aug 14, 2020
b05492c
fixed remaining failing unit tests and cleanup of docfiles
sawyerbfuller Aug 16, 2020
2c4ac62
minor fix following suggested change in frd str method
sawyerbfuller Aug 16, 2020
6213a54
fixed a few bugs that slipped through
sawyerbfuller Aug 16, 2020
8486b7a
Update control/frdata.py
sawyerbfuller Aug 17, 2020
c8bf92f
Update control/frdata.py
sawyerbfuller Aug 17, 2020
371986c
Update control/lti.py
sawyerbfuller Aug 17, 2020
d8fbaa0
Update control/statesp.py
sawyerbfuller Aug 17, 2020
17bc2a8
Apply suggestions from code review
sawyerbfuller Aug 17, 2020
4ad33db
suggested changes in docstrings
sawyerbfuller Aug 17, 2020
94322c8
Merge remote-tracking branch 'origin/call-method' into call-method
sawyerbfuller Aug 17, 2020
60433e0
better docstrings conforming to numpydoc
sawyerbfuller Aug 17, 2020
262fde6
converted statesp.horner to take care of trying to use slycot_horner …
sawyerbfuller Aug 17, 2020
4c3ed0b
renamed slycot_horner to slycot_laub
sawyerbfuller Aug 17, 2020
b37c16b
docs more consistent
sawyerbfuller Aug 17, 2020
4e4b97f
forgot to change a variable name everywhere in a function
sawyerbfuller Aug 17, 2020
5626a3a
revert doc/control.rst
bnavigator Aug 18, 2020
5caffa4
Update control/xferfcn.py
sawyerbfuller Aug 19, 2020
c888b6e
numpydoc convention updates
sawyerbfuller Aug 19, 2020
b64145d
small update to facilitate merge maybe
sawyerbfuller Aug 19, 2020
3cf80af
small numpydoc change in trasnferfunction to resolve merge
sawyerbfuller Aug 19, 2020
330e517
unit tests now test for deprecation of sys.freqresp
sawyerbfuller Aug 19, 2020
8c9571d
Merge branch 'master' into call-method
sawyerbfuller Aug 19, 2020
195bec3
rebase sawyerbfuller-call-method against master
murrayrm Jan 6, 2021
6b82c3c
Merge commit '195bec3' into call-method-mergeinto
bnavigator Jan 6, 2021
bddc792
fix merge strategy 'errors'
bnavigator Jan 6, 2021
e9bff6a
restore test_phase_crossover_frequencies_mimo
bnavigator Jan 6, 2021
73fc6a6
reinstate second check in frd_test test_eval()
bnavigator Jan 6, 2021
7acfc77
statesp_test: rename from test_evalfr to test_call
bnavigator Jan 6, 2021
a26520d
statesp_test: remove duplicate test_pole_static and test_copy_constru…
bnavigator Jan 6, 2021
dae8d42
Update control/xferfcn.py
sawyerbfuller Jan 6, 2021
3b10af0
check for warning the pytest way
bnavigator Jan 6, 2021
1bf445b
add unit tests for freqresp/evalfr warnings/errors
murrayrm Jan 7, 2021
3dbaacd
test frd freqresp deprecation
bnavigator Jan 7, 2021
178bfa0
doc updates to specify frequency response outputs more precisely
sawyerbfuller Jan 7, 2021
a631098
missed a couple of doc updates in xferfcn
sawyerbfuller Jan 7, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions control/frdata.py
Original file line number Diff line number Diff line change
Expand Up @@ -352,10 +352,11 @@ def eval(self, omega, squeeze=True):
entry in the omega vector. An interpolating FRD can return
intermediate values.

Parameters
----------
squeeze: bool, optional (default=True)
If True and sys is single input, single output (SISO), return a
1D array or scalar the same length as omega.

"""
omega_array = np.array(omega, ndmin=1) # array-like version of omega
if any(omega_array.imag > 0):
Expand Down Expand Up @@ -391,12 +392,24 @@ def __call__(self, s, squeeze=True):
transfer function. For a MIMO transfer fuction, returns a
matrix of values.

Raises an error if s is not purely imaginary.

Parameters
----------
Comment thread
sawyerbfuller marked this conversation as resolved.
s : scalar or array_like
Complex frequencies
squeeze: bool, optional (default=True)
If True and sys is single input, single output (SISO), return a
1D array or scalar depending on omega's length.

Returns
-------
ndarray or scalar
Frequency response

Raises
------
ValueError
If `s` is not purely imaginary.

"""
if any(abs(np.array(s, ndmin=1).real) > 0):
raise ValueError("__call__: FRD systems can only accept"
Expand Down
2 changes: 1 addition & 1 deletion control/lti.py
Original file line number Diff line number Diff line change
Expand Up @@ -436,7 +436,7 @@ def evalfr(sys, x, squeeze=True):
----------
sys: StateSpace or TransferFunction
Linear system
x: scalar or array-like
x: scalar or array_like
Complex number
squeeze: bool, optional (default=True)
If True and sys is single input, single output (SISO), return a
Expand Down
18 changes: 12 additions & 6 deletions control/statesp.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,11 +469,14 @@ def slycot_horner(self, s):
for a more user-friendly interface.

Parameters
s : array-like
----------
s : array_like
Complex frequency

Returns
output : array of size (outputs, inputs, len(s))

-------
output : (outputs, inputs, len(s)) complex ndarray
Frequency response
"""
from slycot import tb05ad

Expand Down Expand Up @@ -517,11 +520,14 @@ def horner(self, s):
for a more user-friendly interface.

Parameters
s : array-like
----------
s : array_like
Complex frequencies

Returns
output : array of size (outputs, inputs, len(s))

-------
output : (outputs, inputs, len(s)) complex ndarray
Frequency response
"""
s_arr = np.array(s, ndmin=1) # force to be an array
# Preallocate
Expand Down
9 changes: 6 additions & 3 deletions control/xferfcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,14 @@ def horner(self, s):
for a more user-friendly interface.

Parameters
s : array-like
----------
s : array_like
Complex frequencies

Returns
output : array of size (outputs, inputs, len(s))

-------
output : (outputs, inputs, len(s)) complex ndarray
Frequency response
"""
s_arr = np.array(s, ndmin=1) # force to be an array
out = empty((self.outputs, self.inputs, len(s_arr)), dtype=complex)
Expand Down