Repository navigation
Preserve timebase in model_reduction - #1276
Closed
Kiril1Shevtsov wants to merge 1 commit into
Closed
Kiril1Shevtsov wants to merge 1 commit into
Kiril1Shevtsov wants to merge 1 commit into
Conversation
Member
|
@Kiril1Shevtsov Is there an associated issue? If not, please open an issue first to get confirmation that it is indeed an issue. |
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.
Problem.
model_reductioncreates a reducedStateSpaceobject without passing the original system’s timebase. For a discrete-time model, this can cause the reduced system to lose its original sampling time and be treated as a continuous-time system.Change.
The change passes
sys.dtwhen constructing the reducedStateSpaceobject. This preserves the timebase of the input system in the reduced model.Tests.
The regression tests cover four timebase values (
0,None,Trueand0.1) across four reduction scenarios. On the original code, 12 of the 16 new cases failed; after the change, all 16 passed.The
modelsimptest module passed with 46 tests passed and 3 skipped. A broader run of themodelsimp,statespandltimodules reported 1,025 passed, 236 skipped and one expected failure. Ruff also passed.AI disclosure.
OpenAI tools were used for code review, as well as for writing part of the routine code. All code was reviewed by me personally.