1
$\begingroup$

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.

$\endgroup$
2
  • 5
    $\begingroup$ Have you seen ArcLength? $\endgroup$
    – Michael E2
    Commented Nov 29, 2020 at 18:34
  • $\begingroup$ Welcome to Mathematica.SE! I suggest the following: 1) As you receive help, try to give it too, by answering questions in your area of expertise. 2) Take the tour! 3) When you see good questions and answers, vote them up by clicking the gray triangles, because the credibility of the system is based on the reputation gained by users sharing their knowledge. Also, please remember to accept the answer, if any, that solves your problem, by clicking the checkmark sign! $\endgroup$
    – Michael E2
    Commented Nov 30, 2020 at 19:23

2 Answers 2

1
$\begingroup$

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]]
]

trajectory as a parametric plot

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 *)
$\endgroup$
1
$\begingroup$

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

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.