Mathematica session for 05 Jan 12

The goal is to work through various homework problems.  There is nothing to hand in today.
Just read the text, evaluate any unevaluated cells, and create your own cells as called for.

Two dimensional  Integrals

We've use the Integrate function before, e.g. the indefinite integral of a function of one variable, which gives some function

Integrate[1/Sqrt[1+x^2],x]

Or a definite integral with specific limits, which gives a number:

Integrate[1/(1+x^2),{x,0,Infinity}]

Now let's do multiple integrals.  Suppose we want the area of the right triangle with base *a* and height *b*, as plotted here (with a=b=1):

Plot[1-x,{x,0,1},Filling->Bottom]

That the integral of the function 1 over the appropriate range:

Integrate[1,{x,0,a},{y,0,b*(1-x/a)}]

Note the order of integration: the limits on the right are the innermost ones, i.e. that integral gets done first.
Just to see what happens when you get accidentally get things backward, interchange the order:

Integrate[1,{y,0,b*(1-x/a)},{x,0,a}]

What feature of this result makes it obvious that something has gone wrong?

Your job:

Find the are of the same triangle by integrating over dx first, i.e. with limits {y,0,b} and {x, 0, what expression? }

Find the area of semicircle.  Here is the drawing:

semicircle=Plot[Sqrt[1-x^2],{x,-1,1},Filling->Bottom, AspectRatio->1/2,Axes->False]

area = Integrate[1,{x,-1,1},{y,0,Sqrt[1-x^2]}]

Now find the center of mass by replacing the integrand "1" by the vector {x,y}.
Mathematica happily integrates lists of functions, producing a list of results, which is exactly what we want.
Remember to divide by the area to get the CM (since the total mass is proportional to the area):

Rcm = Integrate[{x,y},{x,-1,1},{y,0,Sqrt[1-x^2]}]/area

Here is how to draw a dot at the appropriate location:

CMdot=ListPlot[{Rcm},PlotStyle->{PointSize[.03],Red}]

And then show them together, adding a dot for the origin too.

Odot = ListPlot[{{0,0}},PlotStyle->{PointSize[.02],Black}];

Show[semicircle,CMdot,Odot]

Next suppose we drill  an axle through the usual origin at x=0,y=0.
To get the moment of inertia  we want to integrate dm r^2 where  r^2 = x^2+y^2.

Your job: compute that integral and verify you get the result you expect.

The reason you expect a particular result is of course because if you put two of these together, you get the familiar disk, albeit with double the mass.  And if the number didn’t come out right, did you remember to divide by the area when writing the mass density?!

Next, if we instead choose to pivot the semicircle on a nail drilled through the center of mass, then the r^2 which appears in the moment of inertia integral is the square of the distance  from  our generic point (x,y) to the chosen pivot point, i.e.  r^2=(x-x0)^2+(y-y0)^2.
Here is one way to say that:

Dot[{x,y}-Rcm,{x,y}-Rcm]

Your job: find the moment of inertia about the CM.

BTW what does the parallel axis theorem have to say about the two integrals you’ve just done?

Three dimensional  Integrals

Suppose we want the volume of some object, e.g. some volume generated by rotating a given area.
BTM 3.2.8 ask you to rotate this one:

f[x_] = Piecewise[{{x^2,x≤4}},0]

Plot[f[x],{x,0,5}]

Here is how to rotate the curve:

p1=RevolutionPlot3D[f[x],{x,0,5}]

And here is one way to add the wall

p2=RevolutionPlot3D[{4,s},{s,0,16}]

Which makes the plot a little nicer:

Show[p1,p2]

Your job: find the volume using polar coordinates where you want to integrate 1*dV,  the little volume element being
dV= r dr dθ dz.  The limits in this case are: {r,0,4},  {θ,0,2π} and ... what is it for z?!

And then do it the "hard" way using dV= dx dy dz where the limits are {x,-4,4}, {y,0,Sqrt[16-x^2]} and ... something for z.

Morin 8.26

Consider a highly simplified model of a gymnast on the high bar: a stick of mass m and length L, pivoted at one end, which starts in a handstand, i.e. straight up, on a planet with gravity g.  When the stick rotates over to horzontal, how far has the center of mass moved?  If everything is frictionless and all the potential energy shows up as kinetic energy,  what will the instantaneous angular velocity (ω) be as it passes horizontal?

ω0 = (what # ?)  Sqrt[g/L]

Correspondingly, the center of mass velocity at that point will be:

v0 = (what?) * Sqrt[( g L)]

If our “gymnast” swings down and up and then releases the bar as she passes horizontal, her CM will execute good old projectile motion as she continues to spin.

What does the motion look like? Let's make a movie, using the following choice of numerical parameters:

p = {g->1,L->1}

draw[y_,θ_] := Show[ListPlot[{{0,y}},PlotStyle->{PointSize[.03],Red},PlotRange->{{-1,1},{-1,1}},AspectRatio->1],Graphics[Line[{{0,y}+((L/2)/.p){Cos[θ],Sin[θ]},{0,y}-((L/2)/.p){Cos[θ],Sin[θ]}}]]]

y[t_] = (You fill in this)

θ[t_] = (And this)

Animate[draw[y[t],θ[t]],{t,0,2}]