8000 Merge pull request #976 from henriks76/system-norms-doc · python-control/python-control@7a70be1 · GitHub
[go: up one dir, main page]

Skip to content

Commit 7a70be1

Browse files
authored
Merge pull request #976 from henriks76/system-norms-doc
norm added to the sphinx documentation
2 parents e1e33e4 + 6828c67 commit 7a70be1

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

control/sysnorm.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -94,13 +94,13 @@ def norm(system, p=2, tol=1e-6, print_warning=True, method=None):
9494
Type of norm to be computed. ``p=2`` gives the H2 norm, and ``p='inf'`` gives the L-infinity norm.
9595
tol : float
9696
Relative tolerance for accuracy of L-infinity norm computation. Ignored
97-
unless p='inf'.
97+
unless ``p='inf'``.
9898
print_warning : bool
9999
Print warning message in case norm value may be uncertain.
100100
method : str, optional
101101
Set the method used for computing the result. Current methods are
102-
'slycot' and 'scipy'. If set to None (default), try 'slycot' first
103-
and then 'scipy'.
102+
``'slycot'`` and ``'scipy'``. If set to ``None`` (default), try ``'slycot'`` first
103+
and then ``'scipy'``.
104104
105105
Returns
106106
-------
@@ -114,10 +114,10 @@ def norm(system, p=2, tol=1e-6, print_warning=True, method=None):
114114
Examples
115115
--------
116116
>>> Gc = ct.tf([1], [1, 2, 1])
117-
>>> ct.norm(Gc, 2)
118-
0.5000000000000001
119-
>>> ct.norm(Gc, 'inf', tol=1e-11, method='scipy')
120-
1.000000000007276
117+
>>> round(ct.norm(Gc, 2), 3)
118+
0.5
119+
>>> round(ct.norm(Gc, 'inf', tol=1e-5, method='scipy'), 3)
120+
1.0
121121
"""
122122

123123
if not isinstance(system, (ct.StateSpace, ct.TransferFunction)):

doc/control.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ Utility functions and conversions
179179
issys
180180
mag2db
181181
modal_form
182+
norm
182183
observable_form
183184
pade
184185
reachable_form

0 commit comments

Comments
 (0)
0