Skip to content

Conversation

@jguarato
Copy link
Collaborator

@jguarato jguarato commented Sep 15, 2025

This PR introduces a new ModelReduction class that provides a modular and extensible framework for applying different model reduction techniques. Currently, two reduction strategies are implemented:

  • PseudoModal – reduction via modal transformation based on eigenvectors;
  • Guyan – static condensation method to reduce system DOFs.

The ModelReduction class is now integrated into the Rotor.run_time_response() method, enabling model reduction during transient simulations.

Example Usage

Guyan Reduction:

compressor = rs.compressor_example()

dt = 1e-4
t = np.arange(0, 10, dt)
speed = 600

node = [29]
unb_mag = [0.003]
unb_phase = [0]

probe_nodes = [30]

# Unbalance force
F, _, _, _ = compressor.unbalance_force_over_time(
    node=node, magnitude=unb_mag, phase=unb_phase, omega=speed, t=t
)

response = compressor.run_time_response(
    speed,
    F.T,
    t,
    method="newmark",
    model_reduction={
        "method": "guyan",
        "include_nodes": probe_nodes, # Make sure to include output nodes
        "dof_mapping": ["x", "y"],
    },
)

PseudoModal:

response = compressor.run_time_response(
    speed,
    F.T,
    t,
    method="newmark",
    model_reduction={
        "method": "pseudomodal",
        "num_modes": 22,
    },
)

For the compressor model available as an example in ROSS, a good approximation with the reduction model was obtained and a computational time reduction of ~70%:
REDUCED

By extracting the maximum response over a range of speeds—using the reduced model of another system mounted with ROSS —it was possible to obtain the following comparison:
newplot

jguarato and others added 7 commits September 25, 2025 10:03
- Replace mutable default arguments ([], ["x", "y"]) with None in Guyan.__init__
- Replace mutable default arguments in Guyan._separate_dofs
- Add proper None checks and initialization for default values
- Fix docstring in Guyan.revert_vector (was incorrectly stating "complete to reduced")

This eliminates the mutable default argument anti-pattern which could cause
subtle bugs where default values persist across multiple function calls.

All tests pass:
- 26 doctests in model_reduction.py
- 3 integration tests in test_transient_newmark.py
@raphaeltimbo raphaeltimbo merged commit ab269a9 into petrobras:main Oct 9, 2025
9 checks passed
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