How to calculate curvature of a vector in Mathematica.

AI Thread Summary
The discussion focuses on calculating the curvature of a vector in Mathematica using the formula k = |r' x r''| / |r'|^3. Users encountered issues with plotting the curvature function and realized they needed to define derivatives as functions of t. After correcting the syntax and ensuring proper variable definitions, one user successfully plotted the curvature but was confused by the results. The conversation also touched on calculating the length of curvature and verifying results, with users sharing their findings and troubleshooting syntax errors. Ultimately, the group collaborated to resolve issues and clarify the correct approach for the curvature calculation.
november1992
Messages
120
Reaction score
0

Homework Statement


r(t)={(4+cos20t) cost,+(4+cos20t) sint,+0.4sin20t}
Calculate the curvature of r[t] for 0≤t≤4pi

Homework Equations



k = | r' x r'' | / | r' |^3

The Attempt at a Solution



r[t_]:={4+Cos[20t]*Cos[t],4+Cos[20t]*Sin[t],0.4Sin[20t]}
k[t_]:=Norm[Cross[r',r'']]/Norm[r']^3
Plot[k[t],{t,0,4Pi}]
I don't get any error messages, but the graph is blank.

http://i.imgur.com/woWlabm.png
http://i.imgur.com/ptUZcVG.png
 
Last edited:
Physics news on Phys.org
t or t_ in the Plot function?
 
If you have defined a function using the "standard" form, id est, f[x_] := you do not want the x_ on the right hand side of the definition.
Now to your real problem:
You forgot to specify that the derivatives are also functions of t :)
Code:
r[t_] := {4 + Cos[20 t]*Cos[t], 4 + Cos[20 t]*Sin[t], 0.4 Sin[20 t]}
k[t_] := Norm[Cross[r'[t], r''[t]]]/Norm[r'[t]]^3
Plot[k[t], {t, 0, Pi/4}]
SHBjJ14.png
 
Haha, I actually managed to plot it, but I thought it was wrong because I wasn't expecting a huge wave.

I was also told to calculate the length of the curvature. Do you think this would be an acceptable answer?

http://i.imgur.com/HHYzFy7.png

Is there a way to simplify this expression?
 
Last edited:
If I am not mistaken
<br /> \kappa = \left | \frac{f&#039;&#039;(x)}{(1 + f&#039;(x)^{2})^{\frac{3}{2}}} \right |<br />

is the formula one would use to calculate the curvature.
Following this we would end up right here:
JTq0NQi.gif


Well, in theory you can apply //Simplify, but Mathematica has done this already, so in my opinion - no :)
 
Okay, thanks. I have one last question. How can I use the inte\frac{}{}rval <0,4pi> in this equation?
I'm just a little confused about why this formula, k = |\frac{r(t)&#039; X r(t)&#039;&#039;}{r(t)&#039;^3}| gives a different answer to the formula you posted
 
Last edited:
Something like this should do the trick:

Code:
Sum[Limit[b, t -> \[Omega]], {\[Omega], 0, 4 Pi}]

where 'b' is

JTq0NQi.gif
Where did you get this formula ?
 
Last edited:
  • #10
Well, I am probably using wrong/incorrect formula.
Sticking to your notebook we get 26.8967 as an answer.
Can you verify that ?
 
  • #11
I'm not getting a number.
http://i.imgur.com/mQ4Pfac.png

I'm guessing I have incorrect syntax.

Edit:

I realized i didn't capitalize the 'p' in Pi. [STRIKE]now I"m getting 13k though[/STRIKE] I got 20.39
 
Last edited:
  • #12
Well, using the simple
Code:
Sum[k[t],{t,0,4Pi}]
I, again, receive 26.8967.
 
  • #14
You should check the initial settings in r, because I see errors there.
For example a missing 't' in the first part :)
Check again the problem and repost what is actually given.
 
  • #15
I can't believe I overlooked that. I also removed the parentheses. Now I'm getting 26.89. Thanks for the help
 
  • #16
You are welcome :)
 
Back
Top