9 using namespace gravitation;
36 X2000(
double m,
double b,
double y0,
double v0)
43 _mOverBeta = (mass) / (beta);
58 inline double v(
double t)
const {
59 return _vTerminal + (v0 - _vTerminal) * exp(-t / _mOverBeta);
67 inline double y(
double t)
const {
68 const double term1 = (v0 - _vTerminal);
69 const double term2 = (1 - exp(-t / _mOverBeta));
70 return _vTerminal * t + _mOverBeta * term1 * term2;
78 return _mOverBeta * log((_vTerminal - v0) / _vTerminal);
85 inline double ymax()
const {
return y(time4ymax()); }
114 inline int odefn(
double t,
const double fin[],
double fout[]) {
117 fout[1] = -
Earth::g - (beta / (mass)) * fin[1];
126 Ode myOde{ *
this, 1e-2, 1e-9, 0 };
128 double t = 0, dt = 0.01;
130 _data += { t, myOde[0], myOde[1] };
133 }
while (myOde[0] >= 0);
136 for (
auto &crow : _data.data()) {
137 const double t = crow[0];
138 const double yval = crow[1];
139 const double vval = crow[2];
142 crow[5] = crow[3] + crow[4];
157 ofs << std::fixed << std::setprecision(4);
169 const double y0 = 0.0, v0 = 10.0;
170 const double mass = 1.0;
172 for (
const auto beta : { 3.0, 6.0, 9.0 }) {
173 C2000 cobj{ mass, beta, y0, v0 };
The X2000 class Bewegung im konstanten Gravitationsfeld mit Reibung nach Stokes (Modellklasse) ...
static double kinetic_energy(double mass, double velocity)
kinetic_energy Hilfsfunktion
double time4ymax() const
time4ymax
double y(double t) const
y Ort als Funktion der Zeit
void set_init_conditions(double t, const Array &y)
set_init_conditions lege Anfangsbedingungen fest
int odefn(double t, const double fin[], double fout[])
odefn Schnittstelle zur gsl
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...
double terminal_velocity() const
terminalVelocity
void save_data()
save_data speichere Daten im Diagramm- und Tabellenformat.
static double potential_energy(double mass, double height)
potential_energy Hilfsfunktion
void run()
run Bewegung im konstanten Gravitationsfeld mit Reibung nach Stokes (Beispieldaten) ...
The C2000 class Bewegung im konstanten Gravitationsfeld mit Reibung nach Stokes (numerisch berechnete...
void exec()
solve_ode numerische Lösung der DGL numerische Lösung der Bewegungsgleichung
X2000(double m, double b, double y0, double v0)
X2000 Konstruktor.
double v(double t) const
v Geschwindigkeit als Funktion der Zeit
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