Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the Verlet method ( see script, section 5 . 3 . 1 , from page 7 6 - note that the expression F /

Use the Verlet method (see script, section 5.3.1, from page 76- note that the expression F/m in that section is, of course, the acceleration, the second order derivatives as shown below as ODE's) to calculate the orbit of the Earth around the Sun. The equations of motion for the position ((),()) of the planet in its orbital plane are:
2()2=()3,2()2=()3,
where =2+2.
Task: Calculate the orbit of the Earth around the Sun in steps of one hour for a total period of three years. Use the solution for the orbit, (), and the velocity, (), to calculate additionally the potential and kinetic energy of Earth at each evaluation point. Create a function potentialEnergy(r,par) and a function kineticEnergy(v,par) which implement these requested calculations separately from solving the ODE's and can be called from tests. Also create a function solve(par) which returns the value arrays for () and () as a tuple such that the tests can call solve(par) and obtain the results. Note that the potential energy depends only on the Earth location, (), and its kinetic energy only on its velocity, (). The variable par should be a tuple containing the required constant values in order (G,M,m), see Data below.
Data: Use =6.6738\times 1011 m 3 kg 1 s 2 as Newton's gravitational constant, =1.9891\times 1030 kg as mass of the Sun. For Earth mass, use =5.9722\times 1024 kg. The initial conditions should be 0=(1.521\times 1011,0) m and 0=(0,2.9291\times 104) ms 1. Time evaluation points are in the task description and note that you work in SI units.
Create two plots: (a) draw the kinetic energy, potential energy and total energy, superimposed on a single canvas and observe how the kinetic and potential energies change as a function of time while the total energy appears to be constant. Note that working in SI units means you will get large numbers of the order 1033 J.
(b) Plot only the total energy as a function of time and observe the oscillating character while the mean remains constant to high precision which demonstrates the inherent energy conservation of the Verlet method.
Note: you may wish to solve the problem using solve_ivp() but that is not recommended. It is entirely possible and possibly illuminating in comparison(!) to the Verlet method but effectively similar effort for worse results. The tests are likely to fail and deduct marks for this case.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Pro PowerShell For Database Developers

Authors: Bryan P Cafferky

1st Edition

1484205413, 9781484205419

More Books

Students also viewed these Databases questions

Question

=+ Is the information source respected?

Answered: 1 week ago

Question

=+ Is the source or sponsor of the information indicated?

Answered: 1 week ago