Hacker News new | ask | show | jobs
by Dylan16807 1882 days ago
> I think what you describe could either be Euler's three-body problem (two fixed point masses and a particle) [0], or the restricted three-body problem (two point masses and a particle) in a rotating/pulsating reference frame.

Even simpler, though, because only one of the masses needs to have a location. The other one is effectively at a fixed direction and distance, far enough away that you can ignore relative motion.

> I'm not sure I understand why being farther away from something would result in less chaotic trajectories? If anything, I'd expect more interesting orbits due to the lack of one dominating influence.

I'll rephrase. The gravitational vector on the craft won't be shifting very fast, so you can get away with a quite big timestep.

1 comments

> Even simpler, though, because only one of the masses needs to have a location. The other one is effectively at a fixed direction and distance, far enough away that you can ignore relative motion.

This still sounds like precisely what I described. Euler's three-body problem is two fixed point masses, so there's no relative motion by construction, and the restricted three-body problem in a rotating/pulsating reference frame has mathematical transformations applied so the two bodies are "effectively fixed" relative to each other in that reference frame (while preserving effects due to rotations, such as centripetal/centrifugal forces).

The question in such a case becomes whether such a thing is substantially better than a regular n-body integrator. Euler's three-body problem may lose some useful n-body effects such as Lagrange points, which partially defeats the purpose of moving away from Keplerian orbits, and the restricted three-body problem arguably isn't simplified enough compared to full-blown n-body integration to be worth it.

> I'll rephrase. The gravitational vector on the craft won't be shifting very fast, so you can get away with a quite big timestep.

Ah, that makes more sense. IIRC Principia has an adaptive timestep, so it already does that, though that's with full n-body calculations. Swapping between the approximation and proper n-body depending on position relative to other bodies seems like a rather complex scheme, though, and I'm not sure whether that'd be the best approach.

> This still sounds like precisely what I described. Euler's three-body problem is two fixed point masses, so there's no relative motion by construction, and the restricted three-body problem in a rotating/pulsating reference frame has mathematical transformations applied so the two bodies are "effectively fixed" relative to each other in that reference frame (while preserving effects due to rotations, such as centripetal/centrifugal forces).

You still have to care about the where the particle is relative to both masses. The whole point of the calculation is figuring out which way the particle goes, and the simplification I'm suggesting removes a lot of that math. Instead of two masses providing a continuously varying force in both direction and magnitude, you have one mass providing a continuously varying force plus a static offset. This removes multiple degrees of freedom from the problem.

> Swapping between the approximation and proper n-body depending on position relative to other bodies seems like a rather complex scheme, though, and I'm not sure whether that'd be the best approach.

I wasn't suggesting swapping between the methods. If you're in the middle of nowhere, then while the Keplerian portion of the model will be a smaller factor, it won't harm anything.

> Instead of two masses providing a continuously varying force in both direction and magnitude, you have one mass providing a continuously varying force plus a static offset.

Ah, so the force vector is constant/infrequently updated, not the position of the second body. My apologies for the misunderstanding.

I'm honestly a bit curious what an that would look like. For example, what would an orbit around the Earth-Moon L1 look like? What would an Earth -> Moon low-energy transfer look like?

I feel like depending on the system you might need to update the "fixed" force vector relatively frequently to get anywhere close to approximating n-body results, which basically sounds like regular integration.

I suppose at some point the question becomes how much fidelity are you willing to sacrifice in the name of decreasing CPU usage.

> I wasn't suggesting swapping between the methods.

My mistake again. Sorry about that.

> If you're in the middle of nowhere, then while the Keplerian portion of the model will be a smaller factor, it won't harm anything.

Wouldn't that arguably be where the most significant errors would be, as that's where the relatively unphysical constant force vector would have the most significant influence?

> Ah, so the force vector is constant/infrequently updated, not the position of the second body. My apologies for the misunderstandin

That's fine, glad we got it cleared up.

> I'm honestly a bit curious what an that would look like. For example, what would an orbit around the Earth-Moon L1 look like? What would an Earth -> Moon low-energy transfer look like?

> I feel like depending on the system you might need to update the "fixed" force vector relatively frequently to get anywhere close to approximating n-body results, which basically sounds like regular integration.

For a basic example-numbers implementation, replacing an n-body simulation that updates every 10 seconds, I was imagining that you might update the force vector 1/100th as often, every 1000 seconds. That's plenty fast to accurately handle a multi-day orbit around a lagrange point or a low energy transfer. The paths the craft take should look completely normal.

If you then combine a normal single-influence orbit with that force vector, you could summarize 1000 seconds of orbit into one moderately complex equation. So instead of doing a moderately complex calculation every 10 seconds, you'd do two of them every 1000 seconds, an estimated 50x CPU savings.

If you're not very close to anything, there's no benefit over just running an n-body calculation every 1000 seconds. But the hard-to-handle case is orbits that are low enough to need rapid updates, but high enough that it's noticeably wrong to use an ellipse. And it's easy to end up with a lot of things in those orbits.

> Wouldn't that arguably be where the most significant errors would be, as that's where the relatively unphysical constant force vector would have the most significant influence?

Treating the forces as constant over a stretch of time, when they actually are almost constant, shouldn't have all that much error, unless I'm missing something glaring.

As you get further and further away from the most influential mass, this system gets closer and closer to simply being an n-body simulation with a timestep of how often you update the force vector.

> For a basic example-numbers implementation, replacing an n-body simulation that updates every 10 seconds, I was imagining that you might update the force vector 1/100th as often, every 1000 seconds. That's plenty fast to accurately handle a multi-day orbit around a lagrange point or a low energy transfer. The paths the craft take should look completely normal.

I'm honestly curious about what Principia's largest step size is when calculating predictions. Best I can tell, the step size starts large and shrinks until the tolerance-to-error ratio is small enough [0]. I can't seem to figure out how large the initial step is, though.

But in any case, I suppose it'd come down (again) to how important accuracy is.

I'm now extremely tempted to fire up KSP with Principia to see what happens if I were to mess with the timesteps. Don't think I'm familiar enough with the codebase to mess around with it properly, though.

> If you then combine a normal single-influence orbit with that force vector, you could summarize 1000 seconds of orbit into one moderately complex equation.

A lot hinges on the combination being as simple as the sentence makes it look. I'm not entirely convinced that the analysis is straightforwards (fewer forces, but you might lose some useful properties) but I'll be the first to admit that I'm not exactly an expert on this subject.

I really wish I had more time and knowledge; this sounds like a good candidate for some test code. I have absolutely no faith I'd be able to pull off something proper, though; good n-body integrators are well out of my skill range, and I don't know how I'd even begin approaching your proposed scheme outside naive integration (which wouldn't exactly be a fair comparison to high-quality n-body integrators).

Did you have a particular method of combination in mind?

> Treating the forces as constant over a stretch of time, when they actually are almost constant, shouldn't have all that much error, unless I'm missing something glaring.

Well, maybe; I'm honestly not confident enough in the possible models I had in mind to stand behind what I said (I was thinking in terms of the relative magnitude of the "correction" of the second force, but looking back I'm not entirely sure how relevant that is). I really shouldn't have been so confident in that particular line of questioning. Sorry about that.

[0]: https://github.com/mockingbirdnest/Principia/blob/f84c96953a...

I don't know what a good force integration looks like in the first place, so I can't really help design the needed calculation, sorry. But I imagine you'd use similar techniques in many ways to get good accuracy.