- Notifications
You must be signed in to change notification settings - Fork441
Closed
Description
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:
- the
inplist
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 signal
u
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 raises
ValueError: 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]
python-control/control/iosys.py
Line 1850 in73f65df
definterconnect(syslist,connections=None,inplist=[],outlist=[], |
Metadata
Metadata
Assignees
Labels
No labels