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

new iosys.interconnect is great, but... #530

Closed
Assignees
murrayrm
@sawyerbfuller

Description

@sawyerbfuller

The new naming functionality iniosys.interconnect function [1] has allowed me to create some very sophisticated systems much more easily than withappend andconnect. So far, no bugs that I have found. Very nice!

a few remarks on usage:

  • theinplist andoutlist arguments are confusing and tricky. When you are writing code, its easy to forget shortened argument names like this: was itoutplist oroutlist? Also, they seem to exist to serve as a means to provide new names to the overall inputs and outputs. Is that a necessary feature? (might have to do with how system was set up for explicit interconnection) Possible to remove them and force the overall system to have the same input names and output names as constituent systems, and instead just provideinputs andoutputs kwargs forinterconnect? (edit: this is what matlab seems to do:https://www.mathworks.com/help/control/ref/connect.html)
  • auto-summing and auto-splitting, as suggested here:https://github.com/python-control/python-control/blob/master/doc/iosys.rst#automatic-connections-using-signal-names doesn't seem to work. For example, when I try to send the same signalu to bothsys1 andsys2 in the following code aValueError: signal u is not unique is raised:
sys1=ct.tf(1, [10,1])sys2=ct.tf(1, [2,1])summer=ct.iosys.summing_junction(['y1','y2'],'y')sys1=ct.iosys.tf2io(sys1,inputs='u',outputs='y1')sys2=ct.iosys.tf2io(sys2,inputs='u',outputs='y2')parallel=ct.interconnect((summer,sys1,sys2),inplist='u',outlist='y')
  • similarly for auto-summing. the following raisesValueError: signal y is not unique:
splitter=ct.ss2io(ct.ss([], [], [], [[1],[1]]),inputs='u',outputs=('u1','u2'))sys1=ct.iosys.tf2io(sys1,inputs='u1',outputs='y')sys2=ct.iosys.tf2io(sys2,inputs='u2',outputs='y')parallel=ct.interconnect((splitter,sys1,sys2),inplist='u',outlist='y')

I don't know how hard these are to fix, it depends on how the underlying interconnection code works. One option would be to just modify the docs to remove mention of auto splitting and summing and add a helper splitter functoin:

defsplitter(inputs,outputs):D=np.ones((len(outputs),1))C=np.zeros_like(D)returnio.ss2io(ct.ss(0,0,C,D),inputs=inputs,outputs=outputs)

[1]

definterconnect(syslist,connections=None,inplist=[],outlist=[],

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions


    [8]ページ先頭

    ©2009-2025 Movatter.jp