Central Forces

Name:
Student #:

The potential energy between two point particles with masses (Subscript[m, 1])=1 and (Subscript[m, 2])=2  is U(R)=-1/R, where R is the distance between them.  This results in an attractive force acting along the line connecting the two particles (much like gravity).  At time t=0, the positions of the particles are (Subscript[r, 1])={-10,-1} and (Subscript[r, 2])={10,1}, and  their velocities are (Subscript[v, 1])={2,0} and (Subscript[v, 2])={-2,0}.  I.e. the particles initially are almost on a collision-course.  Writing out F=m a for each particle in component form, use NDSolve to solve the resulting set of differential equations from t=0 to t=10.  Plot the trajectories of both particles on a single graph.  Note that in this problem, all motion is confined to the x-y plane.  Assume MKS units for all quantities.

Remove["Global`*"]

Let us start solving this problem by entering the parameters of the system (fill in the missing values)
m1 = 1;
m2 = ;

x1i = -10;
y1i = ;
x2i = ;
y2i = 1;

v1x = 2;
v1y = 0;
v2x = ;
v2y =;

tf = 10;

Now let's determine the force on particle 1.  First, we write an expression for the potential energy as stated in the problem (pick the appropriate statement).
U[r_]:=-(1/r)
U[r]:=-(1/r)

Now we express the distance R between the two particles in terms of their coordinates (fill in missing expressions).
dx:=x2[t]-x1[t]
dy:=
R2:=dx*dx + dy*dy
R:=(Sqrt[□])

The force in the x direction on a particle is given by the negative of the derivative of the energy with respect to the x coordinate of the particle.  Let's find the x component of the force on particle 1.
Fx = -D[U[R], x1[t]]

Similarly for the y component (fill in the missing expression).
Fy = -D[U[R],    ]

Enter the equations for particle 1.   There should be six in total; 2 force equations (ODE's), 2 initial positions (one for x and one for y), and 2 initial velocities (one for the x component and one for the y component)
eq1x := m1 x1''[t] == Fx
eq1y := m1 y1''[t] == Fy
in1x := x1[0] == x1i
in1y := y1[0] == y1i
in1vx := x1'[0] == v1x
in1vy := y1'[0] == v1y

Enter the equations for particle 2.   There should be six in total; 2 force equations (ODE' s), 2 initial positions (one for x and one for y), and 2 initial velocities (one for the x component and one for the y component).  The force on particle 2 should be equal in magnitude, but opposite in direction to the force in particle 1.
eq2x := m2 x2''[t] == 
eq2y := m2 y2''[t] == 
in2x := x2[0] == x2i
in2y := y2[0] == 
in2vx := x2'[0] == 
in2vy := y2'[0] == v2y

Having neatly obtained all our equations, we now employ NDSolve to solve the system of equations.
sol = NDSolve[{eq1x, eq1y, in1x, in1y, in1vx, in1vy, eq2x, eq2y, in2x, in2y, in2vx, in2vy}, {x1, y1, x2, y2}, {t, 0, tf}][[1]]

Let's store the solutions in functions,
X1[t_] = x1[t] /. sol;
Y1[t_] = y1[t] /. sol;
X2[t_] = x2[t] /. sol;
Y2[t_] = y2[t] /. sol;

and plot the trajectories of the particles, the path of particle 1 in black, that of particle 2 in red.
ParametricPlot[{{X1[t], Y1[t]}, {X2[t], Y2[t]}}, {t, 0, tf}, PlotStyle -> {Black, Red}]

And now for a little animation
Animate[
 Show[
  ListPlot[{{X1[t], Y1[t]}}, PlotStyle -> {Black, PointSize[0.03]}, PlotRange -> {{-11, 11}, {-3, 3}}],
  ListPlot[{{X2[t], Y2[t]}}, PlotStyle -> {Red, PointSize[0.04]}, PlotRange -> {{-11, 11}, {-3, 3}}]
  ], {t, 0, tf}]

Which particle is deflected more?  Why does this make sense?

Answer:

Plot the speed of each particle as a function of time.  Which particle is moving faster at t=10?  (Pick the appropriate command.)
Plot[{X1'[t], X2'[t]}, {t, 0, tf}, PlotStyle -> {Black, Red}]
Plot[{Sqrt[X1'[t]^2 + Y1'[t]^2], Sqrt[X2'[t]^2 + Y2'[t]^2]}, {t, 0, tf}, PlotStyle -> {Black, Red}]

Answer:

LAB FINISHED.  SAVE AND SUBMIT.