Closed Francyrad closed 10 months ago
Hi Francesco,
I don't fully understand the issue you're having. The code is quite long and difficult to read. If you can, please provide a shorter example. But here are a few tips that might help you:
1) Instead of plotting orbits, you might just want to print out some cartesian coordinates of the particles to find where the problem is coming from. 2) If you have particles with a finite mass and you're working with orbital parameters, then the order in which you add particles matters because REBOUND assume Jacobi coordinates by default. I see that you use the primary argument in your code to calculate heliocentric orbital elements, so I assume you are aware of the subtleties. 3) Similarly, maybe there is an issue with calculating the orbital speed because more than one particle is massive? 4) There are a lot of magic numbers in your code. It's impossible for me to check where they are coming from. And units in general can often lead to some confusion. So double checking those might help as well.
I can look into it more, but I'd need to have a shorter example that doesn't rely on other files and I can run myself. Hanno
It's not a rebound issue, the problem came from Swiftsim and Swiftsimio. There is a conversion error apparently... So i close for the moment
thank you for the help and availability Francesco
Hi Francesco, I'm glad you found where the problem was coming from! Feel free to reopen the issue if something else comes up.
Hanno
Dear developers I wanted to study the trajectory of an asteroidal system following a SPH collision. So, i did the simulation and extract the velocities and masses to plot the system following the collision around the Sun. for example, at a distance of 1 AU.
So, i wanted to add a speed of vx of -29785 m/s in my system supponing that my target was in an orbit of 1 AU with e=0 befor collision
It is not important if I add this speed upstream, so when I extract my data, then plotting them on Rebound, "case A" (simulation velocities + orbital velocities --> REBOUND = orbit) or if I decide to load the raw speeds to REBOUND and then add the orbital speed with REBOUND "case B" (simulation velocities --> REBOUND + REBOUND_orbital_velocity = orbit). The result should always be the same orbit.
And yet I still get a difference that I can’t figure out. I can’t tell if there is any problem in REBOUND summing up the speeds
I also tried to run my simulation by implementing orbital speed added to the impact speed (so my system is comoving with a speed of 29785 m/s). So I’m sure solution A is the correct one. I just can’t find an error of why solution B is wrong if I add the same speed with REBOUND.
Here is part of the script:
CASE A
CASE B
CASE A result (correct)
CASE B result (wrong)![cuk_and_stewart_2012_est_free_1kk_1000_orbit_post_impact](https://github.com/hannorein/rebound/assets/51544149/1827dff1-ade2-4a54-b101-b2fb2937f52b)
I'm I doing something wrong?
Best regards Francesco