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 — Fixes for sample code for ERA-OKID from Data-Driven Science and Engineering · python-control/python-control · Discussion #1186

Fixes for sample code for ERA-OKID from Data-Driven Science and Engineering #1186

RPellowski started this conversation in General
Fixes for sample code for ERA-OKID from Data-Driven Science and Engineering #1186
@RPellowski RPellowski
Jan 12, 2023 · 2 comments
Return to top
Discussion options
  • Uh oh!

    There was an error while loading. Please reload this page.

RPellowski
Jan 12, 2023

What is the issue?

This code must have worked at one time but is now broken. Have no previous experience with it running correctly.

Two issues related to:

  • http://databookuw.com ... DATA DRIVEN SCIENCE & ENGINEERING ... CODE.zip + DATA.zip (PYTHON CODE)

Notebook containing the broken code:

  • CH09_SEC03_ERA_OKID.ipynb

Steps to Reproduce

  1. Test on Python 3.10
  2. Run the notebook

Source changes to accommodate the failures

The following changes to the source were needed:
Issue 1. Slice assignment
Change
yFull[:,:,qi],t = impulse(sysFull,T=tspan,input=qi)
to
yFull[:,:,qi:qi+1],t = impulse(sysFull,T=tspan,input=qi)

Change
y1[:,:,qi],t1 = impulse(sysFull,np.arange(200),input=qi)
y2[:,:,qi],t2 = impulse(sysERA,np.arange(100),input=qi)
y3[:,:,qi],t3 = impulse(sysERAOKID,np.arange(100),input=qi)
to
y1[:,:,qi:qi+1],t1 = impulse(sysFull,np.arange(200),input=qi)
y2[:,:,qi:qi+1],t2 = impulse(sysERA,np.arange(100),input=qi)
y3[:,:,qi:qi+1],t3 = impulse(sysERAOKID,np.arange(100),input=qi)

Issue 2. Invalid np array shape
Change
yRandom = lsim(sysFull,uRandom,range(200))[0].T # Output
to
yRandom = lsim(sysFull,uRandom.T,range(200))[0].T # Output

Summary

Potential root causes could be due to changes in this library or in changes to Python or both.

You must be logged in to vote
All reactions

Replies: 2 comments

Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

Scowt
Sep 5, 2025

Thanks for posting the fixes, I was struggling to get the OKID example working. Confirmed to still be valid with Python 3.13.3 and Control 0.10.2

You must be logged in to vote
All reactions
0 replies
Comment options
  • Uh oh!

    There was an error while loading. Please reload this page.

murrayrm
Nov 9, 2025
Maintainer

Converting this to a discussion topic so that others can find it in the future.

You must be logged in to vote
All reactions
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
💬
General
Labels
None yet
3 participants
@RPellowski @murrayrm @Scowt
Converted from issue

This discussion was converted from issue #847 on November 09, 2025 02:52.

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.