A Sliding Block

In order to warm up for C and Fortran, let's experiment with using Mathematica in a
way closer to the way that you'll be using those languages.

We will consider the problem of a block sliding down a ramp.
\diagram{Click here}{Block on Ramp}{diagrams/block} for a diagram of a block
on a ramp.

The diagram shows a block sitting on a ramp that is inclined from the
horizontal at an angle theta. Let's ignore any friction between the block and
the ramp for the moment. The block is initially prevented from moving, but at
time t=0 it is released. What does your physical intuition tell you about
what should happen next? What does the angle theta have to do with it?

Click here for an answer.

Here is a function which, when given the angle at which the ramp is inclined,
will return the acceleration of the block.

gravity[theta_] :=  1/2 * 9.8 * Sin[theta]

The acceleration will be down the ramp in meters/second/second. The constant
9.8 meters/second/second that appears in the function is acceleration due to
gravity.

Since the block is not initially moving, the distance that the block will slide
after t seconds is given by the function

distance[t_, theta_]:= -1/2 * gravity[theta] * t^2

(You may recognize this as the familiar ``one-half-a-t-squared'' formula from
introductory physics.)

Notice that the distance moved by the block depends upon both t and theta.
Why is that?

Click here for an answer.

One way to visualize the effect of the steepness of the ramp is to graph the
distance that the block will travel in (say) five seconds as a function of
theta. How could you do that?

Click here for an answer.