Thanks to visit codestin.com
Credit goes to github.com

Skip to content

IndexError: index -1 is out of bounds for axis 0 with size 0 #1014

Closed
@NikolaiVChr

Description

@NikolaiVChr

I get this:

Traceback (most recent call last):
  File "C:\Users\me\PycharmProjects\f\control1.py", line 17, in <module>
    S = ct.step_info(sysdata=y_out2, T=T2)
  File "C:\Users\me\PycharmProjects\f\venv\lib\site-packages\control\timeresp.py", line 1614, in step_info
    settled = np.where(
IndexError: index -1 is out of bounds for axis 0 with size 0

From this: (just a simple integrator TF)

import control as ct
import numpy as np

num = [0,5]
den = [1,0]

H = ct.TransferFunction(num, den)

t = np.arange(start=0, stop=2, step=1/120)

T2, y_out2 = ct.timeresp.impulse_response(sys=H, T=t)
pyplot.figure(1)
pyplot.plot(T2, y_out2)
pyplot.grid(True)
pyplot.show(block=False)
S = ct.step_info(sysdata=y_out2, T=T2)

pyplot.show()

Control v0.10.0
Numpy 1.26.4
Scipy 1.14.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions