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.

  • $\begingroup$ 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. $\endgroup$ – Nasser Nov 14 '14 at 23:31
  • 3
    $\begingroup$ There was a vote on meta and the majority seemed to think SM should be on topic. (meta.mathematica.stackexchange.com/questions/1336/…) $\endgroup$ – Tyler Durden Nov 14 '14 at 23:44
  • $\begingroup$ @TylerDurden OK. I've forgotten that question. You're right. $\endgroup$ – Dr. belisarius Nov 15 '14 at 0:07
  • $\begingroup$ 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). $\endgroup$ – Yves Klett Nov 15 '14 at 8:49
  • $\begingroup$ 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. $\endgroup$ – J. M. is in limbo Aug 29 '15 at 11:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.