9 using namespace gravitation;
21 double tMax = 0, yMax = 0;
22 double gvt = 0, vt2g = 0;
39 inline X2010(
double m,
double gm,
double y0in,
double v0in)
49 vTerminal = sqrt((mass) *
Earth::g / (gamma));
54 tMax = vTerminal /
Earth::g * atan((v0) / vTerminal);
55 const double term0 = 0.5 * pow(vTerminal, 2) /
Earth::g;
56 yMax = term0 * log(1 + pow((v0) / vTerminal, 2));
69 inline double ymax()
const {
return yMax; }
82 inline double a(
double t)
const {
91 inline double v(
double t)
const {
93 return vTerminal * tan(gvt * (tMax - t));
95 return -vTerminal * tanh(gvt * (t - tMax));
103 inline double y(
double t)
const {
105 return vt2g * log(cos(gvt * (tMax - t)) / cos(gvt * tMax));
107 return yMax - vt2g * log(cosh(gvt * (t - tMax)));
134 inline int odefn(
double t,
const double fin[],
double fout[]) {
137 fout[1] = -
Earth::g * (1 + gamma / (mass *
Earth::g) * fin[1] * abs(fin[1]));
146 Ode myOde{ *
this, 1e-2, 1e-9, 0 };
150 double t = 0, dt = 0.01;
152 _data += { t, myOde[0], myOde[1] };
155 }
while (myOde[0] > 0);
158 for (
auto &crow : _data.
data()) {
159 const double t = crow[0];
162 crow[5] = crow[3] + crow[4];
175 ofs << std::fixed << std::setprecision(4);
184 const double mass = 1.0;
185 const double y0 = 0.0;
186 const double v0 = 30.0;
188 for (
const auto gamma : { 1.3, 1.6, 2.0 }) {
190 C2010 cobj{ mass, gamma, y0, v0 };
static double kinetic_energy(double mass, double velocity)
kinetic_energy Hilfsfunktion
void set_init_conditions(double t, const Array &y)
set_init_conditions lege Anfangsbedingungen fest
The CModel class Bewegung mit Newtonscher Reibung numerische Lösung der Bewegungsgleichung (Rechenmod...
X2010(double m, double gm, double y0in, double v0in)
X2010 Konstruktor.
void exec()
solve_ode numerische Lösung der Bewegungsgleichung
double terminal_velocity() const
terminalVelocity
The X2010 class Bewegung mit Newtonscher Reibung (Modellklasse)
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...
static double potential_energy(double mass, double height)
potential_energy Hilfsfunktion
double time4ymax() const
time4ymax
void save_data()
save_data speichert Daten in Dateien
const auto & data() const
data lesender Zugriff auf die interne Struktur
auto select_total_rows(size_t n, size_t start=0, bool l=true) const
get_total_rows generiere View mit eine Instanz vom Typ View bestimmter Anzahl von Spalten ...
void run()
run Berechnung von Beispieldaten
static const Format latex
static constexpr double g
double v(double t) const
v Geschwindigkeit
double a(double t) const
a Beschleunigung
static void all(const std::string &s, std::initializer_list< bool > lst)
input teste mehrere Bedingungen auf einmal
double y(double t) const
y Höhe