Recent content by Bane1998

  1. B

    Seeding a Solar System Simulation

    My simulation merely iterates through the objects in the simulation, applying forces to the momentum, and then acting on the momentum in fixed steps. In a simulation where everything applies gravity to everything else it becomes an O(n2) algorithm to figure out the gravity forces though, which...
  2. B

    Seeding a Solar System Simulation

    The barycenter is only a fixed point if I allow both objects to move. In my simulation I only allow the moon to move, and the Earth remains pinned at the origin, so in that case, the barycenter is moving in a perfect circle from the center of the Earth towards the moon, yes? So for my orbit...
  3. B

    Seeding a Solar System Simulation

    Er, I don't know anything about solvers, I'm a bit of a dunce. :) The code I pasted was just the result of me learning how to calculate a position and velocity for a body in orbit based on a time input function. For context, essentially what I'm doing is simulating the solar system (more...
  4. B

    Seeding a Solar System Simulation

    I see, so the error I'm seeing between my physics simulation and my orbit calculation is that I'm setting the moon in orbit around the center of the earth. My physics sim correctly computes the orbit around the barycenter because that just falls out of the gravity force computations, but the...
  5. B

    Seeding a Solar System Simulation

    Interesting. If I remove the mass of the orbiter from the orbital equations, there's no error. The orbital equations should not include the mass of the orbiter? The mass of the orbiting body doesn't affect the orbit? That doesn't make sense to me since calculating the gravity force in the...
  6. B

    Seeding a Solar System Simulation

    Hey, back again! Do these equations take into account the two body problem? I'm using mass for both the orbiter and the orbited in my physics simulation, however I just don't apply any force to the orbited object to keep it still. But comparing my simulation to these orbit calculations, I...
  7. B

    Seeding a Solar System Simulation

    It's important to give back, so for any other non-math-genius programmers, here is the code, highly commented. I won't bother you to help me any further, but if yer bored/interested in glancing at the comments, maybe you can tell me if my terminology or description of what's going on is...
  8. B

    Seeding a Solar System Simulation

    Thank you for all your help! I actually have it working in 3D now, that's just my flattened view for debugging. I can calculate position, speed, directional vector up to a given accuracy for the sattelite. In the image above the directional vector is the speed scaled by a factor of 100 so I can...
  9. B

    Seeding a Solar System Simulation

    Grr, I wrote a more elaborate post but it timed out my login and threw away my post when it redirected me from the login prompt. That's super-lame. *rages at crappy forum software* So, since I don't want to re-write it all, I'll jump to the point. Am I correct that I cannot start with a...
  10. B

    Seeding a Solar System Simulation

    So my second equation I did not understand: since it seems like the semi major axis is not enough information. For example if I'm in an elliptical orbit around a body at the center of the ellipse, and I'm at a distance equal to the semi major, then the speed should just depend on the...
  11. B

    Seeding a Solar System Simulation

    I've coded a physics simulator that simulates the solar system. Essentially it just calculates gravity between bodies and attracts them together, the most basic simulation. But obviously just feeding in positions for the sun and the planets will just have them all fall into directly each other...
Back
Top