3469 - Assignment 2 Instructions Mike Peardon ( )

advertisement
3469 - Assignment 2
Mike Peardon (mjp@maths.tcd.ie)
Instructions
Complete both parts of the assignment by Monday 23rd November. You should submit
the C++ source files and a short (about 2 page) pdf file containing your solutions and plots
via tcd.blackboard.com. Do not submit executables. Marks will be deducted for late
submissions and any submission more than a week late will not be marked.
1
Shooting method
x(t) obeys the second-order differential equation
d2 x
2
= −x3 te−x /2 .
2
dt
Write software to construct numerical solutions to this equation using the fourth-order RungeKutta scheme. Determine the values of ẋ(t = 0) to 5sf for all solutions which obey the
boundary data x(0) = 0, x(10) = 1. Plot these solutions.
2
Newtonian Gravity
A system has four planets, moving in a two-dimensional plane. Their masses, initial observed
positions and velocities in the plane are given in the Table below, in units where Newton’s
gravitational constant G is unity. They move according to Newton’s inverse-square law of
gravity, which states the force of attraction exerted on planet i by planet j has magnitude
Gmi mj
F =
2
rij
with rij the distance between the planets. The force is directed along the line joining i and j.
Planet
0
1
2
3
mass
2.0
1.0
1.0
0.4
Position
Velocity
x0
x1
v0
v1
-0.50 0.00 -0.94 0.65
-0.60 -0.20 1.86 0.70
0.50 0.10 -0.44 -1.40
0.60 0.30 1.15 -1.50
Evaluate the location of the planets at t = 3 to 3sf using a leap-frog symplectic integrator.
Download