Mathematica 
and 
Our Rubber Band
Glider Launchers

Copyright Kieran Mullen 1996

In the notebook below, all text in red are questions that you must  answer as part of the homework assignment.

Initializing the kernel:

On the right hand side there are a number of brackets, Click on the one that is beside the expression "2+2".  Then hit the return key while holding down the shift key.  This will start up the Mathematica "kernel" or central processing program.  It may take a few seconds to respond.

2 + 2

Recall the rubber band launchers you used in the airtrack experiment. (We had a question on them at the end of the last assignment).  Let's look at that problem  using Mathematica.

   The idea is that you have two springs mounted on either side of a mass.  Let the springs lie along the y axis, one on either side of  the origin.  The mass sits at the origin.  We displace it to the  right, and the springs try to pull it back.  The force will only be in the horizontal direction.
 
    This exercise will make a lot more sense if you draw a picture of the problem, think about the magnitude of the force, and break it  into its x and y components.  I can't draw you a picture here in this  text.  You must do it for yourself on a scrap of paper.
 
    You know that we need to calculate the change in length of the springs.  Let's assume that at rest, with the mass at the origin, the springs are not stretched at all.  Below is a formula for twice (two springs) the x-component of the force in the  x-direction.

(1) Show that the expression below is just the component of the force in  the x-direction, when the mass is displaced a distance x from the  origin.  (That is, calculate this using paper and pencil.)

Click on it and hit shift-return.  This will define the function for  Mathemtica, so you can use it in the future.

F[x_] := 
      -((2 k ((Sqrt[(x^2) + (y0^2)]) - y0) x
              )/(Sqrt[(x^2) + (y0^2)]))

Ok.  Let's calculate the work done when we move the mass from the origin to the point xf.  Click on the expression below and hit  shift-return.

(∫_0^xf) F[x] \[DifferentialD]x

That wasn't too painful, was it?

   The potential energy is just -W.  We can define that as a function. However, if we want to plot it, we need to specify some length for y0.  Let's just choose "1".  We'll set k=1 also. 
 (This is an important point:  Mathematica can only plot numbers.  It will complain if you ask it to plot an expresssion that has variables in it that are not defined.)  Hit shift-Return on the  below expression to define our potential energy.

U[xf_] := 
      Evaluate[(∫_0^xf)  
          ((2 ((Sqrt[(x^2) + 1]) - 1) x)/(Sqrt[(x^2) + 1])) 
            \[DifferentialD]x]

What's the Evaluate for?  Without it, Mathematica would try to do the integral each and every time we asked for a value of U[x].  The Evaluate[]  forces Mathematica to solve the integral and then assign the answer to the function U.

 Let's plot our potential energy function:

Plot[U[xf], {xf, 0, 3}]

Well... this looks like a spring, sort of.  But is it?  This is the sort of question that Mathematica can help us examine.
  
    Ok, let's see how well this acts like a simple spring.  If we
  divide by ((1/2)) (x^2), then we'll get an effective spring constant for the  problem.   Let's plot this "effective spring constant".

Plot[((2 U[xf])/(xf^2)), {xf, 0.1, 50},  PlotRange -> {0, 3}]

Note that we specified the range of the y-axis for the plot.  All options in Mathematica are separated by commas, and are of the form:

 Option -> {Value1, Value2...}

Well, what do you think?  Does this look like a simple spring?  What is the value of the effective spring constant for large x? Why does it have this value?

We'd like to determine how U[xf] varies with xf, for small xf.  Plot U[xf]/xf^n, for various integral values of n, where xf is between 0 and 1.   Determine the value of n for which the ratio approaches a constant as x -> 0.

However, we our model is not a good description of the rubber band launcher you used in the airtrack.  The rubber band was under tension even before you displaced it.  We can fix that by changing the equilibrium length of the spring so that the force does not have zero magnitude when x=0.  (The x-component of the force is still zero,  though.)

Below is a potential for such a case.  Show on paper that this expression represents a spring whose equilibrium length is less than one.  (In this example it is set to (1/2) .)

U2[xf_] := 
      Evaluate[(∫_0^xf)
            (( 2 ((Sqrt[(x^2) + 1]) - (1/2)) x)/(Sqrt[(x^2) + 1])) 
            \[DifferentialD]x]

Ok.  Let's plot this energy and see if it looks like a parabola for small values of xf.

Plot[U2[xf], {xf, 0, 3}]

Again, it's hard to say if this is parabolic or not.  Let's repeat the  analysis we did above and plot the effective spring constant (2U/x^2) for a range of xf.

Plot[((2 U2[xf])/(xf^2)), {xf, 0, 3}, PlotRange -> {0, 2}]

Replot the above graph several times, changing the upper limit of the  graph (originally set to ``3'').  Change it so that the upper limit is 0.20, 10.0, and 100.0, and replot them.  (That means just changing the number, and typing shift-return.)

So what do you think?  Is it valid to approximate your rubber band launcher by a spring with a spring constant?   When is it valid, and when isn't it?  Play with the equilibrium length and the range of the  plots.  Explain the behaviour of the plot for small xf, for large xf, and for intermediate xf.

So is Mathematica easier than doing the integrals by hand?

Demonstrate what you have learned on the above plots by defining a new potential U3[xf,y0],  so that you can vary both
xf and y0.  Using Plot3D, plot the potential energy surface.  Using what we have learned above, try to use Plot3D to show that when y0 is smalll, the potential is harmonic (proportional to x^2) and when y0 is larger, the potential isn't harmonic.