I am new to Mathematica and was wondering how one could calculate the distance an particle will cover while moving on a given trajectory over a given time.
Example: trajectory is
$\qquad r(t) = (\sin(t),\,\cos(t),\,t)$
and time is 10 seconds.
Consider the trajectory $r(t) = (\sin(t), 2 \cos(t))$:
ParametricPlot[
{Sin[t], 2 Cos[t]}, {t, 0, 10},
PlotStyle -> Directive[Thickness[0.02], Opacity[0.3, Black]]
]
You can use ArcLength
directly to calculate the length of the parametric path. If you use exact numbers, Mathematica will attempt to find a symbolic answer, which may take quite a while:
ArcLength[{Sin[t], 2 Cos[t]}, {t, 0, 2}]
(* Out: EllipticE[2, -3] *)
If, one the other hand, a numerical answer is sufficient, then that's typically very fast:
ArcLength[{Sin[t], 2 Cos[t]}, {t, 0, 2.}]
(* Out: 3.26107 *)
Use the definition of arc length.
$$ \int_{0}^{10} |r'(t)|\,\mathrm{d}t$$
r[t_] := {Sin[t], Cos[t], t};
Integrate[r'[t] // Norm, {t, 0, 10}]
Integrate[r'[t]^2 // Total // Sqrt, {t, 0, 10}]
NIntegrate[r'[t]^2 // Total // Sqrt, {t, 0, 10}]
10 Sqrt[2]
14.1421
ArcLength
? $\endgroup$