Skip to content

ENH: Make Static Margin Calculation Lazy #780

@MateusStano

Description

@MateusStano

Currently, the static margin calculation is performed during the simulation, which is unnecessary and potentially inefficient. This calculation should be deferred and performed only when it is explicitly needed. This adjustment could enhance the performance and streamline the simulation process.

Proposed Solution:

  • Refactor the static margin calculation so that it is computed lazily.
  • Ensure that the calculation is triggered only when the static margin value is specifically requested.
  • Use some logic like that of @cached_property, so that it is only calculated when its need
  • Make sure that whenever something is added/changed in the rocket that could chang the SM value (e.g. adding a new aero surface) the cached value is cleaned

Metadata

Metadata

Assignees

No one assigned

    Labels

    AerodynamicsAny problem to be worked on top of RocketPy's AerodynamicEnhancementNew feature or request, including adjustments in current codesRefactor

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions