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

fix isssues arising in merge of descfcn/iosys changes#540

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
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
6 changes: 4 additions & 2 deletionscontrol/iosys.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -855,7 +855,7 @@ def __call__(sys, u, params=None, squeeze=None):

# Evaluate the function on the argument
out = sys._out(0, np.array((0,)), np.asarray(u))
_, out = _process_time_response(sys,[], out,[], squeeze=squeeze)
_, out = _process_time_response(sys,None, out,None, squeeze=squeeze)
return out

def _update_params(self, params, warning=False):
Expand DownExpand Up@@ -1867,8 +1867,10 @@ def linearize(sys, xeq, ueq=[], t=0, params={}, **kw):

# Utility function to parse a signal parameter
def _parse_signal_parameter(value, name, kwargs, end=False):
# Check kwargs for a variant of the parameter name
if value is None and name in kwargs:
value = list(kwargs.pop(name))
value = kwargs.pop(name)

if end and kwargs:
raise TypeError("unknown parameters %s" % kwargs)
return value
Expand Down
14 changes: 9 additions & 5 deletionscontrol/timeresp.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -467,8 +467,11 @@ def _process_time_response(

Parameters
----------
sys : LTI or InputOutputSystem
System that generated the data (used to check if SISO/MIMO).

T : 1D array
Time values of the output
Time values of the output. Ignored if None.

yout : ndarray
Response of the system. This can either be a 1D array indexed by time
Expand All@@ -478,9 +481,9 @@ def _process_time_response(

xout : array, optional
Individual response of each x variable (if return_x is True). For a
SISO system (or if a single input is specified),This should be a 2D
SISO system (or if a single input is specified),this should be a 2D
array indexed by the state index and time (for single input systems)
or a 3D array indexed by state, input, and time.
or a 3D array indexed by state, input, and time. Ignored if None.

transpose : bool, optional
If True, transpose all input and output arrays (for backward
Expand DownExpand Up@@ -545,7 +548,7 @@ def _process_time_response(
raise ValueError("unknown squeeze value")

# Figure out whether and how to squeeze the state data
if issiso and len(xout.shape) > 2:
if issiso andxout is not None andlen(xout.shape) > 2:
xout = xout[:, 0, :] # remove input

# See if we need to transpose the data back into MATLAB form
Expand All@@ -555,7 +558,8 @@ def _process_time_response(

# For signals, put the last index (time) into the first slot
yout = np.transpose(yout, np.roll(range(yout.ndim), 1))
xout = np.transpose(xout, np.roll(range(xout.ndim), 1))
if xout is not None:
xout = np.transpose(xout, np.roll(range(xout.ndim), 1))

# Return time, output, and (optionally) state
return (tout, yout, xout) if return_x else (tout, yout)
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp