10 using namespace gravitation;
51 , massRocket{ mrocket }
53 , vRelative{ vrocket }
63 _tB = (mass0 - massRocket) / lambda;
64 _vB = vRelative * log(mass0 / massRocket) -
Earth::g * _tB;
65 _zB = vRelative / lambda * (mass0 - massRocket + massRocket * log(massRocket / mass0))
81 inline double mass(
double t)
const {
82 if (is_propellant(t)) {
83 return mass0 - lambda * t;
94 return lambda / mass(t) * vRelative -
Earth::g;
103 const double term0 = mass(t) / mass0;
104 const double term1 = term0 * log(term0) * vRelative;
105 const double term2 = 0.5 *
Earth::g * pow(t, 2);
106 return vRelative * t + (mass0 / lambda) * term1 - term2;
115 const double term = mass0 / mass(t);
116 return vRelative * log(term) -
Earth::g * t;
124 inline double time()
const {
return _tB; }
138 inline double height()
const {
return _zB; }
165 inline int odefn(
double t,
const double fin[],
double fout[]) {
169 fout[2] = lambda / fin[0] * vRelative -
Earth::g;
178 void exec(
double t0 = 0,
double tstep = 1) {
180 Ode myOde{ *
this, 1e-2, 1e-6, 0 };
182 double t = t0, dt = tstep;
185 while (myOde[0] > massRocket) {
197 for (
auto &crow : _data.data()) {
198 const double t = crow[0];
201 crow[6] = velocity(t);
220 const double m0 = 2.85e6;
221 const double M = 0.27 * m0;
222 const double lambda = 13.84e3;
225 const double vR = 2.46_km;
226 const double z0 = 0.0;
227 const double v0 = 0.0;
230 C1200 cobj{ m0, M, lambda, vR, { z0, v0 } };
The X1200 class Bewegung einer Rakete in einem konstanten Gravitationsfeld (Modellklasse) ...
double mass(double t) const
mass Masse als Funktion der Zeit
void exec(double t0=0, double tstep=1)
exec Berechnung der numerischen Lösung
X1200(double minit, double mrocket, double l, double vrocket, IValues ivals)
X1200 Konstruktor mit Liste aller Eingabeparameter.
double velocity() const
velocity Geschwindigkeit zum Zeitpunkt zu dem der gesamte Treibstoff verbraucht ist ...
void set_init_conditions(double t, const Array &y)
set_init_conditions lege Anfangsbedingungen fest
double velocity(double t) const
velocity Geschwindigkeit als Funktion der Zeit
The Odeiv2 class numerische Lösung eines Systems von N Differenzialgleichungen Schnittstelle zur gsl...
The XModel class Basisklasse speichert eine ID in Form einer Zeichenkette enthält Hilfsfunktionen zur...
int odefn(double t, const double fin[], double fout[])
odefn Schnittstelle zur gsl
void save_data()
save_data schreibe berechnete Daten
bool is_propellant(double t) const
is_propellant Treibstoff als Funktion der Zeit
double height() const
height Höhe zum Zeitpunkt zum dem der gesamte Treibstoff verbraucht ist
The C1200 class Bewegung einer Rakete in einem konstanten Gravitationsfeld (Rechenmodell) ...
double height(double t) const
height Höhe als Funktion der Zeit
std::array< double, 2 > IValues
double acceleration(double t) const
acceleration Beschleunigung als Funktion der Zeit
void run()
run Bewegung einer Rakete in einem konstanten Gravitationsfeld (Berechnung von Beispielwerten) ...
double time() const
time Zeitpunkt zu dem der gesamte Treibstoff verbraucht ist
static const Format latex
static constexpr double g
static void all(const std::string &s, std::initializer_list< bool > lst)
input teste mehrere Bedingungen auf einmal