4
$\begingroup$

I have reviewed questions on MMMA Stack Exchange and found no help. Here's my problem and my code, which only partially works. I can't figure out my mistake. Help?

Find the mass and COM of a wire in the shape of a helix, $x = t, y = cos t, z = sin t$ where t is between 0 and 2 $pi$ if the density at any point is equal to the square of the distance from the origin.

Here's my code. It accurately calculates mass, but it fails at any of the 3 points for COM. For ease, the y and z COM coordinates are 0 and 0, according to the answer key. I just can't figure out how to code to find them.

Here's my code:

Clear[A, x, y, R, F, G](*Along scalar fields*)

x[t_] := t (*Parametrize the curve*)
y[t_] := Cos[t]
z[t_] := Sin[t]
R[t_] := {x[t], y[t], z[t]}
F[t_] := x[t]^2 + y[t]^2 + 
  z[t]^2 (*this is the parametrized mass density function*)
\
Print["The mass is:"]
Integrate[
 F[t]*Norm[R'[t]], {t, 0, 
  2 Pi}] (*Calculates mass and check region,t,here*)
A = %;

G[t] := F[t]*
  x[t];(*multiplies by x for x coord*)
Print["The x coordinate of the \
center of mass is:"]
Integrate[G[t]*Norm[R'[t]], {t, 0, 2 Pi}]*1/A

Print["The y coordinate of the center of mass is:"]
H[t] := F[t] * y[t]
Integrate[H[t]*Norm[R'[t]], {t, 0, 2 Pi}]*1/A

Print["The z coordinate of the center of mass is:"]
J[t] := F[t] * z[t]
Integrate[J[t]*Norm[R'[t]], {t, 0, 2 Pi}]*1/A
$\endgroup$
0

1 Answer 1

3
$\begingroup$

Your mass density is wrong. I assume that the wire has the same density and radius everywhere. Then the mass / length is a constant, say 1. With this your calculation reads:

x[t_] := t (*Parametrize the curve*)
y[t_] := Cos[t]
z[t_] := Sin[t]
R[t_] := {x[t], y[t], z[t]}
 (*mass density/ length is 1*)
Print["The mass is:"]
Integrate[
 Norm[R'[t]], {t, 0, 2 Pi}] (*Calculates mass and check region,t,here*)


A = %;

G[t] := x[
  t];(*multiplies by x for x coord*)Print["The x coordinate of the \
center of mass is:"]
Integrate[G[t]*Norm[R'[t]], {t, 0, 2 Pi}]*1/A

Print["The y coordinate of the center of mass is:"]
H[t] := y[t]
Integrate[H[t]*Norm[R'[t]], {t, 0, 2 Pi}]*1/A

Print["The z coordinate of the center of mass is:"]
J[t] := z[t]
Integrate[J[t]*Norm[R'[t]], {t, 0, 2 Pi}]*1/A

And the output:

enter image description here

$\endgroup$
3
  • 1
    $\begingroup$ No, I don't think so. The problem states the mass density function as density is proportional to square of distance to origin. Hence, x^2 + y^2 + z^2. $\endgroup$
    – JDVC
    Commented Jan 6, 2021 at 13:40
  • $\begingroup$ What wires do you have in your place? $\endgroup$ Commented Jan 6, 2021 at 13:46
  • 1
    $\begingroup$ Lol. The ones the book problem says I do! $\endgroup$
    – JDVC
    Commented Jan 6, 2021 at 13:50

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.