Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

I/O system improvements: linearize, interconnect, docstrings#497

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
Show all changes
12 commits
Select commitHold shift + click to select a range
fa041b6
allow naming of linearized system signals
murrayrmDec 29, 2020
4f08382
PEP8 cleanup
murrayrmJan 1, 2021
e343a33
append _linearize for system name + unit tests
murrayrmJan 1, 2021
50e61a0
add keyword to geterate strictly proper rss systems
murrayrmJan 1, 2021
4e46c4a
update docs, tests for InterconnectedSystem + small refactoring of ga…
murrayrmJan 1, 2021
da04036
create LinearInterconnectedSystems for interconnections of linear sys…
murrayrmJan 2, 2021
ff4a351
turn off selected unit tests for scipy-0.19
murrayrmJan 2, 2021
4f04f48
updated sphinx documentation + changed to LinearICSystem
murrayrmJan 2, 2021
14fc96e
allow default linearized system name to be customized
murrayrmJan 3, 2021
e767986
fix bug in iosys unit test (reset_defaults)
murrayrmJan 3, 2021
488edf5
use editdefaults fixture and matrixfilter mark for unit testing
murrayrmJan 5, 2021
5ed0f96
fix issue with np.matrix deprecation in iosys_test.py
murrayrmJan 5, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletionscontrol/bdalg.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -326,6 +326,13 @@ def connect(sys, Q, inputv, outputv):
>>> Q = [[1, 2], [2, -1]] # negative feedback interconnection
>>> sysc = connect(sys, Q, [2], [1, 2])

Notes
-----
The :func:`~control.interconnect` function in the
:ref:`input/output systems <iosys-module>` module allows the use
of named signals and provides an alternative method for
interconnecting multiple systems.

"""
inputv, outputv, Q = np.asarray(inputv), np.asarray(outputv), np.asarray(Q)
# check indices
Expand Down
8 changes: 8 additions & 0 deletionscontrol/config.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -215,7 +215,15 @@ def use_legacy_defaults(version):
if major == 0 and minor < 9:
# switched to 'array' as default for state space objects
set_defaults('statesp', use_numpy_matrix=True)

# switched to 0 (=continuous) as default timestep
set_defaults('control', default_dt=None)

# changed iosys naming conventions
set_defaults('iosys', state_name_delim='.',
duplicate_system_name_prefix='copy of ',
duplicate_system_name_suffix='',
linearized_system_name_prefix='',
linearized_system_name_suffix='_linearized')

return (major, minor, patch)
693 changes: 448 additions & 245 deletionscontrol/iosys.py
View file
Open in desktop

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletionscontrol/statesp.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1264,7 +1264,7 @@ def _convertToStateSpace(sys, **kw):


# TODO: add discrete time option
def _rss_generate(states, inputs, outputs, type):
def _rss_generate(states, inputs, outputs, type, strictly_proper=False):
"""Generate a random state space.

This does the actual random state space generation expected from rss and
Expand DownExpand Up@@ -1374,7 +1374,7 @@ def _rss_generate(states, inputs, outputs, type):
# Apply masks.
B = B * Bmask
C = C * Cmask
D = D * Dmask
D = D * Dmask if not strictly_proper else zeros(D.shape)

return StateSpace(A, B, C, D)

Expand DownExpand Up@@ -1649,7 +1649,7 @@ def tf2ss(*args):
raise ValueError("Needs 1 or 2 arguments; received %i." % len(args))


def rss(states=1, outputs=1, inputs=1):
def rss(states=1, outputs=1, inputs=1, strictly_proper=False):
"""
Create a stable *continuous* random state space object.

Expand All@@ -1661,6 +1661,9 @@ def rss(states=1, outputs=1, inputs=1):
Number of system inputs
outputs : integer
Number of system outputs
strictly_proper : bool, optional
If set to 'True', returns a proper system (no direct term). Default
value is 'False'.

Returns
-------
Expand All@@ -1684,10 +1687,11 @@ def rss(states=1, outputs=1, inputs=1):

"""

return _rss_generate(states, inputs, outputs, 'c')
return _rss_generate(states, inputs, outputs, 'c',
strictly_proper=strictly_proper)


def drss(states=1, outputs=1, inputs=1):
def drss(states=1, outputs=1, inputs=1, strictly_proper=False):
"""
Create a stable *discrete* random state space object.

Expand DownExpand Up@@ -1722,7 +1726,8 @@ def drss(states=1, outputs=1, inputs=1):

"""

return _rss_generate(states, inputs, outputs, 'd')
return _rss_generate(states, inputs, outputs, 'd',
strictly_proper=strictly_proper)


def ssdata(sys):
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp