Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fixed bug in calculation of percent overshoot#555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

sawyerbfuller
Copy link
Contributor

@sawyerbfullersawyerbfuller commentedMar 4, 2021
edited
Loading

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 ofstep_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 afloat because currently we assume system parameters are real-valued.

@sawyerbfullersawyerbfuller linked an issueMar 4, 2021 that may beclosed by this pull request
@coveralls
Copy link

Coverage Status

Coverage remained the same at 88.861% when pullingb36d053 on sawyerbfuller:fix-stepinfo into66d4a53 on python-control:master.

@murrayrm
Copy link
Member

Is#337 also addressed, by chance?

@sawyerbfuller
Copy link
ContributorAuthor

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

@bnavigatorbnavigator merged commit92de12d intopython-control:masterMar 8, 2021
@bnavigator
Copy link
Contributor

LGTM

@juanodecc
Copy link
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 npimport control as ctrlimport matplotlib.pyplot as pltA = [[0,1,0],[0,0,1],[-1,-2,-3]]B = [[0],[0],[1]]C = [1,0,0]D = 0sys=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

@bnavigator
Copy link
Contributor

Butctrl.step_info(sys) does not have any initial conditions. It does know nothing of thestep_response() call.

@murrayrmmurrayrm added this to the0.9.0 milestoneMar 20, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
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
5 participants
@sawyerbfuller@coveralls@murrayrm@bnavigator@juanodecc

[8]ページ先頭

©2009-2025 Movatter.jp