next up previous contents
Next: Divergence and Stokes Theorem Up: Computational Labs in Mathematica Previous: Change of Variables

Line Integrals

Objectives

In this lab you will explore how Mathematica can be used to work with line integrals.

Center of mass

Consider the problem of a thin wire shaped like the spring, tex2html_wrap_inline456 , with density given by tex2html_wrap_inline458 . We can use what we know about mass and moments to find the center of mass of the spring. First, input the parameterization,

      x = 5 Cos[t];
      y = 5 Sin[t];
      z = t;
      r1={x,y,z}
Next, we can get a picture,
      ParametricPlot3D[r1,{t,0,8 Pi},BoxRatios -> {1,1,1},
                       AxesLabel -> {"x","y","z"}]
It looks like a four looped spring. Now we can plug in the parameterization of the curve into the density function and find the ``ds'' for this curve,
      density = x^2+y^2+z
      dr1 = D[r1,t]
      ds = Sqrt[dr1.dr1]
Here, we use the fact that tex2html_wrap_inline462 . Finally we can do some integrals to find the mass and moments,
      mass = NIntegrate[density ds, {t,0,8 Pi}]
      Mxy = NIntegrate[z density ds, {t,0,8 Pi}]
      Mxz = NIntegrate[y density ds, {t,0,8 Pi}]
      Myz = NIntegrate[x density ds, {t,0,8 Pi}]
where we let Mathematica do all the substitution. Now the center of mass is given by,
      centermass = {Myz/mass, Mxz/mass, Mxy/mass}

Work

Useing the same curve as above, lets find the work done if the force is given by,

       F=Simplify[{-x,-y,-z}/(Sqrt[x^2+y^2+z^2]^3)]
which is a radially inward pointing vector field, with the magnitude of the vectors decaying as tex2html_wrap_inline466 (like the force due to gravity). Work is given by,

displaymath464

We can do this in Mathematica as follows,

       Fdotdr1=F.dr1
       work1=NIntegrate[Fdotdr1,{t,0,8 Pi}]
Now let's try a straight line path between (5,0,0) and tex2html_wrap_inline470 , the endpoints of the spring,
       x=5;
       y=0;
       z=t;
       r2={x,y,z}
       F={-x,-y,-z}/(Sqrt[x^2+y^2+z^2]^3);
       dr2 = D[r2,t];
       Fdotdr2=F.dr2;
       work2=NIntegrate[Fdotdr2,{t,0,8 Pi}]
In this case, tex2html_wrap_inline472 is a conservative vector field, so we would expect to get the same values for work1 and work2.

Finally

Useing a parameterization for the ellipse, tex2html_wrap_inline450 , and the Green's Theorem form for finding area,

displaymath474

find the formula for the area of the ellipse.



James Powell
Fri Feb 14 12:47:33 MST 1997