Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a program using fourth order runge kutta... This is a classic example of a system for which an adaptive step size method is useful

Write a program using fourth order runge kutta... image text in transcribed
This is a classic example of a system for which an adaptive step size method is useful because for the large periods of time when the comet is moving slowly we can use long time steps, so that the program runs quickly, but short time-steps are crucial in the brief but fast-moving period close to the sun. The differential equation obeyed by a comet is straightforward to derive. The form between the sun, with mass M at the origin, and a cornet of mass m with positions vector r is GMm/r^2 in direction -r/r (i.e., the direction towards the Sun), and here Newton's second law tells us that m d^2r/dt^2 = -(GMm/r^2) r/r, Canceling the m and taking the x component we have d^2x/dt^2 = -GM x/r^3, and similarly for the other two coordinates. We can, however, throw out one of the coordinates because the comet stays in a single plane as it orbits. If we orient our axes so that this plane is perpendicular to the z-axis, we can forget about the z coordinate and we are left with just two second-order equations to solve: d^2x/dt^2 = -GM x/r^3, d^2y/dt^2 = -GM y/r^3 where r = squareroot x^2 + y^2 a) Turn these two second-order equations into four first-order equations, using the methods you have learned b) Write a program to solve your equations using the fourth-order Runge-Kutta method with a fixed step size. You will need to look up the mass of the Sun and Newton's gravitational constant G. As an initial condition, take a comet at coordinates x = 4 billion kilometers and y = 0 (which is somewhere out around the orbit of Neptune) with initial velocity v_x = 0 and v_y = 500ms^-1. Make a graph showing the trajectory of the comet (i.e., a plot of y against x) Choose a fixed step size h that allows you to accurately calculate at least two full orbits of the comet. Since orbits are periodic, a good indicator of an accurate calculation is that successive orbits of the comet lie on top of one another on your plot. If they do not then you need a smaller value of h. Give a short description d) This is a classic example of a system for which an adaptive step size method is useful because for the large periods of time when the comet is moving slowly we can use long time steps, so that the program runs quickly, but short time-steps are crucial in the brief but fast-moving period close to the sun. The differential equation obeyed by a comet is straightforward to derive. The form between the sun, with mass M at the origin, and a cornet of mass m with positions vector r is GMm/r^2 in direction -r/r (i.e., the direction towards the Sun), and here Newton's second law tells us that m d^2r/dt^2 = -(GMm/r^2) r/r, Canceling the m and taking the x component we have d^2x/dt^2 = -GM x/r^3, and similarly for the other two coordinates. We can, however, throw out one of the coordinates because the comet stays in a single plane as it orbits. If we orient our axes so that this plane is perpendicular to the z-axis, we can forget about the z coordinate and we are left with just two second-order equations to solve: d^2x/dt^2 = -GM x/r^3, d^2y/dt^2 = -GM y/r^3 where r = squareroot x^2 + y^2 a) Turn these two second-order equations into four first-order equations, using the methods you have learned b) Write a program to solve your equations using the fourth-order Runge-Kutta method with a fixed step size. You will need to look up the mass of the Sun and Newton's gravitational constant G. As an initial condition, take a comet at coordinates x = 4 billion kilometers and y = 0 (which is somewhere out around the orbit of Neptune) with initial velocity v_x = 0 and v_y = 500ms^-1. Make a graph showing the trajectory of the comet (i.e., a plot of y against x) Choose a fixed step size h that allows you to accurately calculate at least two full orbits of the comet. Since orbits are periodic, a good indicator of an accurate calculation is that successive orbits of the comet lie on top of one another on your plot. If they do not then you need a smaller value of h. Give a short description d)

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_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

Does it avoid typos and grammatical errors?

Answered: 1 week ago

Question

What is electric dipole explain with example

Answered: 1 week ago

Question

What is polarization? Describe it with examples.

Answered: 1 week ago