9 using namespace gravitation;
34 inline X910(
double m1,
double m2,
double k,
double y0,
double v0)
41 , omega0{ sqrt(k / (m1 + m2)) }
50 return -pow(omega0, 2) * x;
59 return m2 *
Earth::g * (1 + y0 * pow(omega0, 2) /
Earth::g * cos(omega0 * t));
90 int odefn(
double t,
const double yin[],
double yout[]) {
93 yout[1] = acceleration(yin[0]);
104 Ode ode{ *
this, 1e-2, 1e-9, 0 };
106 double t = 0, dt = 0.001;
109 while (ode[1] <= 0) {
110 _normalForce2 = m2 * (-acceleration(ode[0]) +
Earth::g);
113 if (_normalForce2 < 0) {
139 std::stringstream sid;
140 sid << std::setprecision(2) << abs(y0);
141 const auto id = sid.str();
154 const double m1 = 1.5, m2 = .5, k = 200.0;
157 const double y0max = Earth::g / (k / (m1 + m2)), v0 = 0.0;
160 for (
const auto y0 : { 1.5 * y0max, y0max }) {
162 C910 cobj{ m1, m2, k, y0, v0 };
void save_data() const
save_data Speicherung der Daten in Dateien im CSV- und LaTeX-Format
void set_init_conditions(double t, const Array &y)
set_init_conditions lege Anfangsbedingungen fest
void run()
run Schwingung in vertikaler Richtung eines Systems aus zwei Massen (Berechnung von Beispieldaten) ...
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...
void exec()
exec Lösung der Bewegungsgleichung und Berechnung der Normalkraft auf m2
double normal_force2(double t) const
normal_force2 Normalkraft
The C910 class Schwingung in vertikaler Richtung eines Systems aus zwei Massen (Rechenmodell) ...
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 ...
The X910 class Schwingung in vertikaler Richtung eines Systems aus zwei Massen (Modellklasse) ...
static constexpr double PI
static const Format latex
static constexpr double g
X910(double m1, double m2, double k, double y0, double v0)
X910 Konstruktor.
double acceleration(double x) const
acceleration Beschleunigung