How Can We Optimize Prediction Algorithms in a Dynamic Solar-System Simulator?

  • Thread starter Thread starter Alkatran
  • Start date Start date
Click For Summary
SUMMARY

The discussion focuses on optimizing prediction algorithms within a solar-system simulator, specifically addressing the recalculation of moon orbits. The author transitioned from a fixed time step to a priority queue system that recalculates planetary positions at varying rates based on their interactions. The current prediction formula utilizes the inverse of acceleration to determine recalculation frequency, but the author seeks a more effective function to enhance accuracy, particularly for bodies like Mercury and Earth's moon. Suggestions include considering the inverse of instantaneous angular acceleration and dynamically updating the priority queue based on relative velocities.

PREREQUISITES
  • Understanding of celestial mechanics and orbital dynamics
  • Familiarity with priority queue data structures
  • Knowledge of JavaScript for implementing the simulation
  • Basic principles of numerical methods for physics simulations
NEXT STEPS
  • Research advanced techniques for optimizing numerical integration in physics simulations
  • Explore the use of adaptive time-stepping algorithms in dynamic simulations
  • Learn about the implementation of priority queues in JavaScript
  • Investigate the effects of angular acceleration on orbital prediction accuracy
USEFUL FOR

Developers and researchers working on physics simulations, particularly those interested in celestial mechanics and optimization techniques for dynamic systems.

Alkatran
Science Advisor
Homework Helper
Messages
959
Reaction score
0
I've recently been working on optimizing a solar-system simulator I wrote a year ago to allow me to add more moons. The issue I have (not surprisingly) is the orbit of moon's require a much lower time step to calculate.

Trying to avoid this, I've change the simulation to no longer used a fixed time step. Instead of (wait x seconds, recalculating all positions, repeat) it now has a priority queue containing all pairs of planet and it recalculates each pair at different rates (the next calculation time is specified during the recalculation of position).

I've managed to get it working, and it does work well. Moons mostly get more attention than the planets, and far off things like Pluto get almost no attention at all. However, I want to optimize the prediction of the next calculation time (some bodies are still getting the wrong amount of attention, mercury gets more than Earth's moon for example).

The current formula is simply the inverse of acceleration for the smaller planet, meaning planets being accelerated are more likely to be recalculated:
nextTime += Math.min(b1.mass, b2.mass)/force; //(all units in SI)

So I guess it all comes down to: what's a good function for predicting how often the forces need to be recalculated? (Currently assuming constant force between calculations and doing a simple x + vt + at^2/2)
 
Technology news on Phys.org
Would it be worth considering the inverse of instantaneous angular acceleration as an optimization approach? It's a lot like your model but it is sensitive to changes in r over time. Yours doesn't appear to be...

[tex]\alpha = lim_{\Delta t\rightarrow 0} \frac{\Delta\omega}{\Delta t}[/tex]

Dynamcially repopulate your priority queue with those values for each object.
 
I modified the priority to include absolute relative velocity (based on the simple idea that "hmmm, the units don't match"). The distribution is MUCH nicer now.
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 18 ·
Replies
18
Views
6K
Replies
18
Views
3K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 21 ·
Replies
21
Views
6K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 15 ·
Replies
15
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K