Skip to content

Commit 68c7ea6

Browse files
committed
added documentation to statesp, xferfcn, and conventions.rst describing new config parameters default_dt and remove_useless_states
1 parent 85b0f5e commit 68c7ea6

File tree

4 files changed

+23
-4
lines changed

4 files changed

+23
-4
lines changed

control/config.py

+7
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ class and functions. If flat is `False`, then matrices are
161161
set_defaults('statesp', use_numpy_matrix=flag)
162162

163163
def use_legacy_defaults(version):
164+
""" Sets the defaults to whatever they were in a given release.
165+
166+
Parameters
167+
----------
168+
version : string
169+
version number of the defaults desired. Currently only supports `0.8.3`.
170+
"""
164171
if version == '0.8.3':
165172
use_numpy_matrix(True) # alternatively: set_defaults('statesp', use_numpy_matrix=True)
166173
else:

control/statesp.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,8 @@ class StateSpace(LTI):
149149
Setting dt = 0 specifies a continuous system, while leaving dt = None
150150
means the system timebase is not specified. If 'dt' is set to True, the
151151
system will be treated as a discrete time system with unspecified sampling
152-
time.
152+
time. The default value of 'dt' is None and can be changed by changing the
153+
value of ``control.config.defaults['statesp.default_dt']``.
153154
154155
"""
155156

control/xferfcn.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,9 @@ class TransferFunction(LTI):
9393
instance variable and setting it to something other than 'None'. If 'dt'
9494
has a non-zero value, then it must match whenever two transfer functions
9595
are combined. If 'dt' is set to True, the system will be treated as a
96-
discrete time system with unspecified sampling time.
96+
discrete time system with unspecified sampling time. The default value of
97+
'dt' is None and can be changed by changing the value of
98+
``control.config.defaults['xferfcn.default_dt']``.
9799
98100
The TransferFunction class defines two constants ``s`` and ``z`` that
99101
represent the differentiation and delay operators in continuous and

doc/conventions.rst

+11-2
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,9 @@ the result will be a discrete time system with the sample time of the latter
9898
system. For continuous time systems, the :func:`sample_system` function or
9999
the :meth:`StateSpace.sample` and :meth:`TransferFunction.sample` methods
100100
can be used to create a discrete time system from a continuous time system.
101-
See :ref:`utility-and-conversions`.
101+
See :ref:`utility-and-conversions`. The default value of 'dt' can be changed by
102+
changing the values of ``control.config.defaults['statesp.default_dt']`` and
103+
``control.config.defaults['xferfcn.default_dt']``.
102104

103105
Conversion between representations
104106
----------------------------------
@@ -220,9 +222,15 @@ Selected variables that can be configured, along with their default values:
220222
* freqplot.feature_periphery_decade (1.0): How many decades to include in the
221223
frequency range on both sides of features (poles, zeros).
222224
223-
* statesp.use_numpy_matrix: set the return type for state space matrices to
225+
* statesp.use_numpy_matrix (True): set the return type for state space matrices to
224226
`numpy.matrix` (verus numpy.ndarray)
225227
228+
* statesp.default_dt and xferfcn.default_dt (None): set the default value of dt when
229+
constructing new LTI systems
230+
231+
* statesp.remove_useless_states (True): remove states that have no effect on the
232+
input-output dynamics of the system
233+
226234
Additional parameter variables are documented in individual functions
227235
228236
Functions that can be used to set standard configurations:
@@ -234,3 +242,4 @@ Functions that can be used to set standard configurations:
234242
use_fbs_defaults
235243
use_matlab_defaults
236244
use_numpy_matrix
245+
use_legacy_defaults

0 commit comments

Comments
 (0)