# Creating an orrery

I am interested in creating an orrery, ideally with SystemModeler. I have been experimenting with the MultiBody library since that allows you to do animations.

The most relevant example seems to be Modelica.Mechanics.MultiBody.Examples.Elementary.PointGravity, but the problem is that it has a single point of gravity. You can change the gravity from the earth's gravity to something else, but for my orrery I would think each body needs to have gravity/mass. The bodies do have a settable mass, though, so does this mean I can just create one body for each planet, set the mass correctly and it will work?

So, in other words one way to set up the model would seem to be to make the "world" have the gravity of the sun and gravity type of PointGravity, then have the planets as bodies moving around it. However, I don't think this will work right because the "world" object's gravity is constant, but in the solar system the force of gravity is a function of the distance.

Another idea I had was to make the "world" object have type NoGravity, but then how do I constrain the planets? If I add in the sun as a body, and give the planets and the sun appropriate masses and distances and velocities will the simulator compute the instantaneous gravity between them, ie, solve the N-body problem automatically?

Afterthought: is there a way to customize the look of the "bodies"? In the example they are just blue spheres and you can change their color and size but that is it.

• most folks here use Mathematica, and systemModeler is separate program from Mathematica. I suggest asking at community.wolfram.com they have special group for system modeler there. – Nasser Nov 14 '14 at 23:31
• There was a vote on meta and the majority seemed to think SM should be on topic. (meta.mathematica.stackexchange.com/questions/1336/…) – Tyler Durden Nov 14 '14 at 23:44
• @TylerDurden OK. I've forgotten that question. You're right. – Dr. belisarius Nov 15 '14 at 0:07
• Tyler, the question is still quite broad though. Did you already try any of the strategies you mention? Perhaps you need to tackle the problem incrementally (e.g. starting with two bodies). – Yves Klett Nov 15 '14 at 8:49
• It would be somewhat tedious, but otherwise not very difficult to write routines for an orrery. See for instance the animation at the bottom of this answer, tho I only did the terrestrial planets. – J. M. is away Aug 29 '15 at 11:43