Time Windowing for Time Response Plots - #1416
murilloabs wants to merge 17 commits into
Conversation
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1416 +/- ##
==========================================
+ Coverage 81.71% 81.73% +0.02%
==========================================
Files 167 167
Lines 26424 26556 +132
==========================================
+ Hits 21592 21706 +114
- Misses 4832 4850 +18
Continue to review full report in Codecov by Harness.
🚀 New features to boost your workflow:
|
|
Hi, @murilloabs! Great work on this PR! The structure is clean, the new tests are well-scoped, and the I tested the changes locally using a fresh virtual environment with an editable install. The new tests, the affected doctests, There is one issue I would like to resolve before merging, along with a few lower-priority findings worth considering. 1.
|
Transient Response WindowingChanges
|
|
Hi, @murilloabs! Thanks for the quick follow-up. Passing speed through to the results fixes the unreachable lookup I pointed out before. I re-ran the affected suites on That change has one side effect I want to flag, and I pushed a fix for it to your branch. Saved results were no longer readable by ROSS 3.0
What I pushedI added a small compatibility mechanism to
Compatibility matrixI checked all four directions against
Tests
This resolves the compatibility concern from my side. Thanks again for the contribution! |
Summary
This pull request aims to solve the Issue #1415.
So, this PR adds consistent time-window support to transient-response plots and improves automatic one-cycle detection.
The following plotting methods can now select a regular time interval or one complete response cycle:
TimeResponseResults.plot_1dTimeResponseResults.plot_2dTimeResponseResults.plot_3dThe feature is available through the following optional keyword arguments:
t_initial: Initial time of the selected interval, in seconds.t_final: Final time of the selected interval, in seconds.one_cycle: Select exactly one response cycle when set toTrue.The default behavior remains unchanged when none of these arguments is provided.
Motivation
Transient simulations often contain startup effects, several rotor revolutions, or a long response history that is not representative of the steady-state orbit. Plotting the complete response can make the final orbit difficult to inspect and can hide the behavior of interest.
The new windowing options make it possible to:
Regular Time Windows
When
one_cycle=False,t_initialandt_finaldefine a regular time window.Both limits must be provided together:
The same window can be applied to the orbit plots:
The time limits are interpreted in seconds and must satisfy the following conditions:
t_initialmust be smaller than or equal tot_final.t_initialort_final.The first stored sample greater than or equal to
t_initialis selected. Samples up to and includingt_finalare selected. The originalself.tandself.youtarrays are not modified.Examples of invalid calls:
One-Cycle Selection
When
one_cycle=True, the selected interval has one response period. The cycle frequency is determined using the following priority:TimeResponseResults.speed, when available and valid.rotor.speed, when available and valid.Angular speed values in rad/s are converted to frequency in Hz using:
When the frequency must be obtained from the response, the algorithm:
compute_dfftimplementation.This approach reduces the influence of startup transients and focuses the automatic detection on the final response behavior.
Automatic Final Cycle
Without a time anchor, the last complete cycle is selected:
The selected interval is equivalent to:
where
t_finalis the final time value in the stored response.Cycle Anchored by
t_initialProviding only
t_initialstarts one cycle at the selected time:The selected interval is:
Cycle Anchored by
t_finalProviding only
t_finalends one cycle at the selected time:The selected interval is:
Invalid Combination
one_cycle=Truecannot be combined with botht_initialandt_final, because the cycle duration is determined automatically:Use a regular time window when both boundaries must be fixed explicitly:
Plot Behavior
plot_1dplot_2dplot_3d