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
Using control.series to connect several discrete state-space systems, all with dt=0.05, is resulting in "ValueError:Systems have incompatible timebases" from "common_timebase" in namedio.py line 340 in release 0.9.2.
File "/usr/local/anaconda3/envs/c/lib/python3.9/site-packages/control/bdalg.py", line 108, in series return reduce(lambda x, y:y*x, sysn, sys1)
File "/usr/local/anaconda3/envs/c/lib/python3.9/site-packages/control/bdalg.py", line 108, in return reduce(lambda x, y:y*x, sysn, sys1)
File "/usr/local/anaconda3/envs/c/lib/python3.9/site-packages/control/iosys.py", line 184, in mul newsys = InterconnectedSystem(
File "/usr/local/anaconda3/envs/c/lib/python3.9/site-packages/control/iosys.py", line 895, in init dt = common_timebase(dt, sys.dt)
File "/usr/local/anaconda3/envs/c/lib/python3.9/site-packages/control/namedio.py", line 340, in common_timebase raise ValueError("Systems have incompatible timebases")
ValueError: Systems have incompatible timebases
In my case, the calling function init in iosys.py, line 895 is initializing "dt" as 0 from the global default then passing this as the first arg to common_timebase, while the second arg is the sys.dt from the first system in the list of systems being combined. This results in the ValueError. All systems in syslist have dt = 0.05 and pass common_timebase with each other when passed as args manually while stopped in debugger.
It seems like the intent for the object init functions in this module is probably that dt should be initialized as the dt of the first system in the syslist, but that is not what the code is doing.
As a work-around, running the same script with release 0.9.1 works.
Thanks for the pointer. Sounds like a bug might have been introduced in a
change to underlying code for how state-space systems are handled. Could
you post code that reproduces the bug?
S
On Tue, Aug 2, 2022 at 4:08 PM DC ***@***.***> wrote:
Using control.series to connect several discrete state-space systems, all
with dt=0.05, is resulting in "ValueError:Systems have incompatible
timebases" from "common_timebase" in namedio.py line 340 in release 0.9.2.
File
"/usr/local/anaconda3/envs/c/lib/python3.9/site-packages/control/bdalg.py",
line 108, in series return reduce(lambda x, y:y*x, sysn, sys1)
File
"/usr/local/anaconda3/envs/c/lib/python3.9/site-packages/control/bdalg.py",
line 108, in return reduce(lambda x, y:y*x, sysn, sys1)
File
"/usr/local/anaconda3/envs/c/lib/python3.9/site-packages/control/iosys.py",
line 184, in *mul* newsys = InterconnectedSystem(
File
"/usr/local/anaconda3/envs/c/lib/python3.9/site-packages/control/iosys.py",
line 895, in *init* dt = common_timebase(dt, sys.dt)
File
"/usr/local/anaconda3/envs/c/lib/python3.9/site-packages/control/namedio.py",
line 340, in common_timebase raise ValueError("Systems have incompatible
timebases")
ValueError: Systems have incompatible timebases
In my case, the calling function *init* in iosys.py, line 895 is
initializing "dt" as 0 from the global default then passing this as the
first arg to common_timebase, while the second arg is the sys.dt from the
first system in the list of systems being combined. This results in the
ValueError. All systems in syslist have dt = 0.05 and pass common_timebase
with each other when passed as args manually.
It seems like the intent for the object *init* functions in this module
is probably that dt should be initialized as the dt of the first system in
the syslist, but that is not what the code is doing.
As a work-around, running the same script with release 0.9.1 works.
—
Reply to this email directly, view it on GitHub
<#754>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AN74SSKKIWBHOWVEAL3O2H3VXGS55ANCNFSM55M2Z4CA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
--
Sawyer Fuller
Assistant Professor of Mechanical Engineering
Adjunct, Paul G Allen School of Computer Science
University of Washington
http://faculty.washington.edu/~minster/
(Typed with my thumbs)
I cannot find a commit g3b5f199. Where did you install python-control from?
The fix has been merged into the main branch with b9cf384 in August. It is not part of the 0.9.2 release as that one was in May. The next release will have the fix.
Installed it through anaconda
'''conda install -c conda-forge control slycot'''
print(control.version) gives: 0.9.2
conda list gives:
control 0.9.2 pyhd8ed1ab_0 conda-forge
No worries, just mentioning it, bc the issue was closed, i thought it should've been included already in the release.
But i can pull the main repo cherrypick the fixes.
Activity
sawyerbfuller commentedon Aug 3, 2022
dc5048 commentedon Aug 3, 2022
The following prints a 4-state state-space object in 0.9.1, but fails with ValueError in 0.9.2:
fix timebase bug in InterconnectedSystem (issue python-control#754)
fix timebase bug in InterconnectedSystem (issue python-control#754)
Merge pull request #755 from murrayrm/timebase_bug-03Aug2022
bnavigator commentedon Aug 6, 2022
Fixed by #755. Thanks @murrayrm !
Ryton commentedon Nov 4, 2022
this still seems broken in
commit = 'g3b5f199'
VERSION
0.9.2
As the minimal example throws an error for me.
bnavigator commentedon Nov 4, 2022
I cannot find a commit g3b5f199. Where did you install python-control from?
The fix has been merged into the main branch with b9cf384 in August. It is not part of the 0.9.2 release as that one was in May. The next release will have the fix.
Ryton commentedon Nov 9, 2022
Installed it through anaconda
'''conda install -c conda-forge control slycot'''
print(control.version) gives: 0.9.2
conda list gives:
control 0.9.2 pyhd8ed1ab_0 conda-forge
No worries, just mentioning it, bc the issue was closed, i thought it should've been included already in the release.
But i can pull the main repo cherrypick the fixes.