22 Motor(
const std::string& name,
double initialPropellantMass,
double totalImpulse);
48 void update(
double deltaTime);
72 const std::string&
getName()
const;
~Motor()=default
Default destructor.
double ignitionTime_
Elapsed time since ignition [s].
Definition Motor.h:84
double getCurrentThrust() const
Gets the current thrust output.
Definition Motor.cpp:56
bool burnedOut_
Whether the motor has finished burning.
Definition Motor.h:86
bool ignited_
Whether the motor has been ignited.
Definition Motor.h:85
bool isBurnedOut() const
Checks whether the motor has burned out.
Definition Motor.cpp:60
const std::string & getName() const
Gets the name of the motor.
Definition Motor.cpp:68
void ignite()
Starts motor ignition (sets internal ignition time to zero).
Definition Motor.cpp:23
double remainingPropellantMass_
Current propellant mass [kg].
Definition Motor.h:78
double currentThrust_
Cached current thrust [N].
Definition Motor.h:88
void addThrustDataPoint(double time, double thrust)
Adds a thrust curve data point.
Definition Motor.cpp:19
double interpolateThrust(double time) const
Linearly interpolates thrust from the thrust curve.
Definition Motor.cpp:74
std::vector< std::pair< double, double > > thrustCurve_
Thrust curve (time, thrust) points.
Definition Motor.h:82
double getRemainingPropellantMass() const
Returns the remaining propellant mass.
Definition Motor.cpp:64
std::string name_
Name of the motor.
Definition Motor.h:75
double initialPropellantMass_
Initial propellant mass [kg].
Definition Motor.h:77
Motor(const std::string &name, double initialPropellantMass, double totalImpulse)
Constructs a new Motor with a given name and mass properties.
Definition Motor.cpp:6
void update(double deltaTime)
Updates the motor status based on elapsed time.
Definition Motor.cpp:29
double totalImpulse_
Total impulse [Ns], used for sanity checks.
Definition Motor.h:80