Thorton - Marion Problem 2.18

Problem 2.17

h0 = 0.7 (* m *);
θ0 = 35.0 Degree;
fenceHeight = 2.0 (* m *);
fenceDistance = 60.0 (* m *);
g = 9.8 (* m/s/s *);

Equations of Motion

eqns = {(* horizontal (x) *) D[x[t], {t, 2}] == 0, D[z[t], {t, 2}] == -g}

initialConditions = {x[0] == 0, z[0] == h0, x'[0] == v0 Cos[θ0], z'[0] == v0 Sin[θ0]}

sol = First[DSolve[eqns ~Join~ initialConditions, {x[t], z[t]},t]]

eqH = (x[t] /. sol) == fenceDistance

eqZ = (z[t] /. sol) == fenceHeight

Solve[{eqH, eqZ}, {v0, t}]

Problem 2.18

ballRadius = 0.05 (* m *);
cW = 0.5;
ballMass = 0.2 (* kG *);

ρAir = 1.225 (* kg/m^3 *);

Drag Force

This is a nonlinear force!

dragForce = -{x'[t], z'[t]} 0.5 cW (ρAir π ballRadius^2 Sqrt[x'[t]^2 + z'[t]^2])/ballMass

(We normalized the force by the ball mass.)

dragForce. dragForce // Factor

(* typical drag force in N *)ballMass Sqrt[%] /. z'[t] -> 0 /. x'[t] -> 35.0 (* m/s *)

(* typical drag force moving at 100 m/s *)ballMass Sqrt[%%] /. z'[t] -> 0 /. x'[t] ->100.0 (* m/s *)

Equations of Motion

Clear["θ0", "v0"]

eqns = {(* horizontal (x) *) D[x[t], {t, 2}] == dragForce[[1]], D[z[t], {t, 2}] == -g + dragForce[[2]]}

initialConditions = {x[0] == 0, z[0] == h0, x'[0] == v0 Cos[θ0], z'[0] == v0 Sin[θ0]}

DSolve can not solve this complicated nonlinear set of equations!

sol = First[DSolve[eqns ~Join~ initialConditions /. θ0 -> 35 Degree, {x[t], z[t]},t]]

Instead we use NDSolve…

sol = First[NDSolve[eqns ~Join~ initialConditions /. θ0 -> 35 Degree /. v0 -> 25.0, {x[t], z[t]},{t,0,5.0}]]

ParametricPlot[{x[t] /. sol, z[t] /. sol}, {t, 0, 4}]

fenceTime = FindRoot[(x[t] /. sol) == fenceDistance, {t, 3.0}]
fenceZ = (z[t] /. sol) /. %

Solve by Iteration

getFenceZ[vv_,θθ_] := Module[{sol},
sol = First[NDSolve[eqns ~Join~ initialConditions /. θ0 -> θθ /. v0 -> vv, {x[t], z[t]},{t,0,5.0}]];
(z[t] /. sol) /. FindRoot[(x[t] /. sol) == fenceDistance, {t, 3.0}]]

getFenceZ[25.0,35 Degree]

ListPlot[Table[{v,getFenceZ[v,35 Degree]}, {v, 30.0, 40.0, 0.5}] ];
ListPlot[{{0,fenceHeight},{fenceDistance,fenceHeight}},Joined -> True,PlotStyle -> Green ];
Show[%%,%, Frame -> True, FrameLabel -> {"Initial Speed","h"}]

ListPlot[Table[{θ,getFenceZ[35.0,θ Degree]}, {θ, 34.0, 44.0, 0.5}]];
ListPlot[{{34,fenceHeight},{44,fenceHeight}},Joined -> True,PlotStyle -> Green ];
Show[%%,%, PlotRange -> {0,5}, Frame -> True, AxesOrigin -> {34,0}, FrameLabel -> {"Initial Elevation Angle","h"}]