Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
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
Prev Previous commit
Next Next commit
a few more fixes to sys.sample
  • Loading branch information
sawyerbfuller committed Nov 30, 2022
commit 11d935048c71560dc91a0b4eac33aca7e175b203
2 changes: 1 addition & 1 deletion control/dtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def sample_system(sysc, Ts, method='zoh', alpha=None, prewarp_frequency=None,
signals, and states to the sampled system.
inputs : int, list of str or None, optional
Description of the system inputs. If not specified, the origional
system inputs are used. See :class:`NamedIOSystem` for more
system inputs are used. See :class:`InputOutputSystem` for more
information.
outputs : int, list of str or None, optional
Description of the system outputs. Same format as `inputs`.
Expand Down
2 changes: 1 addition & 1 deletion control/iosys.py
Original file line number Diff line number Diff line change
Expand Up @@ -2205,7 +2205,7 @@ def linearize(sys, xeq, ueq=None, t=0, params=None, **kw):
states to the linearized system.
inputs : int, list of str or None, optional
Description of the system inputs. If not specified, the origional
system inputs are used. See :class:`NamedIOSystem` for more
system inputs are used. See :class:`InputOutputSystem` for more
information.
outputs : int, list of str or None, optional
Description of the system outputs. Same format as `inputs`.
Expand Down
14 changes: 6 additions & 8 deletions control/statesp.py
Original file line number Diff line number Diff line change
Expand Up @@ -1338,14 +1338,6 @@ def sample(self, Ts, method='zoh', alpha=None, prewarp_frequency=None,
copy_names : bool, Optional
If True, copy the names of the input signals, output
signals, and states to the sampled system.

Returns
-------
sysd : StateSpace
Discrete-time system, with sampling rate Ts

Additional Parameters
---------------------
Comment thread
sawyerbfuller marked this conversation as resolved.
inputs : int, list of str or None, optional
Description of the system inputs. If not specified, the origional
system inputs are used. See :class:`InputOutputSystem` for more
Expand All @@ -1355,6 +1347,11 @@ def sample(self, Ts, method='zoh', alpha=None, prewarp_frequency=None,
states : int, list of str, or None, optional
Description of the system states. Same format as `inputs`.

Returns
-------
sysd : StateSpace
Discrete-time system, with sampling rate Ts

Notes
-----
Uses :func:`scipy.signal.cont2discrete`
Expand Down Expand Up @@ -1520,6 +1517,7 @@ def output(self, t, x, u=None, params=None):


# TODO: add discrete time check
# TODO: copy signal names
def _convert_to_statespace(sys):
"""Convert a system to state space form (if needed).

Expand Down
15 changes: 6 additions & 9 deletions control/xferfcn.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,21 +1130,18 @@ def sample(self, Ts, method='zoh', alpha=None, prewarp_frequency=None,
copy_names : bool, Optional
If True, copy the names of the input signals, output
signals, and states to the sampled system.

Returns
-------
sysd : TransferFunction system
Discrete-time system, with sample period Ts

Additional Parameters
---------------------
Comment thread
sawyerbfuller marked this conversation as resolved.
inputs : int, list of str or None, optional
Description of the system inputs. If not specified, the origional
system inputs are used. See :class:`NamedIOSystem` for more
system inputs are used. See :class:`InputOutputSystem` for more
information.
outputs : int, list of str or None, optional
Description of the system outputs. Same format as `inputs`.

Returns
-------
sysd : TransferFunction system
Discrete-time system, with sample period Ts

Notes
-----
1. Available only for SISO systems
Expand Down