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 — discard zero imaginary part for sys.dcgain() by bnavigator · Pull Request #579 · python-control/python-control

Conversation

@bnavigator

@bnavigator bnavigator commented Mar 19, 2021

Copy link
Copy Markdown
Contributor

Closes #578

Sorry, something went wrong.

Uh oh!

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

All reactions
@coveralls

coveralls commented Mar 19, 2021 •
edited
Loading

Uh oh!

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

Copy link
Copy Markdown

Coverage Status

Coverage increased (+0.2%) to 89.14% when pulling 9a54254 on bnavigator:dcgain-real into 22b9953 on python-control:master.

All reactions

Sorry, something went wrong.

Uh oh!

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

@bnavigator
bnavigator force-pushed the dcgain-real branch from f9db86a to d8bddbb Compare March 19, 2021 23:09
@bnavigator
discard zero imaginary part for sys.dcgain()
8c9e807
@bnavigator
bnavigator marked this pull request as ready for review March 19, 2021 23:10
@bnavigator
bnavigator force-pushed the dcgain-real branch from d8bddbb to 8c9e807 Compare March 19, 2021 23:10
@bnavigator
bnavigator requested a review from sawyerbfuller March 19, 2021 23:11
murrayrm
murrayrm reviewed Mar 19, 2021
View reviewed changes
Comment thread control/tests/freqresp_test.py Resolved

Uh oh!

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

Comment thread control/tests/freqresp_test.py Resolved

Uh oh!

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

Comment thread control/tests/freqresp_test.py
np.testing.assert_equal(
sys_tf.dcgain(warn_infinite=False), complex(np.nan, np.nan))
sys_tf.dcgain(warn_infinite=False), np.nan)

@murrayrm murrayrm Mar 19, 2021

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

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.

Sorry, something went wrong.

Uh oh!

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

All reactions

@bnavigator bnavigator Mar 19, 2021

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

Already exists:

python-control/control/tests/freqresp_test.py

Lines 505 to 507 in 8c9e807

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

Sorry, something went wrong.

Uh oh!

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

All reactions
@bnavigator
Apply review suggestions by @murrayrm: revert comment change, remove …
9a54254
…parameter
@bnavigator bnavigator mentioned this pull request Mar 20, 2021
enhance step_info to MIMO and time series of response data #577
Merged
@murrayrm
murrayrm merged commit 55d7e2b into python-control:master Mar 20, 2021
sawyerbfuller
sawyerbfuller reviewed Mar 20, 2021
View reviewed changes
Comment thread control/xferfcn.py
-------
gain : ndarray
The zero-frequency gain
gain : (outputs, inputs) ndarray or scalar

@sawyerbfuller sawyerbfuller Mar 20, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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

Sorry, something went wrong.

Uh oh!

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

All reactions
sawyerbfuller
sawyerbfuller reviewed Mar 20, 2021
View reviewed changes
Comment thread control/statesp.py
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

@sawyerbfuller sawyerbfuller Mar 20, 2021

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

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

Sorry, something went wrong.

Uh oh!

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

All reactions
@bnavigator bnavigator mentioned this pull request Mar 20, 2021
dcgain and step_info post PR merge cleanup #582
Merged
@murrayrm murrayrm added this to the 0.9.0 milestone Mar 20, 2021
@bnavigator
bnavigator deleted the dcgain-real branch February 18, 2024 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@murrayrm murrayrm murrayrm left review comments
@sawyerbfuller sawyerbfuller sawyerbfuller left review comments

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.

sys.dcgain() should return a real value rather than a complex value (until/unless we support complex coefficients)

Uh oh!

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

4 participants

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