You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/modelsimp.py
+51-36Lines changed: 51 additions & 36 deletions
Original file line number
Diff line number
Diff line change
@@ -51,20 +51,26 @@
51
51
defhsvd(sys):
52
52
"""Calculate the Hankel singular values
53
53
54
-
Usage
55
-
=====
56
-
H = hsvd(sys)
57
-
58
-
The Hankel singular values are the singular values of the Hankel operator. In practice, we compute the square root of the eigenvalues of the matrix formed by taking the product of the observability and controllability gramians. There are other (more efficient) methods based on solving the Lyapunov equation in a particular way (more details soon).
59
-
60
-
Inputs
61
-
------
54
+
Parameters
55
+
----------
62
56
sys : a state space system
63
57
64
-
Outputs
58
+
Returns
65
59
-------
66
60
H : a list of Hankel singular values
67
61
62
+
See Also
63
+
--------
64
+
gram
65
+
66
+
Notes
67
+
-----
68
+
The Hankel singular values are the singular values of the Hankel operator. In practice, we compute the square root of the eigenvalues of the matrix formed by taking the product of the observability and controllability gramians. There are other (more efficient) methods based on solving the Lyapunov equation in a particular way (more details soon).
69
+
70
+
Examples
71
+
--------
72
+
H = hsvd(sys)
73
+
68
74
"""
69
75
70
76
Wc=gram(sys,'c')
@@ -83,19 +89,25 @@ def hsvd(sys):
83
89
defmodred(sys,ELIM,method):
84
90
"""Model reduction of sys by eliminating the states in ELIM using a given method
85
91
86
-
Usage
87
-
=====
88
-
rsys = modred(sys,ELIM,method)
92
+
Parameters
93
+
----------
94
+
sys: original system to reduce
95
+
ELIM: vector of states to eliminate
96
+
method: method of removing states in ELIM (truncate or matchdc)
89
97
90
-
Inputs
91
-
======
92
-
sys : original system to reduce
93
-
ELIM : vector of states to eliminate
94
-
method : method of removing states in ELIM (truncate or matchdc)
98
+
Returns
99
+
-------
100
+
rsys: a reduced order model
95
101
96
-
Outputs
97
-
=======
98
-
rsys : a reduced order model
102
+
Raises
103
+
------
104
+
ValueError
105
+
if `method` is not either `matchdc` or `truncate`
106
+
if eigenvalues of `sys.A` are not all in left half plane (sys must be stable)
0 commit comments