three body problem en c++
I´m in a beginners course for programmation and we got a little project. I chose to simulate the three body problem using the euler method. Even though the system is chaotic there are some special cases wich produce symetric trajectories. I get most of them, but the most important one doesn´t come out. 82
It´s called figure 8 and supposed to be stabil. I get something similar.
I´m sure that the initial conditions are fine. And the program should be as well, as I get the other expected results. So the question is wether there is an error in my program or the euler method doesn´t work for this spefic case. (I would then change to the Runge Kutta method)
I appreciate any kind of help!
#include <iostream>
#include <cmath>
#include <fstream>
using namespace std;
double const ms=1.0000000000000000;
double const me=1.0000000000000000;
double const mm=1.0000000000000000;
double const G=1.000000000000000000;
double const dt=0. 394