2
$\begingroup$

I would like to plot the curve $c(t) = \langle - \sin t, \cos t, t \rangle$ and its Frenet frame at $t = \frac{\pi}{2}$. The following is my code. However, it returns an error saying that Pi/2 is not a valid variable. Any help would be appreciated!

c[t_] := {-Sin[t], Cos[t], t};
cFSF[t_] := Simplify@Last@FrenetSerretSystem[c[t], t];

(*Plot the curve*)
curvePlot = 
  ParametricPlot3D[c[t], {t, 0, 2 Pi}, PlotStyle -> Red, 
   PlotRange -> All, Boxed -> False, AxesLabel -> {"x", "y", "z"}, 
   ImageSize -> 400];

 (*Plot the Frenet-Serret frame at t=Pi/2*)
t0 = Pi/2;  
framePlot = 
  Graphics3D[{Arrow[{c[t0], c[t0] + cFSF[t0][[1]]}], 
    Arrow[{c[t0], c[t0] + cFSF[t0][[2]]}], 
    Arrow[{c[t0], c[t0] + cFSF[t0][[3]]}]}];

(*Show the plots together*)
Show[curvePlot, framePlot, ImageSize -> 400]
$\endgroup$
1
  • $\begingroup$ Welcome to the Mathematica Stack Exchange. There is an interactive example in the Neat Examples section of the FrenetSerretSystem doc page that shows the process. $\endgroup$
    – Syed
    Commented Nov 25, 2023 at 3:02

3 Answers 3

2
$\begingroup$

"FrenetSerretSystem" needs symbolic input. Consider:

cFSF[1]

This evaluates to:

Simplify@Last@FrenetSerretSystem[{-Sin[1], Cos[1], 1}, 1]

"FrenetSerretSystem" then complains that "1" is not a valid variable. Therefore, to fix this, you need to evaluate the command before substituting numerical values. This is simply done by useing "Set" instead of "SetDelayed":

c[t_] := {-Sin[t], Cos[t], t};
cFSF[t_] = Simplify@Last@FrenetSerretSystem[{-Sin[t], Cos[t], t}, t];

(*Plot the curve*)
curvePlot = 
  ParametricPlot3D[c[t], {t, 0, 2 Pi}, PlotStyle -> Red, 
   PlotRange -> All, Boxed -> False, AxesLabel -> {"x", "y", "z"}, 
   ImageSize -> 400];

(*Plot the Frenet-Serret frame at t=Pi/2*)
t0 = Pi/2;
framePlot = 
  Graphics3D[{Arrow[{c[t0], c[t0] + cFSF[t0][[1]]}], 
    Arrow[{c[t0], c[t0] + cFSF[t0][[2]]}], 
    Arrow[{c[t0], c[t0] + cFSF[t0][[3]]}]}];

(*Show the plots together*)
Show[curvePlot, framePlot, ImageSize -> 400]

enter image description here

$\endgroup$
1
  • $\begingroup$ This makes much sense! Thank you! $\endgroup$ Commented Nov 26, 2023 at 3:28
2
$\begingroup$
curve = {-Sin[t], Cos[t], t};

frenet = Simplify @ Last[FrenetSerretSystem[curve, t]];

{tan, nor, bin} = Map[Arrow[{curve, curve + #}] &, frenet];

Show[
 ParametricPlot3D[curve, {t, 0, 2 Pi}, PlotStyle -> {Thick, Black}],
  Graphics3D[{Thick, Red, tan, Green, nor, Blue, bin} /. t :> Pi]]

enter image description here

$\endgroup$
2
$\begingroup$

You need to force evaluation in the SetDelayed definition of cFSF:

cFSF[t_] := Evaluate@Simplify[Last@FrenetSerretSystem[c[t], t]]

Otherwise, you are passing a numeric Pi/2 into the arguments of FrenetSerretSystem every time you call cFSF. It requires the variable t.

FrenetSerretSystem

c[t_] := {-Sin[t], Cos[t], t};
cFSF[t_] := Evaluate@Simplify[Last@FrenetSerretSystem[c[t], t]]

(*Plot the curve*)
curvePlot = 
  ParametricPlot3D[c[t], {t, 0, 2 Pi}, PlotStyle -> Red, 
  PlotRange -> All, Boxed -> False, AxesLabel -> {"x", "y", "z"}];

(*Plot the Frenet-Serret frame at t=Pi/2*)
t0 = Pi/2;
rTube = 0.02
framePlot = 
  Graphics3D[{Red, Arrow[Tube[{c[t0], c[t0] + cFSF[t0][[1]]}, 
 rTube]],
 Green, Arrow[Tube[{c[t0], c[t0] + cFSF[t0][[2]]}, rTube]], Blue, 
 Arrow[Tube[{c[t0], c[t0] + cFSF[t0][[3]]}, rTube]]}];

(*Show the plots together*)
Show[curvePlot, framePlot]

result

$\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.