#ifndef FORCESMODEL_H #define FORCESMODEL_H #include #include class Rocket; class Environment; class FlightState; /** * @brief Computes aerodynamic, thrust, and gravitational forces acting on the rocket. * * The ForcesModel provides force and moment outputs based on the current rocket state, * environmental conditions, and rocket configuration. */ class ForcesModel { public: /** * @brief Constructs a new ForcesModel. * @param rocket Pointer to the rocket configuration. * @param environment Pointer to the simulation environment. */ ForcesModel(std::shared_ptr rocket, std::shared_ptr environment); /** * @brief Default destructor. */ ~ForcesModel() = default; /** * @brief Computes the net external force vector acting on the rocket. * @param state Current flight state. * @return Force vector (Fx, Fy, Fz) in Newtons. */ std::array computeNetForce(const FlightState& state) const; /** * @brief Computes the net external moment vector acting on the rocket. * * Initially returns zero (for 3-DoF), but structured for 6-DoF extension. * * @param state Current flight state. * @return Moment vector (Mx, My, Mz) in Newton-meters. */ std::array computeNetMoment(const FlightState& state) const; private: std::shared_ptr rocket_; ///< Rocket model reference. std::shared_ptr environment_; ///< Atmospheric and gravity conditions. /** * @brief Computes aerodynamic drag force based on velocity and rocket configuration. * @param state Current flight state. * @return Drag force vector (Newton). */ std::array computeAerodynamicDrag(const FlightState& state) const; /** * @brief Computes thrust force based on motor outputs. * @param state Current flight state. * @return Thrust force vector (Newton). */ std::array computeThrust(const FlightState& state) const; /** * @brief Computes gravitational force based on altitude and mass. * @param state Current flight state. * @return Gravity force vector (Newton). */ std::array computeGravity(const FlightState& state) const; }; #endif // FORCESMODEL_H