Creating planetary orbits with MAX expressions


#1

So I’ve been doing some meddling around with old-school MAX expressions in hopes that I can recreate planetary simulations with a reasonable degree of accuracy. “What’s the big deal?” you ask… “Just create a sphere with a path constraint and attach it to an ellipse shape.” Well this method fails to take into account the gravitational effect where orbiting bodies speed up slightly when they approach their perihelion (closest point) and slow down at the aphelion (furthest)

example:
http://www.youtube.com/watch?NR=1&feature=endscreen&v=RtIm4N-P_ys

Anyway, I’ve been working on this problem for some time and can’t seem to crack the math needed for it. This is what I have so far:

…which produces this:

The blue ball has the expressions attached to it. The small white ball (inside) is a simple path constraint. Basically what I want to do here is make the blue ball speed up as it approaches the yellow ball (the “sun” I suppose) and make it slow down a little during the period when it’s furthest away. I attempted to use the yellow sphere’s distance as a function using a ExposeTransform node object, but it doesn’t allow me me to do it because of dependency loop issues. Are there any physics buffs here who can help me figure this out? I am not a scripter or a mathematician, but I know just enough to get by. Please help!!! I feel like Kepler trying to figure out calculus using a ruler and thumb-tack…This thing is driving me mad…


Creating planetary orbits with MAX expressions (Revisited)
#2

Hi,
Create elliptical spline shape around sun, add path constraint to planet to wire it to this shape and assign float expression controller to Percent property. Use this expression:

(F/turn)+(multipliersin(F(360/turn)))

where “turn” = frames for one turn around sun and “multiplier” = multiplier for acc/brake addon (use 0.1 for start)


#3

HOLY flippin’ Moses on a stick… that worked absolutely brilliantly!! Thank you! I never thought to multiply the sine directly. So awesome!! Now I suppose I can simply wire the multiplier value to the sun’s distance away from the center of the ellipse and divide it a bit to make it more proportional. Here’s what I actually used:

(F/100)+((.12)-sin(F(360/100)))

Just had to minus the sine.Works like a charm. Seriously I’ve been toiling with this damned things for days…you made my night. Thank you sir!


#4

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.