my planetary motion vpython code isn't starting

46 views
Skip to first unread message

ifthekarahmed killedar

unread,
Mar 22, 2017, 2:25:45 PM3/22/17
to VPython-users
dear sir/ madam my name is Ifthekar , my  "planetary motion code in vpython" isn't starting . the planets are struck please help me in modifying the code.



s1.py

Bruce Sherwood

unread,
Mar 22, 2017, 3:26:36 PM3/22/17
to VPython-users
Did you run from VIDLE? You should, because when I did, I saw errors in the Python Shell window.

I commented out all but the Earth calculations and made these lines look as follows:
earth.rotate(angle=radians(30),axis=(0,1,0))
earth_GPE=(G*m_sun*m_earth)/distanceearth
I don't understand the choices of parameter values. The mass of the Sun is 2e30 kg,
and Newton's gravitational constant is 6.7e-11. It would be prudent to use actual
values for all the masses, since then you would know that the Earth's period should
be 1 year (=365*24*60*60 s), and then you could choose an appropriate value for
deltat, which should be much larger than 0.01 s. Also, using real values would
make it much easier to choose appropriate initial velocities. In your system of
units the initial speeds are so small that the planets simply fall into the Sun.
Reply all
Reply to author
Forward
0 new messages