Loading...
Searching...
No Matches
ForcesModel.h
Go to the documentation of this file.
#ifndef FORCESMODEL_H
#define FORCESMODEL_H
#include <array>
#include <memory>
class Rocket;
class Environment;
class FlightState;
class ForcesModel {
public:
ForcesModel(std::shared_ptr<Rocket> rocket,
std::shared_ptr<Environment> environment);
~ForcesModel() = default;
std::array<double, 3> computeNetForce(const FlightState& state) const;
std::array<double, 3> computeNetMoment(const FlightState& state) const;
private:
std::shared_ptr<Rocket> rocket_;
std::shared_ptr<Environment> environment_;
std::array<double, 3> computeAerodynamicDrag(const FlightState& state) const;
std::array<double, 3> computeThrust(const FlightState& state) const;
std::array<double, 3> computeGravity(const FlightState& state) const;
};
#endif // FORCESMODEL_H
Environment
Models atmospheric and gravitational conditions for the flight simulation.
Definition Environment.h:10
FlightState
Represents the physical state of the rocket at a given simulation time.
Definition FlightState.h:12
ForcesModel::computeAerodynamicDrag
std::array< double, 3 > computeAerodynamicDrag(const FlightState &state) const
Computes aerodynamic drag force based on velocity and rocket configuration.
Definition ForcesModel.cpp:55
ForcesModel::rocket_
std::shared_ptr< Rocket > rocket_
Rocket model reference.
Definition ForcesModel.h:50
ForcesModel::ForcesModel
ForcesModel(std::shared_ptr< Rocket > rocket, std::shared_ptr< Environment > environment)
Constructs a new ForcesModel.
Definition ForcesModel.cpp:16
ForcesModel::computeNetMoment
std::array< double, 3 > computeNetMoment(const FlightState &state) const
Computes the net external moment vector acting on the rocket.
Definition ForcesModel.cpp:48
ForcesModel::environment_
std::shared_ptr< Environment > environment_
Atmospheric and gravity conditions.
Definition ForcesModel.h:51
ForcesModel::computeGravity
std::array< double, 3 > computeGravity(const FlightState &state) const
Computes gravitational force based on altitude and mass.
Definition ForcesModel.cpp:128
ForcesModel::~ForcesModel
~ForcesModel()=default
Default destructor.
ForcesModel::computeNetForce
std::array< double, 3 > computeNetForce(const FlightState &state) const
Computes the net external force vector acting on the rocket.
Definition ForcesModel.cpp:24
ForcesModel::computeThrust
std::array< double, 3 > computeThrust(const FlightState &state) const
Computes thrust force based on motor outputs.
Definition ForcesModel.cpp:115
Rocket
Represents a complete rocket vehicle composed of stages, motors, and recovery systems.
Definition Rocket.h:20