Skip to content

Commit b906617

Browse files
committed
fix up warnings in make html, make doctest, pytest
1 parent 5c4a26b commit b906617

18 files changed

Lines changed: 337 additions & 446 deletions

control/statesp.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,18 +1270,19 @@ def sample(self, Ts, method='zoh', alpha=None, prewarp_frequency=None,
12701270
----------
12711271
Ts : float
12721272
Sampling period.
1273-
method : {"gbt", "bilinear", "euler", "backward_diff", "zoh"}
1274-
Which method to use:
1275-
1276-
* gbt: generalized bilinear transformation
1277-
* bilinear: Tustin's approximation ("gbt" with alpha=0.5)
1278-
* euler: Euler (or forward differencing) method ("gbt" with
1273+
method : {'gbt', 'bilinear', 'euler', 'backward_diff', 'zoh'}
1274+
Method to use for sampling:
1275+
1276+
* 'gbt': generalized bilinear transformation
1277+
* 'backward_diff': Backwards differencing ('gbt' with alpha=1.0)
1278+
* 'bilinear' (or 'tustin'): Tustin's approximation ('gbt' with
1279+
alpha=0.5)
1280+
* 'euler': Euler (or forward differencing) method ('gbt' with
12791281
alpha=0)
1280-
* backward_diff: Backwards differencing ("gbt" with alpha=1.0)
1281-
* zoh: zero-order hold (default)
1282+
* 'zoh': zero-order hold (default)
12821283
alpha : float within [0, 1]
12831284
The generalized bilinear transformation weighting parameter, which
1284-
should only be specified with method="gbt", and is ignored
1285+
should only be specified with method='gbt', and is ignored
12851286
otherwise.
12861287
prewarp_frequency : float within [0, infinity)
12871288
The frequency [rad/s] at which to match with the input continuous-
@@ -1612,6 +1613,7 @@ def ss(*args, **kwargs):
16121613
systems, `B` and `C` can be given as 1D arrays and D can be given
16131614
as a scalar.
16141615
1616+
16151617
``ss(*args, inputs=['u1', ..., 'up'], outputs=['y1', ..., 'yq'], states=['x1', ..., 'xn'])``
16161618
Create a system with named input, output, and state signals.
16171619

control/xferfcn.py

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1155,15 +1155,17 @@ def sample(self, Ts, method='zoh', alpha=None, prewarp_frequency=None,
11551155
----------
11561156
Ts : float
11571157
Sampling period.
1158-
method : {"gbt", "bilinear", "euler", "backward_diff",
1159-
"zoh", "matched"}
1158+
method : {'gbt', 'bilinear', 'euler', 'backward_diff', 'zoh', 'matched'}
11601159
Method to use for sampling:
11611160
1162-
* gbt: generalized bilinear transformation
1163-
* bilinear or tustin: Tustin's approximation ("gbt" with alpha=0.5)
1164-
* euler: Euler (or forward difference) method ("gbt" with alpha=0)
1165-
* backward_diff: Backwards difference ("gbt" with alpha=1.0)
1166-
* zoh: zero-order hold (default)
1161+
* 'gbt': generalized bilinear transformation
1162+
* 'backward_diff': Backwards differencing ('gbt' with alpha=1.0)
1163+
* 'bilinear' (or 'tustin'): Tustin's approximation ('gbt' with
1164+
alpha=0.5)
1165+
* 'euler': Euler (or forward differencing) method ('gbt' with
1166+
alpha=0)
1167+
* 'matched': pole-zero match method
1168+
* 'zoh': zero-order hold (default)
11671169
alpha : float within [0, 1]
11681170
The generalized bilinear transformation weighting parameter, which
11691171
should only be specified with method="gbt", and is ignored

doc/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,4 @@ clean:
2424
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
2525

2626
distclean: clean
27-
make -C figures clean
2827
/bin/rm -rf generated

doc/config.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ for various types of plots and establishing the underlying representation for
1010
state space matrices.
1111

1212
To set the default value of a configuration variable, set the appropriate
13-
element of the `control.config.defaults` dictionary::
13+
element of the `config.defaults` dictionary::
1414

1515
ct.config.defaults['module.parameter'] = value
1616

17-
The :func:`~control.set_defaults` function can also be used to
17+
The :func:`set_defaults` function can also be used to
1818
set multiple configuration parameters at the same time::
1919

2020
ct.set_defaults('module', param1=val1, param2=val2, ...]

doc/descfcn.rst

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
.. _descfcn-module:
22

3+
.. currentmodule:: control
4+
35
Describing functions
46
====================
57

@@ -29,7 +31,7 @@ because it assumes that higher harmonics can be neglected.
2931
Module usage
3032
------------
3133

32-
The function :func:`~control.describing_function` can be used to
34+
The function :func:`describing_function` can be used to
3335
compute the describing function of a nonlinear function::
3436

3537
N = ct.describing_function(F, A)
@@ -44,15 +46,15 @@ amplitudes :math:`a` and frequencies :math`\omega` such that
4446
These points can be determined by generating a Nyquist plot in which
4547
the transfer function :math:`H(j\omega)` intersections the negative
4648
reciprocal of the describing function :math:`N(A)`. The
47-
:func:`~control.describing_function_response` function computes the
49+
:func:`describing_function_response` function computes the
4850
amplitude and frequency of any points of intersection::
4951

5052
response = ct.describing_function_response(H, F, amp_range[, omega_range])
5153
response.intersections # frequency, amplitude pairs
5254

5355
A Nyquist plot showing the describing function and the intersections
5456
with the Nyquist curve can be generated using `response.plot()`, which
55-
calls the :func:`~control.describing_function_plot` function.
57+
calls the :func:`describing_function_plot` function.
5658

5759

5860
Pre-defined nonlinearities
@@ -76,15 +78,15 @@ nonlinearity::
7678
F = ct.saturation_nonlinearity(1)
7779

7880
These functions use the
79-
:class:`~control.DescribingFunctionNonlinearity`, which allows an
81+
:class:`DescribingFunctionNonlinearity`, which allows an
8082
analytical description of the describing function.
8183

8284
Module classes and functions
8385
----------------------------
8486
.. autosummary::
8587
:template: custom-class-template.rst
8688

87-
~control.DescribingFunctionNonlinearity
88-
~control.friction_backlash_nonlinearity
89-
~control.relay_hysteresis_nonlinearity
90-
~control.saturation_nonlinearity
89+
DescribingFunctionNonlinearity
90+
friction_backlash_nonlinearity
91+
relay_hysteresis_nonlinearity
92+
saturation_nonlinearity

doc/flatsys.rst

Lines changed: 25 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ Module usage
110110
============
111111

112112
To create a trajectory for a differentially flat system, a
113-
:class:`~control.flatsys.FlatSystem` object must be created. This is done
114-
using the :func:`~control.flatsys.flatsys` function:
113+
:class:`~flatsys.FlatSystem` object must be created. This is done
114+
using the :func:`~flatsys.flatsys` function:
115115

116116
import control.flatsys as fs
117117
sys = fs.flatsys(forward, reverse)
@@ -120,12 +120,12 @@ The `forward` and `reverse` parameters describe the mappings between the
120120
system state/input and the differentially flat outputs and their
121121
derivatives ("flat flag").
122122

123-
The :func:`~control.flatsys.FlatSystem.forward` method computes the
123+
The :func:`~flatsys.FlatSystem.forward` method computes the
124124
flat flag given a state and input:
125125

126126
zflag = sys.forward(x, u)
127127

128-
The :func:`~control.flatsys.FlatSystem.reverse` method computes the state
128+
The :func:`~flatsys.FlatSystem.reverse` method computes the state
129129
and input given the flat flag:
130130

131131
x, u = sys.reverse(zflag)
@@ -139,11 +139,11 @@ The number of flat outputs must match the number of system inputs.
139139

140140
For a linear system, a flat system representation can be generated by
141141
passing a :class:`~control.StateSpace` system to the
142-
:func:`~control.flatsys.flatsys` factory function::
142+
:func:`~flatsys.flatsys` factory function::
143143

144144
sys = fs.flatsys(linsys)
145145

146-
The :func:`~control.flatsys.flatsys` function also supports the use of
146+
The :func:`~flatsys.flatsys` function also supports the use of
147147
named input, output, and state signals::
148148

149149
sys = fs.flatsys(
@@ -153,23 +153,23 @@ In addition to the flat system description, a set of basis functions
153153
:math:`\phi_i(t)` must be chosen. The `FlatBasis` class is used to
154154
represent the basis functions. A polynomial basis function of the
155155
form 1, :math:`t`, :math:`t^2`, ... can be computed using the
156-
:class:`~control.flatsys.PolyFamily` class, which is initialized by
156+
:class:`~flatsys.PolyFamily` class, which is initialized by
157157
passing the desired order of the polynomial basis set::
158158

159159
basis = fs.PolyFamily(N)
160160

161161
Additional basis function families include Bezier curves
162-
(:class:`~control.flatsys.BezierFamily`) and B-splines
163-
(:class:`~control.flatsys.BSplineFamily`).
162+
(:class:`~flatsys.BezierFamily`) and B-splines
163+
(:class:`~flatsys.BSplineFamily`).
164164

165165
Once the system and basis function have been defined, the
166-
:func:`~control.flatsys.point_to_point` function can be used to compute a
166+
:func:`~flatsys.point_to_point` function can be used to compute a
167167
trajectory between initial and final states and inputs::
168168

169169
traj = fs.point_to_point(
170170
sys, Tf, x0, u0, xf, uf, basis=basis)
171171

172-
The returned object has class :class:`~control.flatsys.SystemTrajectory` and
172+
The returned object has class :class:`~flatsys.SystemTrajectory` and
173173
can be used to compute the state and input trajectory between the initial and
174174
final condition::
175175

@@ -178,11 +178,11 @@ final condition::
178178
where `T` is a list of times on which the trajectory should be evaluated
179179
(e.g., `T = numpy.linspace(0, Tf, M)`.
180180

181-
The :func:`~control.flatsys.point_to_point` function also allows the
181+
The :func:`~flatsys.point_to_point` function also allows the
182182
specification of a cost function and/or constraints, in the same
183183
format as :func:`~control.optimal.solve_ocp`.
184184

185-
The :func:`~control.flatsys.solve_flat_ocp` function can be used to
185+
The :func:`~flatsys.solve_flat_ocp` function can be used to
186186
solve an optimal control problem without a final state::
187187

188188
traj = fs.solve_flat_ocp(
@@ -311,19 +311,21 @@ cost:`
311311
Module classes and functions
312312
============================
313313

314+
.. currentmodule:: control
315+
314316
.. autosummary::
315317
:template: custom-class-template.rst
316318

317-
~control.flatsys.BasisFamily
318-
~control.flatsys.BezierFamily
319-
~control.flatsys.BSplineFamily
320-
~control.flatsys.FlatSystem
321-
~control.flatsys.LinearFlatSystem
322-
~control.flatsys.PolyFamily
323-
~control.flatsys.SystemTrajectory
319+
flatsys.BasisFamily
320+
flatsys.BezierFamily
321+
flatsys.BSplineFamily
322+
flatsys.FlatSystem
323+
flatsys.LinearFlatSystem
324+
flatsys.PolyFamily
325+
flatsys.SystemTrajectory
324326

325327
.. autosummary::
326328

327-
~control.flatsys.flatsys
328-
~control.flatsys.point_to_point
329-
~control.flatsys.solve_flat_ocp
329+
flatsys.flatsys
330+
flatsys.point_to_point
331+
flatsys.solve_flat_ocp

doc/freqresp.rst

Lines changed: 0 additions & 9 deletions
This file was deleted.

doc/functions.rst

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ System interconnections
5858
append
5959
combine_tf
6060
split_tf
61+
summing_junction
6162
connection_table
6263
combine_tf
6364
split_tf
@@ -110,7 +111,6 @@ Control system analysis
110111
bandwidth
111112
damp
112113
dcgain
113-
describing_function
114114
get_input_ff_index
115115
get_output_fb_index
116116
ispassive
@@ -130,8 +130,7 @@ Control system analysis
130130
singular_values_plot
131131
singular_values_response
132132
sisotool
133-
StateSpace.__call__
134-
TransferFunction.__call__
133+
135134

136135
Control system synthesis
137136
========================
@@ -140,7 +139,6 @@ Control system synthesis
140139

141140
acker
142141
create_statefbk_iosystem
143-
create_estimator_iosystem
144142
dlqr
145143
h2syn
146144
hinfsyn
@@ -167,12 +165,8 @@ Nonlinear system support
167165
.. autosummary::
168166
:toctree: generated/
169167

170-
describing_function
171168
find_operating_point
172169
linearize
173-
input_output_response
174-
summing_junction
175-
flatsys.point_to_point
176170

177171
Stochastic system support
178172
=========================
@@ -209,6 +203,7 @@ Describing functions
209203
.. autosummary::
210204
:toctree: generated/
211205

206+
describing_function
212207
friction_backlash_nonlinearity
213208
relay_hysteresis_nonlinearity
214209
saturation_nonlinearity

doc/intro.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Package overview
1414
:no-members:
1515
:no-inherited-members:
1616
:no-special-members:
17+
:no-index:
1718

1819
Installation
1920
============

doc/linear.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. module:: control
1+
.. currentmodule:: control
22

33
********************************************
44
Linear System Modeling, Analysis, and Design

0 commit comments

Comments
 (0)