Register to reply

Predicting Next Recalculation

by Alkatran
Tags: predicting, recalculation
Share this thread:
Alkatran
#1
Jan31-07, 09:23 AM
Sci Advisor
HW Helper
Alkatran's Avatar
P: 944
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)
Phys.Org News Partner Science news on Phys.org
Bees able to spot which flowers offer best rewards before landing
Classic Lewis Carroll character inspires new ecological model
When cooperation counts: Researchers find sperm benefit from grouping together in mice
jim mcnamara
#2
Feb2-07, 03:09 PM
Sci Advisor
PF Gold
P: 1,381
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.
Alkatran
#3
Feb2-07, 11:29 PM
Sci Advisor
HW Helper
Alkatran's Avatar
P: 944
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.


Register to reply

Related Discussions
Chance of predicting the out come of a race like the Grand National? General Discussion 6
Predicting polarity Introductory Physics Homework 2
Predicting Eclipses Astronomy & Astrophysics 17
Predicting Equilibrium? Introductory Physics Homework 2
Predicting Phenominon? General Discussion 18