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 — Fix impuse response, input data only contains one input[0]==1 in each trace by KybernetikJo · Pull Request #1023 · python-control/python-control

Conversation

@KybernetikJo

@KybernetikJo KybernetikJo commented Jul 3, 2024

Copy link
Copy Markdown
Contributor

Computation of impulse response was correct, but input in impulse response was not.

Sorry, something went wrong.

Uh oh!

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

All reactions
@KybernetikJo
Fix impuse response, input data only contains one inpute[0]==1 in eac…
a03ed38
…h trace
@coveralls

coveralls commented Jul 3, 2024

Copy link
Copy Markdown

Coverage Status

coverage: 94.533%. remained the same
when pulling a03ed38 on KybernetikJo:fix_impulse_response
into 4acc78b on python-control:main.

All reactions

Sorry, something went wrong.

Uh oh!

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

@KybernetikJo KybernetikJo changed the title Fix impuse response, input data only contains one inpute[0]==1 in each trace Fix impuse response, input data only contains one input[0]==1 in each trace Jul 3, 2024
@slivingston

slivingston commented Jul 3, 2024

Copy link
Copy Markdown
Member

@KybernetikJo Can you add a regression test that demonstrates the error you are fixing?

All reactions

Sorry, something went wrong.

Uh oh!

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

@KybernetikJo
Add regression test for discrete impulse response input
7624aeb
@KybernetikJo

KybernetikJo commented Jul 4, 2024

Copy link
Copy Markdown
Contributor Author
import numpy as np
import control as ct
print(ct.__version__)

A = [[.5, 0.25],[.0, .5]]
B = [[1., 0,],[0., 1.]]
C = [[1., 0.],[0., 1.]]
D = [[0., 0.],[0., 0.]]
dt = True
sysd = ct.ss(A,B,C,D, dt=dt)
response = ct.impulse_response(sysd,T=dt*3)

U = np.zeros((2,2,4), dtype=float).astype(object)
U[0,0,0] = 1./dt
U[1,1,0] = 1./dt

print(np.array_equal(response.inputs,U))
display(U)
display(response.inputs)

Expected / New behavior

0.10.1.dev76+g4acc78b.d20240703
True
array([[[1.0, 0.0, 0.0, 0.0],
        [0.0, 0.0, 0.0, 0.0]],

       [[0.0, 0.0, 0.0, 0.0],
        [1.0, 0.0, 0.0, 0.0]]], dtype=object)

array([[[1.0, 0.0, 0.0, 0.0],
        [0.0, 0.0, 0.0, 0.0]],

       [[0.0, 0.0, 0.0, 0.0],
        [1.0, 0.0, 0.0, 0.0]]], dtype=object)

Old behavior

0.10.0
False
array([[[1.0, 0.0, 0.0, 0.0],
        [0.0, 0.0, 0.0, 0.0]],

       [[0.0, 0.0, 0.0, 0.0],
        [1.0, 0.0, 0.0, 0.0]]], dtype=object)

array([[[1.0, 0.0, 0.0, 0.0],
        [1.0, 0.0, 0.0, 0.0]],

       [[1.0, 0.0, 0.0, 0.0],
        [1.0, 0.0, 0.0, 0.0]]], dtype=object)
All reactions

Sorry, something went wrong.

Uh oh!

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

@coveralls

coveralls commented Jul 4, 2024

Copy link
Copy Markdown

Coverage Status

coverage: 94.533%. remained the same
when pulling 7624aeb on KybernetikJo:fix_impulse_response
into 4acc78b on python-control:main.

All reactions

Sorry, something went wrong.

Uh oh!

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

@murrayrm
murrayrm merged commit 7a135d1 into python-control:main Jul 7, 2024
@murrayrm murrayrm added this to the 0.10.1 milestone Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

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

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

0.10.1

Development

Successfully merging this pull request may close these issues.

Uh oh!

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

4 participants

@KybernetikJo @coveralls @slivingston @murrayrm
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.