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
Unexpected behavior for a system defined using zpk #1067
I been scratching my head about whats going on with a very simple system.
Defining the system using tf yields results as expected. But defining the system through zpk does not.
Description
I intend to define the next system:
G(s) = K
---------------
(s+2)*(s+2/3)
With K adjusted for a ts=1 second. Very straight forward.
Reproduction
This is my code for zpk:
import control as ct
import numpy as np
import matplotlib.pyplot as plt
K = 10.314
G = ct.zpk([], [-2, -2/3], K)
T = ct.feedback(G)
ct.step_response(T).plot()
Outputting both system definitions reveals they're the same. The transfer function is exactly the same. But I don't know what may be going on with the transfer object defined with zpk.
System info
I've installed the control package in a clean conda enviroment and using a jupyter notebook through VSCode.
Conda:
conda version : 23.1.0
conda-build version : 3.22.0
python version : 3.9.13.final.0
virtual packages : __archspec=1=x86_64__win=0=0
platform : win-64
This same issue came up in #1062 and was fixed in #1064. The issue is that timebase in zpk was not being set correctly and so it was getting interpreted as a discrete time system.
If you don't want to check out the latest main branch, you can fix the problem by changing the zpk call to
This same issue came up in #1062 and was fixed in #1064. The issue is that time timebase in zpk was not being set correctly and so it was getting interpreted as a discrete time system.
If you don't want to check out the latest main branch, you can fix the problem by changing the zpk call to
G = ct.zpk([], [-2, -2/3], K, dt=0)
Thank you for the help. I'm kind of ashamed I didn't found those issues when searching.
Activity
murrayrm commentedon Nov 27, 2024
This same issue came up in #1062 and was fixed in #1064. The issue is that timebase in
zpkwas not being set correctly and so it was getting interpreted as a discrete time system.If you don't want to check out the latest main branch, you can fix the problem by changing the
zpkcall togereze commentedon Nov 27, 2024
Thank you for the help. I'm kind of ashamed I didn't found those issues when searching.