Question
19.3 EARTH'S ORBIT MAIN.PY # add necessary imports # constants G = 4*np.pi**2 mass = { 'sun': 1.0, 'earth': 3.0034e-6, 'moon': 3.6923e-7} r0 = {
19.3 EARTH'S ORBIT
MAIN.PY
# add necessary imports
# constants
G = 4*np.pi**2
mass = { 'sun': 1.0, 'earth': 3.0034e-6, 'moon': 3.6923e-7}
r0 = { 'sun': np.array([0,0,0]), 'earth': np.array([9.978977040419635E-01, 6.586825681892025E-02, -6.320430920521123E-06]), 'moon': np.array([9.956768547953816E-01, 6.676030485840675E-02, 1.641093070596718E-04]) } v0 = { 'sun': np.array([0,0,0]), 'earth': np.array([-4.70015711e-01, 6.25165839e+00, -3.40817831e-04]), 'moon': np.array([-0.55065949, 6.03534661, 0.01111456]) }
# functions
if __name__ == "__main__": # create the trajectory for 1 year
# plot
dt2d2rE=mE1FES(r) with the semi-implicit Euler scheme rE(t+1)=rE(t)+vE(t)tvE(t+1)=vE(t)+mE1FES(rE(t+1))t Use your force function from the previous part of the problem! TEST: integrate_earth( ) Write a function integrate_earth(tmax, ddt=1e3) that returns the trajectory of the Earth, assuming that the Earth only feels the attraction from the Sun. - Produce a trajectory for time 0Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started