# How to calculate curvature of a vector in Mathematica.

1. Feb 28, 2013

### november1992

1. The problem statement, all variables and given/known data
r(t)={(4+cos20t) cost,+(4+cos20t) sint,+0.4sin20t}
Calculate the curvature of r[t] for 0≤t≤4pi

2. Relevant equations

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

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: Feb 28, 2013
2. Feb 28, 2013

### SteamKing

Staff Emeritus
t or t_ in the Plot function?

3. Feb 28, 2013

### november1992

4. Feb 28, 2013

### MednataMiza

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.
You forgot to specify that the derivatives are also functions of t :)
Code (Text):
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}]

5. Feb 28, 2013

### november1992

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: Feb 28, 2013
6. Feb 28, 2013

### MednataMiza

If I am not mistaken
$$\kappa = \left | \frac{f''(x)}{(1 + f'(x)^{2})^{\frac{3}{2}}} \right |$$

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

Well, in theory you can apply //Simplify, but Mathematica has done this already, so in my opinion - no :)

7. Feb 28, 2013

### november1992

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)' X r(t)''}{r(t)'^3}$| gives a different answer to the formula you posted

Last edited: Feb 28, 2013
8. Feb 28, 2013

### MednataMiza

Something like this should do the trick:

Code (Text):
Sum[Limit[b, t -> \[Omega]], {\[Omega], 0, 4 Pi}]
where 'b' is

Where did you get this formula ?

9. Feb 28, 2013

### november1992

Last edited: Feb 28, 2013
10. Feb 28, 2013

### MednataMiza

Well, I am probably using wrong/incorrect formula.
Can you verify that ?

11. Feb 28, 2013

### november1992

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: Feb 28, 2013
12. Mar 1, 2013

### MednataMiza

Well, using the simple
Code (Text):
Sum[k[t],{t,0,4Pi}]

13. Mar 1, 2013

### november1992

14. Mar 1, 2013

### MednataMiza

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. Mar 1, 2013

### november1992

I can't believe I overlooked that. I also removed the parentheses. Now I'm getting 26.89. Thanks for the help

16. Mar 1, 2013

### MednataMiza

You are welcome :)