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

numpy.ndarray * control.TransferFunction gives array object #459

Closed
Assignees
murrayrm
Milestone
@roryyorke

Description

@roryyorke

TransferFunction doesn't have the__array_priority = 11 class attribute thatStateSpace andFrequencyResponseData do. Is this on purpose? See below for results ofarray * tf, which results in an array (dtype object), andarray * ss, which results in a SS object. I found this while investigating the behaviour ofbdalg.connect in relation with#421

Should multiplication of scalar transfer functions by arrays be special-cased so that, e.g., with scalar tfk,k * eye(5) gives a 5x5 TF with identical entries on the diagonal? I think this sort of convention is used in literature, but it might be tricky to get something consistent here (e.g., should 1-input 1-output state-space systems do something analogous?; should one do general broadcasting?)

(control-dev) rory@rory-latitude:~/src/python-control$ ipythonPython 3.8.5 | packaged by conda-forge | (default, Jul 31 2020, 02:39:48) Type 'copyright', 'credits' or 'license' for more informationIPython 7.17.0 -- An enhanced Interactive Python. Type '?' for help.In [1]: !git describe                                                                                                  0.8.3-62-g6ede92eIn [2]: import control                                                                                                 In [3]: import numpy as np                                                                                             In [4]: np.array([[1]]) * control.tf([1], [1,1])                                                                       Out[4]: array([[TransferFunction(array([1.]), array([1, 1]))]], dtype=object)In [5]: np.array([[1]]) * control.ss([[-1]], [[1]], [[1]], [[0]])                                                      Out[5]: StateSpace(array([[-1.]]), array([[1.]]), array([[1.]]), array([[0.]]))

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp