I used Sippy to identify a simple RC tag system. from sippy import system_identification as sysidopenLoopInput = [0, 0, 0, 0, 0, 100, 100, 100, 100, 100, 100, 100, 100, 100, 100,]m = sysid(openLoopOutput, openLoopInput, 'FIR', FIR_orders=[10,1], tsample=1)
r2_score is perfect 1.0 print(m.G) <TransferFunction>: sys[0]Inputs (1): ['u[0]']Outputs (1): ['y[0]']0.1744 z^9 + 0.1744 z^8 + 0.1744 z^7 + 0.1744 z^6 + 0.1744 z^5 + 0.011 z^4 + 0.007 z^3 + 0.003 z^2-------------------------------------------------------------------------------------------------- z^11dt = 1.0
now I'm trying to simulate it using control lib simInput = [0, 0, 0, 0, 0, 120, 120, 120, 120, 120, 120, 120,]dataLen = len(simInput)simout, _, _ = control.matlab.lsim(m.G, simInput, np.linspace(0, dataLen-1, dataLen))control/timeresp.py:1083: UserWarning: return_x specified for a transfer function system. Internal conversion to state space used; results may meaningless.
gives response of
 which is different from measured step response
 I'm just trying to connect the two libraries together without a PhD. |