Skip to content

Conversation

@jguarato
Copy link
Collaborator

This PR introduces two optimizations aimed at reducing computation time during modal analysis:

1. Precomputation of Partial Model Matrices
A portion of the model matrices (excluding contributions from bearing elements) is now precomputed during the instantiation of the Rotor object. Previously, this computation was repeated every time matrix build methods were called. This change avoids redundant calculations and improves efficiency.

2. Globalization of the circle Variable in the Orbit Class
The circle variable in the Orbit class has been refactored to a global constant. This eliminates the need to recalculate the CIRCLE array upon each instantiation of an Orbit object, further reducing unnecessary overhead.

The following test was performed by varying the values of n and freq:

rotor = rs.compressor_example()
rotor.run_campbell(speed_range=Q_(np.linspace(0, 3000, n), "RPM"), frequencies=freq)

The results are summarized in the table below. The optimized version achieved up to 37% reduction in execution time, with an average improvement of approximately 30% across different configurations.

Frequencies (freq) Speed Range Size (n) Time (Old version) [s] Time (Modified) [s] Difference (%)
9 30 5.29 4.12 22.24%
9 300 28.61 18.17 36.47%
9 900 86.79 54.32 37.41%
15 30 3.80 2.51 33.87%
15 300 35.23 23.09 34.47%
15 900 105.49 70.16 33.50%
21 30 4.77 3.29 30.95%
21 300 44.68 30.44 31.88%
21 900 132.94 92.59 30.36%

@raphaeltimbo raphaeltimbo merged commit 67503f3 into petrobras:main Aug 28, 2025
9 checks passed
@jguarato jguarato mentioned this pull request Sep 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants