Repository navigation
Conversation
If the response never reaches the rise time limits (e.g. the default time vector ends too early for a system with a large feedthrough transient), np.nonzero(...)[0][0] raised IndexError. Leave RiseTime, SettlingMin and SettlingMax as NaN in that case.
Member
|
@syahra712 Can you open an issue first, reporting the supposed bug that you are fixing? |
Member
|
@syahra712 Also, can you verify whether this PR was opened automatically by an AI agent? |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
step_info()raisesIndexErrorwhen the response never reaches the rise-time limits within the time vector:This system is stable. The step response starts at 2.99, from the feedthrough, and decays to the DC gain of -0.0242. The default time vector ends at about 2.44 s, where the response is about -0.021. That is only about 87% of the final value, so
np.nonzero(...)[0][0]for the 90% level is empty. The same error happens for time-series input whoseyfinalis never approached, e.g.ct.step_info(1 - np.exp(-t), t, yfinal=1)withtin[0, 1].Fix: if either rise-time level is never reached,
RiseTime,SettlingMinandSettlingMaxstayNaN.SettlingMinandSettlingMaxare measured from the rise time onward. The other entries are computed as before.SettlingTimealready falls back toNaNwhen the response doesn't settle. This follows the same idea as the fix for #1014.Tests: added
test_step_info_rise_not_reachedtotimeresp_test.py.IndexError, and passes with it.control/testsresult: 3858 passed, 554 skipped (no slycot).ruff checkis clean on the changed files.AI-assisted (Claude): I used it to help read the code and draft the test. I reviewed and ran everything myself.