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