- Notifications
You must be signed in to change notification settings - Fork441
Description
Hi,
Here is unexpected behaviour when I create an LTI system withct.zpk
, put it in unity feedback usingct.feedback
, and compute thect.step_response
of the resulting feedback system. For the tested system, the result should be stable, but it is not.
Here's the code:
import control as ctimport numpy as npimport matplotlib.pyplot as plt# the systemG = ct.zpk([],[0,-5,-10],1)print(G)K = 500ct.root_locus_plot(G,initial_gain = 500)
This generates the root locus, indicating the result for the gain 500, which shows that the system isstable in closed loop, for this gain value.
Here's the code where unexpected behaviour occurs:
# put the system in unity feedback, with gain of 500Gc = ct.feedback(G,K)print(Gc)# plot the step responsestepresp = ct.step_response(Gc)stepresp.plot()# check the pole locationspzmap = ct.pole_zero_map(Gc)print(pzmap.poles)
The response is clearlyunstable, while the poles have negative real parts (i.e. stable)!
On the other hand, creating the feedback system directly withct.tf
(as was computed higher up, so theoretically the same feedback system), results in a stable step response.
# create the feedGcexpl = ct.tf([],[1,15,50,500])print(Gcexpl)steprespexpl = ct.step_response(Gcexpl)steprespexpl.plot()
This step response is stable, as expected.
This indicates that the system generated byct.feedback
is not valid.
Any clue?
Thanks in advance!