-
Notifications
You must be signed in to change notification settings - Fork 126
Description
Summary
run_time_response() presently obliges users to build the complete external‐force matrix (F) or to supply a custom callback via add_to_RHS whenever unbalance effects are required. This leads to redundant, error-prone code, as each user must recreate the same harmonic loading scheme. Introducing first-class, declarative unbalance parameters—similar to the existing run_unbalance_response() in the frequency domain—would streamline time-domain simulations.
Current Limitation
- Users must manually construct the unbalance force terms (or embed them in a callback).
- There is no built-in mechanism to combine a user-supplied force matrix with standard unbalance loading in a transparent manner.
Proposed Enhancement
Add native unbalance handling to run_time_response(), enabling the caller to specify any number of unbalances via the following parameters:
| Parameter | Type | Description |
|---|---|---|
| node | int or list[int] | Node index where the unbalance is located. |
| mass (mε) | float or Quantity | Unbalance magnitude (kg·m). |
| phase | float (rad) | Initial phase angle. |
| (optional) speed | float or np.ndarray | Rotor speed; defaults to the speed argument already passed to the method. |
For each unbalance the method would form
and inject these components at the relevant global DoFs.
If a user also supplies an explicit force matrix, the internally generated unbalance forces must be superimposed (i.e., F_total = F_user + F_unbalance).
Implementation Suggestions
-
API Extension
def run_time_response( self, speed, force=None, time_range=None, …, unbalance_nodes=None, unbalance_masses=None, unbalance_phases=None, ): …Behaviour
- If all
unbalance_*arguments areNone, keep current behaviour. - If any
unbalance_*argument is provided:- Build
F_unbalanceinternally. - If
forceis also provided, computeF = force + F_unbalance; otherwise setF = F_unbalance.
- Build
- If all
-
Code Reuse
- Leverage the existing node-to-DoF mapping and vectorised operations from
run_unbalance_response()to assembleF_unbalance. - Support both scalar-speed (steady) and array-speed (transient spin-up/down) cases.
- Leverage the existing node-to-DoF mapping and vectorised operations from
-
Multiple Unbalances & Vectorisation
- Accept sequences for nodes, masses, and phases to handle multiple unbalances in one call.
- Employ
numpybroadcasting to avoid explicit Python loops over time steps.
-
Documentation & Examples
- Add a subsection “Time Response with Native Unbalance” detailing constant- and variable-speed scenarios.
- Provide comparative plots demonstrating equivalence between the new interface and the manual force-matrix approach.
-
Unit Tests
- Validate that results obtained with the new parameters match legacy manual constructions.
- Include tests combining user-supplied
forcematrices with unbalance parameters to ensure correct superposition.
Expected Benefits
- Usability – Removes routine boilerplate and reduces user error in force-matrix assembly.
- Flexibility – Allows simultaneous use of bespoke external forces and standard unbalance loads through simple superposition.
- Consistency – Brings the time-domain API in line with the well-established frequency-domain workflow.
- Extensibility – Provides a foundation for future enhancements such as automated parametric studies or stochastic unbalance modelling.
Thank you for considering this enhancement. Native unbalance support in run_time_response() will improve the fidelity and ergonomics of time-domain simulations within ROSS.