The Two-Body Orbits JavaScript Model shows the motion of two objects (e.g., binary star or moon-planet system) interacting via Newton's law of universal gravitation. It is designed to teach physics, Earth science, and environmental science topics by showing the spatial path of objects around their common center of mass (barycenter). Default units are chosen for Earth obit about our Sun so that the distance unit is one astronomical unit and the time unit is one year.
The Two-Body Orbits JS Model was developed using the Easy Java Simulations (EJS) version 5. Although EJS 5 is a Java program, it can create stand alone JavaScript programs that run in almost any PC or tablet browser.
Two-Body Orbits JS Source Code
This source code zip archive contains an XML representation of The Two-Body Orbits JS Model. Unzip this archive in your Ejs workspace to compile and run this model using EJS 5. Although EJS is a Java program, EJS 5 creates a stand alone JavaScript program from this source code. download 54kb .zip
Last Modified: February 1, 2021
previous versions
Metadata instance created September 4, 2013
by Wolfgang Christian
Record Updated:
February 1, 2021
by Wolfgang Christian
Last Update when Cataloged:
September 4, 2013
Error in speed?
Author: Kristen Larson
Posted: January 31, 2021 at 5:28PM
I think that there is a factor of 2 error in the speed. Two 0.5 m_sun stars separated by a = 1 AU in circular orbits should have orbital speeds of pi AU/year, not 2pi AU/year.
W. Christian, Computer Program TWO-BODY ORBITS JS MODEL, Version 1.0 (2013), WWW Document, (https://www.compadre.org/Repository/document/ServeFile.cfm?ID=12996&DocID=3573).
W. Christian, Computer Program TWO-BODY ORBITS JS MODEL, Version 1.0 (2013), <https://www.compadre.org/Repository/document/ServeFile.cfm?ID=12996&DocID=3573>.
Christian, W. (2013). Two-Body Orbits JS Model (Version 1.0) [Computer software]. Retrieved October 10, 2024, from https://www.compadre.org/Repository/document/ServeFile.cfm?ID=12996&DocID=3573
%A Wolfgang Christian %T Two-Body Orbits JS Model %D September 4, 2013 %U https://www.compadre.org/Repository/document/ServeFile.cfm?ID=12996&DocID=3573 %O 1.0 %O text/html
%0 Computer Program %A Christian, Wolfgang %D September 4, 2013 %T Two-Body Orbits JS Model %7 1.0 %8 September 4, 2013 %U https://www.compadre.org/Repository/document/ServeFile.cfm?ID=12996&DocID=3573
Disclaimer: ComPADRE offers citation styles as a guide only. We cannot offer interpretations about citations as this is an automated procedure. Please refer to the style manuals in the Citation Source Information area for clarifications.
added the invisible mass for which the binary system's motion are derived from. added the velocities v1x, v1y and v2x v2y added velocities checkbox added units labels clearly showing units a.u. and year added combo drop-down list for ease of use added numerical values for sense making such as F1, F2, a1, a2, R1 and R2 v1 and v2 made forces a bit longer to see more clearly