In this lab you will explore how Mathematica can be used to work with line integrals.
Consider the problem of a thin wire shaped like the spring, , with density given by . 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 . 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}
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 (like the force due to gravity). Work is given by,
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 , 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, is a conservative vector field, so we would expect to get the same values for work1 and work2.
Useing a parameterization for the ellipse, , and the Green's Theorem form for finding area,
find the formula for the area of the ellipse.