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

discard zero imaginary part for sys.dcgain()#579

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
murrayrm merged 2 commits intopython-control:masterfrombnavigator:dcgain-real
Mar 20, 2021

Conversation

bnavigator
Copy link
Contributor

Closes#578

@coveralls
Copy link

coveralls commentedMar 19, 2021
edited
Loading

Coverage Status

Coverage increased (+0.2%) to 89.14% when pulling9a54254 on bnavigator:dcgain-real into22b9953 on python-control:master.

@bnavigatorbnavigator marked this pull request as ready for reviewMarch 19, 2021 23:10
@@ -448,7 +448,7 @@ def test_dcgain_consistency():
np.testing.assert_equal(
sys_tf(0j, warn_infinite=False), complex(np.nan, np.nan))
np.testing.assert_equal(
sys_tf.dcgain(warn_infinite=False),complex(np.nan, np.nan))
sys_tf.dcgain(warn_infinite=False), np.nan)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Consider adding a test to show that dcgain() on a system with negative gain at zero frequency returns a negative number.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Already exists:

# Make sure that we get the *signed* DC gain
sys_tf=-1/ (s+1)
np.testing.assert_almost_equal(sys_tf.dcgain(),-1)

@murrayrmmurrayrm merged commit55d7e2b intopython-control:masterMar 20, 2021
@@ -1070,12 +1070,19 @@ def dcgain(self, warn_infinite=False):

Returns
-------
gain : ndarray
The zero-frequency gain
gain : (outputs, inputs) ndarray or scalar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

gain : (noutputs, ninputs) ndarray or scalar

zero-frequency (or DC) gain, or, if the frequency response is
singular, the array will be filled with (inf + nanj).

gain : (outputs, inputs) ndarray or scalar
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

gain : (noutputs, ninputs) ndarray or scalar

@murrayrmmurrayrm added this to the0.9.0 milestoneMar 20, 2021
@bnavigatorbnavigator deleted the dcgain-real branchFebruary 18, 2024 20:30
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@murrayrmmurrayrmmurrayrm left review comments

@sawyerbfullersawyerbfullersawyerbfuller left review comments

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

Successfully merging this pull request may close these issues.

sys.dcgain() should return a real value rather than a complex value (until/unless we support complex coefficients)
4 participants
@bnavigator@coveralls@murrayrm@sawyerbfuller

[8]ページ先頭

©2009-2025 Movatter.jp