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

proposal to standardize squeezing output from systems #453

Closed
Assignees
murrayrm
Milestone
@sawyerbfuller

Description

@sawyerbfuller

Proposal: When computing frequency and time response output of systems, standardize on indexing first element so output is a 1D array if system is SISO andsqueeze=True. This is instead of applyingnumpy.squeeze to output.

Currently, there are two ways that python-control squeezes output:

  1. apply 'squeeze' to the output at the end. This is what functions intimeresp.py do, e.g.forced_response (edit: andiosys time responses). An m x n MIMO system (m-output, n-input, m,n>1) produces a [m x n x k] array, where k is the number of data points in time. But a 1 x n system's output gets squeezed to [n x k] and a m x 1 is squeezed to [m x k].

  2. use indexing to extract the first element if SISO, otherwise leave a full array. This is what the frequency response functionsevalfr,freqresp do. If SISO, give [k] length array; MIMO systems always produce [m x n x k] arrays.

I propose to standardize on the latter: a MIMO system should always output [m x n x k] arrays. Rationale: this facilitates interconnection and keeps indexing the system and its outputs consistent. Along with the proposal: retain thesqueeze=True keyword argument because it's already in use, but do the 'squeeze' by indexing the first element, and only do it if SISO.

Documentation would read something like:

"If squeeze is True (default) and sys is single input single output (SISO), returns a 1D array equal to the length k of the input, otherwise returns an (n_outputs, n_inputs, k) array for multiple input multiple output (MIMO) systems."

This is relevant for#449 and popped up in#442.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp