Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Please answer only if you are sure. Please write part (a). For part (b), please

ID: 298152 • Letter: P

Question

Please answer only if you are sure.

Please write part (a).

For part (b), please write the 4 K equations.

Thank you!

Here are the Newtonian equations for the orbit of a planet of mass m (not really needed orbiting around the sun of mass M (G is the Gravitational Constant): mn MG The initial conditions are r (0) perihelion y(0) vr(0) vy (0) max orbital velocity (a) Convert this into a system of first order equations as appropriate for Runge Kutta. (b) Solve the orbit for Earth using RK-4 and plot the z and y coordinates for t 0 to t 365.25 days using n 400 samples. Turn in hardcopy of your source code and plots.

Explanation / Answer

a.Range kutta method known as RK method is the modified euler method. In this method the slope of the solution curve is approximated. We calculate the slope by taking weighted average at various number of points in each subinterval.

The RK method having slope v can be written as

K1=h f(xi,yi)

where h=step length

yi=value of y at xi

yi+1= value of y at xi+1

Similarly,

K2=h f(xi+c2h,yi+a21K1)

.....

K3=h f(xi+cvh,yi+av1K1+av2K2+.....+avv-1Kv-1)

and yi+1=yi+(W1K1+W2K2+....+WvKv) for i=0,1,2

b. RK method for v=4

K1=h f(xi,yi)

K2=h f(xi+h/2,yi+k1/2)

K3=h f(xi+h/2,yi+k2/2)

K4=h f(xi+h,yi+k3)

yi+1=yi+(K1+2K2+2K3+K4)/6