Skip to content

Commit 20bd90a

Browse files
committed
Improve documentation for canonical forms
Also makes `form` an optional argument for canonical_form, with the default as reachable form (which is the only one implemented so far).
1 parent 3f3c9f5 commit 20bd90a

1 file changed

Lines changed: 18 additions & 4 deletions

File tree

control/canonical.py

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from numpy.linalg import inv
1111

1212

13-
def canonical_form(xsys, form):
13+
def canonical_form(xsys, form='reachable'):
1414
"""Convert a system into canonical form
1515
1616
Parameters
@@ -20,15 +20,15 @@ def canonical_form(xsys, form):
2020
form : String
2121
Canonical form for transformation. Chosen from:
2222
* 'reachable' - reachable canonical form
23-
* 'observable' - observable canonical form
23+
* 'observable' - observable canonical form [not implemented]
2424
* 'modal' - modal canonical form [not implemented]
2525
26-
Outputs
26+
Returns
2727
-------
2828
zsys : StateSpace object
2929
System in desired canonical form, with state 'z'
3030
T : matrix
31-
Coordinate transformation matrix, z = T*x
31+
Coordinate transformation matrix, z = T * x
3232
"""
3333

3434
# Call the appropriate tranformation function
@@ -41,6 +41,20 @@ def canonical_form(xsys, form):
4141

4242
# Reachable canonical form
4343
def reachable_form(xsys):
44+
"""Convert a system into reachable canonical form
45+
46+
Parameters
47+
----------
48+
xsys : StateSpace object
49+
System to be transformed, with state `x`
50+
51+
Returns
52+
-------
53+
zsys : StateSpace object
54+
System in reachable canonical form, with state `z`
55+
T : matrix
56+
Coordinate transformation: z = T * x
57+
"""
4458
# Check to make sure we have a SISO system
4559
if not issiso(xsys):
4660
raise ControlNotImplemented(

0 commit comments

Comments
 (0)