11 using namespace gravitation;
21 double _v0y = 0, _v0x = 0;
28 const double H,
v0, theta0;
34 inline X710(
double m,
double yinit,
double vinit,
double angle)
43 _v0x = v0 * std::cos(theta0);
44 _v0y = v0 * std::sin(theta0);
51 inline double xmax()
const {
52 double term0 = pow(v0, 2) /
Earth::g * cos(theta0);
53 double term1 = pow(sin(theta0), 2) + (2 *
Earth::g * H) / pow(v0, 2);
54 return term0 * (sin(theta0) + sqrt(term1));
61 inline double ymax()
const {
62 return H + 0.5 * pow(_v0y, 2) /
Earth::g;
70 const double _tmp = _v0y + sqrt(pow(_v0y, 2) + 2 *
Earth::g * H);
85 return asin(v0 / sqrt(2 * pow(v0, 2) + 2 *
Earth::g * H));
93 inline double vx(
double t)
const {
103 inline double vy(
double t)
const {
104 return v0 * sin(theta0) -
Earth::g * t;
112 inline double x(
double t)
const {
return _v0x * t; }
119 inline double y(
double t)
const {
120 return H + vy(t) * t - 0.5 *
Earth::g * pow(t, 2);
145 inline int odefn(
double t,
const double fin[],
double fout[]) {
163 double x0 = 0.0, y0 = H;
165 double vx0 = _v0x, vy0 = _v0y;
169 Ode myOde{ *
this, 1e-2, 1e-9, 0 };
171 double t = 0, dt = 0.1;
173 _data += { t, myOde[0], myOde[1], myOde[2], myOde[3] };
180 }
while (myOde[1] >= 0);
183 for (
auto &crow : _data.data()) {
184 const double _velocity = sqrt(pow(crow[3], 2) + pow(crow[4], 2));
188 crow[8] = crow[6] + crow[7];
199 auto view = _data.select_total_rows(5);
200 std::stringstream sstr1;
202 auto ofslatex1 = get_output_stream(
Output::latex, sstr1.str());
204 return std::array{ row[0], row[1], row[2], row[3], row[4], row[5] };
207 std::stringstream sstr2;
209 auto ofslatex2 = get_output_stream(
Output::latex, sstr2.str());
211 return std::array{ row[0], row[1], row[2], row[6], row[7], row[8] };
220 const double H = 10.0;
221 const double mass = 1.0;
222 const double v0 = 10.0;
223 for (
double angle : { 10.0, 30.0, 45.0, 60.0 }) {
225 C710 cobj{ mass, H, v0, theta0 };
static double to_degrees(double x)
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
double x(double t) const
x -Koordinate als Funktion der Zeit
void run()
run Berechnung von Beispieldaten
double xmax_angle() const
xmax_angle
double t4xmax() const
t4xmax
void save_data()
save_data speichert Daten im LaTeX- und im CSV-Format
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
void exec()
solve_ode numerische Lösung der DGL
double y(double t) const
y -Koordinate als Funktion der Zeit
double vy(double t) const
vy y-Komponente der Geschwindigkeit als Funktion der Zeit
static double to_radians(double x)
double vx(double t) const
vx x-Komponente der Geschwindigkeit als Funktion der Zeit
X710(double m, double yinit, double vinit, double angle)
Konstruktor.
static const Format latex
double t4ymax() const
t4ymax
The C710 class Rechenmodell schiefer Wurf ohne Luftwiderstand.
static constexpr double g
static void all(const std::string &s, std::initializer_list< bool > lst)
input teste mehrere Bedingungen auf einmal
The X710 class schiefer Wurf ohne Luftwiderstand (Modellklasse)