Phys 261 Hwk #9

The agenda is to work through various homework problems.  Your task is (a) to evaluate each cell in order,
(b) do a few Plots and things as asked for below, and (c) to play with it as much as you have time/desire.
There is nothing to hand in, but you may want to print out a few cells for your own reference.

BTM 3.2.2

As a warm-up, why not ask Mathematica to do the integral to find the area of a circle?
That is, breaking it up in to sticks of width dx and length 2 y = 2 Sqrt[R^2-x^2], 
we want to integrate x from -R to R:

Integrate[2 Sqrt[R^2-x^2],{x,-R,R},Assumptions->R>0]

As an example of a double integral, here is the integral for a (hemi-)sphere.
Note the syntax for a double integral; the order of integration matters!

Integrate[Sqrt[R^2-x^2-y^2],{y,-R,R},{x,-Sqrt[R^2-y^2],Sqrt[R^2-y^2]},Assumptions->{R>0}]

Try taking off the Assumptions option.
And try it with the x and y ranges out of order to see what happens when you make a mistake:

Integrate[Sqrt[R^2-x^2-y^2],{x,-Sqrt[R^2-y^2],Sqrt[R^2-y^2]},{y,-R,R},Assumptions->{R>0}]

And how do you ask for the volume of a cone?  Try it the "brute force" way, by writing a triple integral over x y and z.

Try it yourself before double clicking on this cell’s little arrow bracket over there ----->>

So z will vary from 0 to h.  Then given z, y ranges between the limits defined by the appropriate lines, and given y and z, x ranges over the limits given by the appropriate circle:

Integrate[1,{z,0,h},{y,-z R/h,z R/h},{x,-Sqrt[(z R /h)^2-y^2],Sqrt[(z R/h)^2-y^2]},Assumptions->R>0]

Morin 8.42 -- Falling Quickly

To fall quickly, i.e. with maximal angular acceleration, one wants to maximize the ratio of torque to moment of inertia.  Whether talking about the first moment in time or any other t, I claim that you will encounter the function

f[x_] = (1+x)/(1+x^2)

Plot[] this function, and find its maximum, e.g. by Solve[]ing for when f'[x]==0, or by using the FindMaximum function.

Morin 8.18 -- Ball hitting stick

So here is a rather generic collision between a ball and a stick, ignoring any external forces.
A ball of mass M moving at v0 down the x-axis collides with a stick of length L, mass m, and moment
of inertia I0 = β m L^2 about its CM (BTW if the stick has uniform mass density, what is β?).  The collision takes place a distance d from the CM (which is 
at the middle of the stick), and afterward the ball continues one way or the other along the x-axis.

Your task: finish these conservation equations and then Solve:

eqnPx = M v0 == M v1 + m v2

Choosing an origin at the middle of the stick the incoming L is:

eqnLz = M v0 d == M v1 d + (β m L^2) ω

And since we are told this is elastic ...

eqnK = (1/2) M v0^2 == (1/2) M v1^2 + (1/2) m v2^2 + (1/2) (β m L^2) ω^2

soln818 = Solve[{eqnPx,eqnLz,eqnK},{v1,v2,ω}]

Note that there are various special cases you can “check” here.
For example, if m-->0, one expects that the ball keeps its original velocity.
Your task: think of other cases and check the limits.  For example, what if d=0 and m=M?
Or what if the “stick” is a massless rod protruding from one mass m (i.e. what is β, and what happens)?

Limit[{v1,v2,ω}/.soln818[[2]] , m->0]

Limit[{v1,v2,ω}/.soln818[[2]] , β->0]

Limit[{v1,v2,ω}/.soln818[[2]] , m->Infinity]

Challenge: choose an origin at the point of impact and rewrite eqnLz appropriately.
Verify that the system of equations gives the same solution as before.

eqnLzB = 0 == - m v2 d + (β m L^2) ω

Solve[{eqnPx,eqnLzB,eqnK},{v1,v2,ω}]

% == soln818

Morin 8.48

A coin (m,R) is launched at velocity v0 and with spin ω0 across a surface with coefficient of friction μ.
Animate!

Obviously the sliding friction force is μmg, so we decelerate at μg and starting from x=0, the CM motion is:

x1[t_] = v0 t  - (1/2) μ g t^2

Choosing an origin at the height of the CM, there is a torque

τ =-R μ m g

and an angular momentum I0 ω where

I0 = (1/2) m R^2

which says that

θ1[t_] = ω0 t + (1/2)(τ/I0) t^2

This state of affairs continues until the spin rubs off and we roll w/o slipping at time T when

T = t/. Solve[x1'[t]+ θ1'[t] R ==0,t][[1]]

After that we roll w/o slipping:

x2[t_] = x1[T] + x1'[T] (t-T)

θ2[t_] = θ1[T] -(x2'[T]/R)( t-T)

p = {g->1,μ->1/8,v0->1,ω0->3,R->1,m->1}

x2[T]/.p

Putting the pieces together:

xcoin[t_] = Piecewise[{{x1[t],t<=T},{x2[t],t>T}}]

θcoin[t_] = Piecewise[{{θ1[t],t<=T},{θ2[t],t>T}}]

θcoin[1]/.p

Plot[(θcoin[t]/.p),{t,0,20}]

drawcoin[x_,θ_]:= Show[{Graphics[Rectangle[{-1,-1/4},{5,0}]],Graphics[Circle[{x,1},1]],Graphics[Line[{{x,1},({x,1}+{Cos[θ],Sin[θ]})}]]}]

Animate[drawcoin[xcoin[t]/.p,θcoin[t]/.p],{t,0,2T/.p}]

Morin 8.52 -- Cylinder, board and spring

In this one a cylinder of mass m and radius R sits atop a board of mass m.  A spring is attached to the board.
We want the equations of motion, and are asked in particular for "the frequency of the resulting oscillatory motion".

If we call the board coordinate x and the cylinder coordinate y (even though they are both displacements in the x-direction),
the equations of motion are:

eq1 = m x''[t] == - k x[t]- f[t]

Where f[t] is the friction force between the cylinder and the board

eq2 = m y''[t] == f[t]

Choosing e.g. an origin on the board, there is no torque whatsoever, so angular momentum is conserved:

eq3 = 0 == -(1/2) m R^2  θ''[t] - R m y''[t]

And there is a constraint: the distance “rolled” must match up with the relative displacement.
Taking derivatives to make it a relation between accelerations:

eq4 = (y''[t] - x''[t]) == θ''[t]  R

These equations we can Solve algebraically and then read off the frequency of oscillation:

Solve[{eq1,eq2,eq3,eq4},{x''[t],y''[t],θ''[t],f[t]}]

Your task:

Try changing the origin to a point which coincides with the center of the cylinder and rewrite eq3 to reflect the appropriate torque and angular momentum.
Note that with that origin the only torque comes from friction at the ground, and that the "orbital" (center of mass RxP) term in L vanishes automatically.
Verify that the solution to the modified system of equation coincides with the solution we just got.

And for the full experience, let's choose numerical parameters as we DSolve for the motion, and animate.
If you take off the FullSimplify below, you can see Mathematica's more complicated intermediate expressions.
Be prepared to be impressed (or disgusted).

motion=FullSimplify[ DSolve[{eq1,eq2,eq3,eq4,x[0]==x0,y[0]==x0,x'[0]==0,y'[0]==0,θ'[0]==0,θ[0]==0}/.{m->1,k->1,x0->1,R->1},{x[t],y[t],θ[t],f[t]},t][[1]]]

Here is a function which makes a drawing of the rectangle, circle and spring, given the coordinates.

drawstate[x_,y_,θ_]:= Show[{ParametricPlot[{(x+3/2)+t*(4-(x+3/2)),(1/4)Sin[2 Pi 6 t]},{t,0,1},Axes->False,PlotStyle->Red,PlotRange->{{-2,4},{-1,3}}],Graphics[Rectangle[{x-3/2,-1/4},{x+3/2,1/4}]],Graphics[Circle[{y,5/4},1]],Graphics[Line[{{y,5/4},({y,5/4}+{Cos[θ],-Sin[θ]})}]]}]

This funny incantion avoids problems with using the solution rule inside a loop over t.

draw[q_] := drawstate[(x[t]/.motion)/.{t->q},(y[t]/.motion)/.{t->q},(θ[t]/.motion)/.{t->q}]

Animate[draw[t],{t,0,20}]