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 — fixed bug in calculation of percent overshoot by sawyerbfuller · Pull Request #555 · python-control/python-control

Conversation

@sawyerbfuller

@sawyerbfuller sawyerbfuller commented Mar 4, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown
Contributor

Now it gives the correct result even if the transfer function is not strictly proper.

Other changes:

  • step_info now calculates overshoot with respect to dcgain rather than the final (edit: numeric) value of the (computed) step response.
  • adjusted the length of the step response to go for a little longer, to within 0.1% rather than 1% of steady-state, to improve precision of step_info (and updated unit tests)

a remark: sys.dcgain() now always returns a complex number because it evaluates at a frequency of zero (1 for DT systems) (as a result of #542?). This returns a real-valued complex number. I think there is a reasonable argument that it should be cast to a float because currently we assume system parameters are real-valued.

Sorry, something went wrong.

Uh oh!

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

All reactions
sawyerbfuller added 2 commits March 4, 2021 10:20
@sawyerbfuller
fixed bug in calculation of pct overshoot that neglects not strictly …
9c87a5b
…proper transfer functions.
@sawyerbfuller
slight adjustment of decay time in step response
b36d053
@sawyerbfuller sawyerbfuller linked an issue Mar 4, 2021 that may be closed by this pull request
step_info overshoot error #554
Closed
@coveralls

coveralls commented Mar 4, 2021

Copy link
Copy Markdown

Coverage Status

Coverage remained the same at 88.861% when pulling b36d053 on sawyerbfuller:fix-stepinfo into 66d4a53 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

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

@murrayrm

murrayrm commented Mar 4, 2021

Copy link
Copy Markdown
Member

Is #337 also addressed, by chance?

All reactions

Sorry, something went wrong.

Uh oh!

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

@sawyerbfuller

sawyerbfuller commented Mar 4, 2021

Copy link
Copy Markdown
Contributor Author

sorry, didn't have a chance to get to that one on this PR

All reactions

Sorry, something went wrong.

Uh oh!

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

@bnavigator
bnavigator merged commit 92de12d into python-control:master Mar 8, 2021
@bnavigator

bnavigator commented Mar 8, 2021

Copy link
Copy Markdown
Contributor

LGTM

All reactions

Sorry, something went wrong.

Uh oh!

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

@juanodecc

juanodecc commented Mar 8, 2021

Copy link
Copy Markdown
Contributor

Dear @sawyerbfuller, the solution could have problem with systems with initial condition different of zero. I want to contribute , but at the moment, I don't now how test the last version.

I maked this example, to explain:

import numpy as np
import control as ctrl
import matplotlib.pyplot as plt

A = [[0,1,0],[0,0,1],[-1,-2,-3]]
B = [[0],[0],[1]]
C = [1,0,0]
D = 0

sys=ctrl.ss(A,B,C,D)

t= np.linspace(0,20,1000)
t1,y1 =ctrl.step_response(sys,t,[-1,0,2])

plt.plot(t1,y1)
ctrl.step_info(sys)

new_overshoot = 100. * (y1.max() - sys.dcgain()) / sys.dcgain()
print('new_overshoot =', new_overshoot)

{'RiseTime': 2.616832783582626,
'SettlingTime': 9.555404558233526,
'SettlingMin': 0.8926922608222024,
'SettlingMax': 1.1446150537879327,
'Overshoot': 15.77739060863902,
'Undershoot': 0.0,
'Peak': 1.1446150537879327,
'PeakTime': 6.06629418012336,
'SteadyStateValue': 0.9886343506022361}

new_overshoot = 38.34913836051592

All reactions

Sorry, something went wrong.

Uh oh!

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

@bnavigator

bnavigator commented Mar 8, 2021

Copy link
Copy Markdown
Contributor

But ctrl.step_info(sys) does not have any initial conditions. It does know nothing of the step_response() call.

All reactions

Sorry, something went wrong.

Uh oh!

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

@murrayrm murrayrm added this to the 0.9.0 milestone Mar 20, 2021
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.9.0

Development

Successfully merging this pull request may close these issues.

step_info overshoot error

Uh oh!

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

5 participants

@sawyerbfuller @coveralls @murrayrm @bnavigator @juanodecc
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 01402520 — 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.