GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — IndexError: index -1 is out of bounds for axis 0 with size 0 · Issue #1014 · python-control/python-control

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

New issue
Copy link
New issue
Copy link
Closed
Closed
IndexError: index -1 is out of bounds for axis 0 with size 0#1014
Copy link
Labels
bug
Milestone
0.10.1

Description

@NikolaiVChr
NikolaiVChr
opened on Jun 27, 2024
Issue body actions

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

Activity

  1. NikolaiVChr commented on Jun 27, 2024

    @NikolaiVChr
    NikolaiVChr
    on Jun 27, 2024
    Author
    More actions

    I get same error with:

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

  2. NikolaiVChr commented on Jun 27, 2024

    @NikolaiVChr
    NikolaiVChr
    on Jun 27, 2024
    Author
    More actions

    Oh, and thank you for great library. Its awesome.

  3. murrayrm commented on Jun 27, 2024

    @murrayrm
    murrayrm
    on Jun 27, 2024
    Member
    More actions

    The bug is in the step_info function. The impulse response for a pure integrator is a constant output and step_info gets confused when it is passed something that doesn't look like a step response.

    Fixing the bug should be straightforward: we should probably issue a warning when we can't find the features we are looking for in a typical step response.

  4. murrayrm
    added
    bug
    on Jun 27, 2024
  5. murrayrm
    added this to the 0.10.1 milestone on Jun 27, 2024
  6. slivingston commented on Jul 13, 2024

    @slivingston
    slivingston
    on Jul 13, 2024
    Member
    More actions

    Fixed in #1029

  7. slivingston
    closed this as completedon Jul 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      • 0.10.1No due date

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.