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

Round to nearest integer decade for default omega vector#688

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

bnavigator
Copy link
Contributor

Fixes#687.

The docstring for the_default_frequency_range() function says

This code looks at the poles and zeros of all of the systems that
we are plotting and sets the frequency range to be one decade above
and below the min and max feature frequencies, rounded to the nearest
integer.

The old code rounded to the floor and ceiling of the range, which occasionally adds another decade to one or the other end of the frequency range if the feature fallsjust inside of the outermost decade.

The new code rounds to the nearest integer, so it only adds half a decade at minimum.

@bnavigatorbnavigator changed the titleRound to nearest integer for default omega vectorRound to nearest integer decade for default omega vectorJan 4, 2022
@coveralls
Copy link

coveralls commentedJan 4, 2022
edited
Loading

Coverage Status

Coverage increased (+0.09%) to 93.591% when pulling021372f on bnavigator:omega_default_round intoa111b03 on python-control:master.

@bnavigator
Copy link
ContributorAuthor

Looking at the coveralls report, it turns out theHz parameter was never passed through to _default_frequency_range(). Fixed now.

From the sisotool test which had to be changed:

fromnumpyimportarrayfrommatplotlibimportpyplotaspltfromcontrolimportTransferFunction,bode_plottsys=TransferFunction(array([1000]),array([1,25,100,0]))# poles: [-20.,  -5.,   0.]forHzin [True,False]:plt.figure()bode_plot(tsys,Hz=Hz)
HzFalseTrue
BeforeFigure-rad-beforeFigure-Hz-before
AfterFigure-rad-afterFigure-Hz-after

@bnavigatorbnavigator merged commitdf6b352 intopython-control:masterJan 5, 2022
@murrayrm
Copy link
Member

@bnavigator In thinking through this overnight, I wonder if we might want to revert to the old behavior (floor, ceil) and update the documentation to match (+ update the unit tests to avoid the corner case). I'm worried that only going out a half decade might now show the asymptotic frequency response. I'll work up a couple of examples and post an issue so that we can discuss.

@bnavigator
Copy link
ContributorAuthor

Hmm, okay. We need to find another way to maketest_nyquist_indent more robust then.

@murrayrmmurrayrm added this to the0.9.2 milestoneApr 17, 2022
@bnavigatorbnavigator deleted the omega_default_round branchFebruary 18, 2024 20:30
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@murrayrmmurrayrmmurrayrm approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
0.9.2
Development

Successfully merging this pull request may close these issues.

python-control 0.9.1 fails intest_nyquist_indent on aarch64
3 participants
@bnavigator@coveralls@murrayrm

[8]ページ先頭

©2009-2025 Movatter.jp