Skip to content

Commit 10fa142

Browse files
committed
Change names for modelsimp, add aliases for modelsimp
1 parent 6406868 commit 10fa142

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

control/modelsimp.py

+15-6
Original file line numberDiff line numberDiff line change
@@ -49,15 +49,17 @@
4949
from .statesp import StateSpace
5050
from .statefbk import gram
5151

52-
__all__ = ['hsvd', 'balred', 'modred', 'era', 'markov', 'minreal']
52+
__all__ = ['hankel_singular_values', 'balanced_reduction', 'model_reduction',
53+
'minimal_realization', 'eigensys_realization', 'markov', 'hsvd',
54+
'balred', 'modred', 'minreal', 'era']
5355

5456

5557
# Hankel Singular Value Decomposition
5658
#
5759
# The following returns the Hankel singular values, which are singular values
5860
# of the matrix formed by multiplying the controllability and observability
5961
# Gramians
60-
def hsvd(sys):
62+
def hankel_singular_values(sys):
6163
"""Calculate the Hankel singular values.
6264
6365
Parameters
@@ -106,7 +108,7 @@ def hsvd(sys):
106108
return hsv[::-1]
107109

108110

109-
def modred(sys, ELIM, method='matchdc'):
111+
def model_reduction(sys, ELIM, method='matchdc'):
110112
"""
111113
Model reduction of `sys` by eliminating the states in `ELIM` using a given
112114
method.
@@ -216,7 +218,7 @@ def modred(sys, ELIM, method='matchdc'):
216218
return rsys
217219

218220

219-
def balred(sys, orders, method='truncate', alpha=None):
221+
def balanced_reduction(sys, orders, method='truncate', alpha=None):
220222
"""Balanced reduced order model of sys of a given order.
221223
States are eliminated based on Hankel singular value.
222224
If sys has unstable modes, they are removed, the
@@ -340,7 +342,7 @@ def balred(sys, orders, method='truncate', alpha=None):
340342
return rsys
341343

342344

343-
def minreal(sys, tol=None, verbose=True):
345+
def minimal_realization(sys, tol=None, verbose=True):
344346
'''
345347
Eliminates uncontrollable or unobservable states in state-space
346348
models or cancelling pole-zero pairs in transfer functions. The
@@ -368,7 +370,7 @@ def minreal(sys, tol=None, verbose=True):
368370
return sysr
369371

370372

371-
def era(YY, m, n, nin, nout, r):
373+
def eigensys_realization(YY, m, n, nin, nout, r):
372374
"""Calculate an ERA model of order `r` based on the impulse-response data
373375
`YY`.
374376
@@ -556,3 +558,10 @@ def markov(Y, U, m=None, transpose=False):
556558

557559
# Return the first m Markov parameters
558560
return H if transpose else np.transpose(H)
561+
562+
# Function aliases
563+
hsvd = hankel_singular_values
564+
balred = balanced_reduction
565+
modred = model_reduction
566+
minreal = minimal_realization
567+
era = eigensys_realization

doc/control.rst

+5-5
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,11 @@ Model simplification tools
133133
.. autosummary::
134134
:toctree: generated/
135135

136-
minreal
137-
balred
138-
hsvd
139-
modred
140-
era
136+
minimal_realization
137+
balanced_reduction
138+
hankel_singular_values
139+
model_reduction
140+
eigensys_realization
141141
markov
142142

143143
Nonlinear system support

0 commit comments

Comments
 (0)