You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Bugs in InterconnectedSystem: different dt's [fixed] and non-proper TFs [open] #399
Hi, I found a bug in InterconnectedSystem when connecting two systems with different dt, one of which is None. I believe the correct semantic is for the new system to take the dt of the non-None system, but the way it is implemented, the order of the systems matters.
import control as ct
sys1 = ct.tf2io(ct.tf('s'))
sys2 = ct.NonlinearIOSystem(lambda t,x,u: x, name='sys2', states=('x'), inputs=('u'))
ct.InterconnectedSystem((sys2,sys1))
This code works, but changing the order of sys1 and sys2, as in ct.InterconnectedSystem((sys1,sys2)) gives a bug:
/usr/local/lib/python3.7/site-packages/control-0.8.3-py3.7.egg/control/iosys.py in init(self, syslist, connections, inplist, outlist, inputs, outputs, states, params, dt, name)
892 dt = sys.dt
893 elif dt != sys.dt:
--> 894 raise TypeError("System timebases are not compatible")
895
896 # Make sure number of inputs, outputs, states is given
I checked and #490 (rebased #431) fixes the initial bug that was reported regarding mixed timebases.
However, it uncovered another bug: the command sys1 = ct.tf2io(ct.tf('s')) tries to generate a state space system having transfer function s (differentiator). This is not possible since you state space systems always have proper transfer functions and s is not proper => it should generate an error.
Leaving this bug open until this is fixed. I'll also update the title.
changed the title [-]Bug in InterconnectedSystem[/-][+]Bugs in InterconnectedSystem: different dt's [fixed] and non-proper TFs [open][/+]on Dec 31, 2020
Activity
bnavigator commentedon Aug 17, 2020
Fixed by #431, but that will likely have to wait until 0.9.0. Reassigning milestone.
murrayrm commentedon Dec 31, 2020
I checked and #490 (rebased #431) fixes the initial bug that was reported regarding mixed timebases.
However, it uncovered another bug: the command
sys1 = ct.tf2io(ct.tf('s'))tries to generate a state space system having transfer function s (differentiator). This is not possible since you state space systems always have proper transfer functions and s is not proper => it should generate an error.Leaving this bug open until this is fixed. I'll also update the title.
[-]Bug in InterconnectedSystem[/-][+]Bugs in InterconnectedSystem: different dt's [fixed] and non-proper TFs [open][/+]