Motion Along a Straight Line, Part I: Position -> Velocity -> Acceleration

Off[FindRoot::"jsing"];
velocity[fnc_,interval_List,periodic_]:=Module[{f,dfdt,d2fdt2,fvalues,dfdtvalues,d2fdt2values,start,dfdtmaxt22,dfdtmin333t22,fmaxt2222,fmint22,fmin,fmax,roots22,maxes,mines,dfdtmax,dfdtmin333,size,p1,p2,p3,ta,to,tf},tind=interval[[1]];to=interval[[2]];tf=interval[[3]];f[t_]=fnc/.tind->t;dfdt[t_]=(∂_t)f[t];d2fdt2[t_]=(∂_t)dfdt[t];fvalues=Table[f[t],{t,to,tf,((tf-to)/500)}];dfdtvalues=Table[dfdt[t],{t,to,tf,((tf-to)/500)}];d2fdt2values=Table[d2fdt2[t],{t,to,tf,((tf-to)/500)}];start={};dfdtmaxt22=Max[dfdtvalues];dfdtmin333t22=Min[dfdtvalues];dfdt2maxt=Max[dfdt2values22];dfdt2mint33=Min[dfdt2values22];fmaxt2222=Max[fvalues];fmint2222=Min[fvalues];fmin=fmint2222-Max[Abs[{dfdtmin333t22,dfdtmaxt22}]];fmax=fmaxt2222+Max[Abs[{dfdtmin333t22,dfdtmaxt22}]];Do[If[Sign[dfdtvalues[[k]]]≠Sign[dfdtvalues[[k+1]]],start=Append[start,to+(((tf-to) (k-1))/(500.`))]],{k,1,500}];roots22={};
Do[roots22=Append[roots22,FindRoot[dfdt[t]==0,{t,start[[kk]]}][[1,2]]],{kk,1,Length[start]}];maxes={};mines={};If[f[tf]>f[tf-0.00001` (tf-to)],maxes=Append[maxes,{tf,f[tf]+0.02` (fmax-fmin)}],If[f[tf]<f[tf-0.00001` (tf-to)],mines=Append[mines,{tf,f[tf]-0.03` (fmax-fmin)}]]];If[f[to]>f[to+0.00001` (tf-to)],maxes=Append[maxes,{to,f[to]+0.02` (fmax-fmin)}],If[f[to]<f[to+0.00001` (tf-to)],mines=Append[mines,{to,f[to]-0.03` (fmax-fmin)}]]];If[Length[roots22]≠0,Do[If[dfdt[roots22[[k]]-0.0001` (tf-to)]>0&&dfdt[roots22[[k]]+0.0001` (tf-to)]<0,maxes=Append[maxes,{roots22[[k]],f[roots22[[k]]]+0.02` (fmax-fmin)}],If[dfdt[roots22[[k]]-0.0001` (tf-to)]<0&&dfdt[roots22[[k]]+0.0001` (tf-to)]>0,mines=Append[mines,{roots22[[k]],f[roots22[[k]]]-0.03` (fmax-fmin)}]]],{k,1,Length[roots22]}]];dfdtmin333=fmin-(((fmin+fmax)/(2.`))-(1/(2.`))(dfdtmin333t22+dfdtmaxt22));dfdtmax=fmax-(((fmin+fmax)/(2.`))-(1/(2.`))(dfdtmin333t22+dfdtmaxt22));Animate[Clear[p1,p2];size=9;p1=Plot[dfdt[t],{t,to-0.0001` (tf-to),ta},PlotRange->{{to,tf},{dfdtmin333,dfdtmax}},PlotStyle->{RGBColor[1,0,0]},AspectRatio->1,AxesLabel->"velocity",Epilog->{RGBColor[1,0,0],Text["v",{ta,0.5` dfdt[ta]},{-1,0}],Thickness[0.0125`],Arrow[{{ta,0},{ta,dfdt[ta]}}]}];p2=Plot[{f[t],f[ta]+dfdt[ta] (t-ta)},{t,to,tf},PlotStyle->{RGBColor[0,0,0],{RGBColor[0.316411`,0.738293`,0.32813`],Dashing[{0.02`}]}},PlotRange->{{to,tf+1},{fmin,fmax}},AspectRatio->1,AxesLabel->"position",Epilog->{{RGBColor[0,0,1],Text["1",{ta+0.5`,f[ta]},If[dfdt[ta]≥0,{0,1},{0,-1}]],Line[{{ta+1,f[ta]+dfdt[ta]},{ta,f[ta]+dfdt[ta]}}],Line[{{ta,f[ta]},{ta+1,f[ta]},{ta+1,f[ta]+dfdt[ta]},{ta,f[ta]}}],RGBColor[1,0,0],Text["v",{ta,f[ta]+0.5` dfdt[ta]},{1,0}],Thickness[0.0125`],Arrow[{{ta,f[ta]},{ta,f[ta]+dfdt[ta]}}]}}];p3=Plot[0,{t,fmin,fmax},PlotRange->{{fmin,fmax},{fmin,fmax}},Axes->False,Epilog->{Disk[{((fmin+fmax)/(2.`)),f[ta]},0.015` (fmax-fmin)],RGBColor[1,0,0],Text["v",{((fmin+fmax)/(2.`)),f[ta]+0.5` dfdt[ta]},{1,0}],Thickness[0.0075`],Arrow[{{((fmin+fmax)/(2.`)),f[ta]},{((fmin+fmax)/(2.`)),f[ta]+dfdt[ta]}}]}];Show[GraphicsRow[{p3,p2,p1}],ImageSize->{72 size,((72 size)/3)},PlotRegion->{{0,1},{0,1}}],{{ta,to,"time"},to,If[periodic==1,tf-0.04` (tf-to),tf],0.04` (tf-to)}]];
acceleration[fnc_,interval_List,periodic_]:=Module[{f,dfdt,d2fdt2,fvalues,dfdtvalues,d2fdt2values,start,dfdtmaxt22,dfdtmin333t22,fmaxt22,fmint22,fmin,fmax,roots22,maxes,mines,dfdtmax,dfdtmin333,size,p1,p2,p3,ta,to,tf},tind=interval[[1]];to=interval[[2]];tf=interval[[3]];f[t_]=(∂_t)(fnc/.tind->t);dfdt[t_]=(∂_t)f[t];ff[t_]=fnc/.tind->t;fvalues=Table[f[t],{t,to,tf,((tf-to)/500)}];dfdtvalues=Table[dfdt[t],{t,to,tf,((tf-to)/500)}];ffvalues22=Table[ff[t],{t,to,tf,((tf-to)/500)}];start={};dfdtmaxt22=Max[dfdtvalues];dfdtmin333t22=Min[dfdtvalues];dfdt2maxt=Max[dfdt2values22];fmaxt22=Max[fvalues];fmint22=Min[fvalues];fmin=fmint22-Max[Abs[{dfdtmin333t22,dfdtmaxt22}]];fmax=fmaxt22+Max[Abs[{dfdtmin333t22,dfdtmaxt22}]];ffmax22=Max[ffvalues22]+Max[Abs[{dfdtmin333t22,dfdtmaxt22}]];ffmin22=Min[ffvalues22]-Max[Abs[{dfdtmin333t22,dfdtmaxt22}]];Do[If[Sign[dfdtvalues[[k]]]≠Sign[dfdtvalues[[k+1]]],start=Append[start,to+(((tf-to) (k-1))/(500.`))]],{k,1,500}];roots22={};Do[roots22=Append[roots22,FindRoot[dfdt[t]==0,{t,start[[kk]]}][[1,2]]],{kk,1,Length[start]}];maxes={};mines={};If[f[tf]>f[tf-0.00001` (tf-to)],maxes=Append[maxes,{tf,f[tf]+0.02` (fmax-fmin)}],If[f[tf]<f[tf-0.00001` (tf-to)],mines=Append[mines,{tf,f[tf]-0.03` (fmax-fmin)}]]];If[f[to]>f[to+0.00001` (tf-to)],maxes=Append[maxes,{to,f[to]+0.02` (fmax-fmin)}],If[f[to]<f[to+0.00001` (tf-to)],mines=Append[mines,{to,f[to]-0.03` (fmax-fmin)}]]];If[Length[roots22]≠0,Do[If[dfdt[roots22[[k]]-0.0001` (tf-to)]>0&&dfdt[roots22[[k]]+0.0001` (tf-to)]<0,maxes=Append[maxes,{roots22[[k]],f[roots22[[k]]]+0.02` (fmax-fmin)}],If[dfdt[roots22[[k]]-0.0001` (tf-to)]<0&&dfdt[roots22[[k]]+0.0001` (tf-to)]>0,mines=Append[mines,{roots22[[k]],f[roots22[[k]]]-0.03` (fmax-fmin)}]]],{k,1,Length[roots22]}]];dfdtmin333=fmin-(((fmin+fmax)/(2.`))-(1/(2.`))(dfdtmin333t22+dfdtmaxt22));dfdtmax=fmax-(((fmin+fmax)/(2.`))-(1/(2.`))(dfdtmin333t22+dfdtmaxt22));Animate[Clear[p1,p2];size=9;p1=Plot[dfdt[t],{t,to-0.0001` (tf-to),ta},PlotRange->{{to,tf},{dfdtmin333,dfdtmax}},PlotStyle->{RGBColor[1,0,0]},AspectRatio->1,AxesLabel->"acceleration",Epilog->{RGBColor[1,0,0],Text["a",{ta,0.5` dfdt[ta]},{-1,0}],Thickness[0.0125`],Arrow[{{ta,0},{ta,dfdt[ta]}}]}];p2=Plot[{f[t],f[ta]+dfdt[ta] (t-ta)},{t,to,tf},PlotStyle->{RGBColor[0,0,0],{RGBColor[0.316411`,0.738293`,0.32813`],Dashing[{0.02`}]}},PlotRange->{{to,tf+1},{fmin,fmax}},AspectRatio->1,AxesLabel->"velocity",Epilog->{{RGBColor[0,0,1],Text["1",{ta+0.5`,f[ta]},If[dfdt[ta]≥0,{0,1},{0,-1}]],Line[{{ta+1,f[ta]+dfdt[ta]},{ta,f[ta]+dfdt[ta]}}],Line[{{ta,f[ta]},{ta+1,f[ta]},{ta+1,f[ta]+dfdt[ta]},{ta,f[ta]}}],RGBColor[1,0,0],Text["a",{ta,f[ta]+0.5` dfdt[ta]},{1,0}],Thickness[0.0125`],Arrow[{{ta,f[ta]},{ta,f[ta]+dfdt[ta]}}]}}];p3=Plot[0,{t,ffmin22,ffmax22},PlotRange->{{ffmin22,ffmax22},{ffmin22,ffmax22}},Axes->False,Epilog->{Disk[{(1/(2.`))(ffmin22+ffmax22),ff[ta]},0.015` (ffmax22-ffmin22)],RGBColor[1,0,0],Text["a",{(1/(2.`))(ffmin22+ffmax22),ff[ta]+0.5` dfdt[ta]},{1,0}],Thickness[0.0075`],Arrow[{{(1/(2.`))(ffmin22+ffmax22),ff[ta]},{(1/(2.`))(ffmin22+ffmax22),ff[ta]+dfdt[ta]}}]}];Show[GraphicsRow[{p3,p2,p1}],ImageSize->{72 size,((72 size)/3)},PlotRegion->{{0,1},{0,1}}],{ta,to,If[periodic==1,tf-0.04` (tf-to),tf],0.04` (tf-to)}]];
posvelacc[fnc_,interval_List,periodic_]:=Module[{f,dfdt,d2fdt2,fvalues,dfdtvalues,d2fdt2values,start,dfdtmaxt22,dfdtmin333t22,fmaxt22,fmint22,fmin,fmax,roots22,maxes,mines,dfdtmax,dfdtmin333,size,p1,p2,p3,ta,to,tf},tind=interval[[1]];to=interval[[2]];tf=interval[[3]];f[t_]=(∂_t)(fnc/.tind->t);dfdt[t_]=(∂_t)f[t];ff[t_]=fnc/.tind->t;fvalues=Table[f[t],{t,to,tf,((tf-to)/500)}];dfdtvalues=Table[dfdt[t],{t,to,tf,((tf-to)/500)}];ffvalues22=Table[ff[t],{t,to,tf,((tf-to)/500)}];start={};dfdtmaxt22=Max[dfdtvalues];dfdtmin333t22=Min[dfdtvalues];dfdt2maxt=Max[dfdt2values22];fmaxt22=Max[fvalues];fmint22=Min[fvalues];fmin=fmint22-Max[Abs[{dfdtmin333t22,dfdtmaxt22}]];fmax=fmaxt22+Max[Abs[{dfdtmin333t22,dfdtmaxt22}]];ffmax22=Max[ffvalues22]+Max[Abs[{dfdtmin333t22,dfdtmaxt22,fmint22,fmaxt22}]];ffmin22=Min[ffvalues22]-Max[Abs[{dfdtmin333t22,dfdtmaxt22,fmint22,fmaxt22}]];Do[If[Sign[dfdtvalues[[k]]]≠Sign[dfdtvalues[[k+1]]],start=Append[start,to+(((tf-to) (k-1))/(500.`))]],{k,1,500}];roots22={};Do[roots22=Append[roots22,FindRoot[dfdt[t]==0,{t,start[[kk]]}][[1,2]]],{kk,1,Length[start]}];maxes={};mines={};If[f[tf]>f[tf-0.00001` (tf-to)],maxes=Append[maxes,{tf,f[tf]+0.02` (fmax-fmin)}],If[f[tf]<f[tf-0.00001` (tf-to)],mines=Append[mines,{tf,f[tf]-0.03` (fmax-fmin)}]]];If[f[to]>f[to+0.00001` (tf-to)],maxes=Append[maxes,{to,f[to]+0.02` (fmax-fmin)}],If[f[to]<f[to+0.00001` (tf-to)],mines=Append[mines,{to,f[to]-0.03` (fmax-fmin)}]]];If[Length[roots22]≠0,Do[If[dfdt[roots22[[k]]-0.0001` (tf-to)]>0&&dfdt[roots22[[k]]+0.0001` (tf-to)]<0,maxes=Append[maxes,{roots22[[k]],f[roots22[[k]]]+0.02` (fmax-fmin)}],If[dfdt[roots22[[k]]-0.0001` (tf-to)]<0&&dfdt[roots22[[k]]+0.0001` (tf-to)]>0,mines=Append[mines,{roots22[[k]],f[roots22[[k]]]-0.03` (fmax-fmin)}]]],{k,1,Length[roots22]}]];dfdtmin333=fmin-(((fmin+fmax)/(2.`))-(1/(2.`))(dfdtmin333t22+dfdtmaxt22));dfdtmax=fmax-(((fmin+fmax)/(2.`))-(1/(2.`))(dfdtmin333t22+dfdtmaxt22));Animate[Clear[p1,p2];size=4;p1=Plot[dfdt[t],{t,to-0.0001` (tf-to),ta},PlotRange->{{to,tf},{dfdtmin333,dfdtmax}},PlotStyle->{RGBColor[1,0,0]},AspectRatio->1,AxesLabel->"acceleration",Epilog->{RGBColor[1,0,0],Text["a",{ta,0.5` dfdt[ta]},{-1,0}],Thickness[0.0125`],Arrow[{{ta,0},{ta,dfdt[ta]}}]}];p2=Plot[{f[t],f[ta]+dfdt[ta] (t-ta)},{t,to,tf},PlotStyle->{RGBColor[0,0,0],{RGBColor[0.316411`,0.738293`,0.32813`],Dashing[{0.02`}]}},PlotRange->{{to,tf+1},{fmin,fmax}},AspectRatio->1,AxesLabel->"velocity",Epilog->{{RGBColor[0,0,1],Text["1",{ta+0.5`,f[ta]},If[dfdt[ta]≥0,{0,1},{0,-1}]],Line[{{ta+1,f[ta]+dfdt[ta]},{ta,f[ta]+dfdt[ta]}}],Line[{{ta,f[ta]},{ta+1,f[ta]},{ta+1,f[ta]+dfdt[ta]},{ta,f[ta]}}],RGBColor[1,0,0],Text["a",{ta,f[ta]+0.5` dfdt[ta]},{1,0}],Thickness[0.0125`],Arrow[{{ta,f[ta]},{ta,f[ta]+dfdt[ta]}}]}}];p3=Plot[0,{t,-(1/2) (ffmax22-ffmin22),((ffmax22-ffmin22)/2)},PlotRange->{{-(1/2) (ffmax22-ffmin22),(1/2)(ffmax22-ffmin22)},{ffmin22,ffmax22}},Axes->{False,True},AxesOrigin->{0,0},AxesLabel->"position",Epilog->{Disk[{0,ff[ta]},0.01` (ffmax22-ffmin22)],RGBColor[1,0,0],Thickness[0.005`],Text["a",{-0.02` (ffmax22-ffmin22),ff[ta]+0.5` dfdt[ta]},{1,0}],Arrow[{{-0.02` (ffmax22-ffmin22),ff[ta]},{-0.02` (ffmax22-ffmin22),ff[ta]+dfdt[ta]}}],RGBColor[0,0,1],Text["s",{0,ff[ta] 0.5`},{-1,0}],Arrow[{{0,0},{0,ff[ta]}}],RGBColor[0,0.679698`,0.0156252`],Text["v",{0.02` (ffmax22-ffmin22),ff[ta]+0.5` f[ta]},{-1,0}],Arrow[{{0.02` (ffmax22-ffmin22),ff[ta]}},{0.02` (ffmax22-ffmin22),ff[ta]+f[ta]}]}];Show[p3,ImageSize->{72 5,71 5}],{ta,to,If[periodic==1,tf-0.04` (tf-to),tf],0.04` (tf-to)}]];

Introduction

OBJECTIVE: To apply special Mathematica functions to analyze position, velocity, and acceleration simultaneously.

Note: There are no executable commands in this Introduction.

Structural engineers must design high-rise buildings to withstand earthquakes. As a high-rise building moves back and forth during an earthquake, so any single floor also moves back and forth along a straight, horizontal line. For earthquake design, the engineer must be able to describe completely the position, velocity, and acceleration of each of the floors as functions of time, and understand the relationships among these three functions. These descriptions of the motion provide the engineer with some of the information and understanding that is needed for the seismic design of the structure in a high-rise building. (In physics and engineering, the study of motion is called kinematics and falls in the realm of mechanics.) 

This module includes three specially designed Mathematica commands that generate animations to help you visualize the derivative relations among the position, velocity, and acceleration functions. In addition to the seismic vibration of each floor in a building, a variety of other motions are investigated, including constant velocity, constant acceleration, harmonic oscillation, and decaying oscillation. You can also use the specialized Mathematica commands to study other motions that interest you. 

To measure position along a line, we select a fixed point on the line as a reference point or origin, and we scale the line in appropriate units (e.g., meters, feet, or miles). A distance and a direction specify a position on the line. One direction from the reference point is taken as positive and the other direction as negative. Distance is measured using the units of scale along the line.

Before looking at the vibrations of a building shaken by an earthquake, let's consider some other motions. 

Note: This module uses three specially designed functions, 

velocity[s_, timeinterval_, periodic_ ], 

acceleration[s_, timeinterval_, periodic_ ], and 

posvelacc[s_, timeinterval_, periodic_ ]. 

These are not built-in Mathematica functions; and they are only available in this module. The arguments are: s_, a position function; timeinterval_, the time interval during which the motion occurs; and periodic_, a flag to indicate whether or not the motion is periodic. In the sections that follow, you will see examples of how these functions are used.

Technology Guidelines

NOTE:  If you have just finished a module, restart Mathematica or Quit Kernel under the Evaluation pull-down menu before executing a new module.
TO OPEN CELLS, click on the arrow to the left of the cell or put your cursor on the right cell bracket and double click. To open all cells, highlight the bracket on the far right and select Grouping under the Cell pull-down menu and select Open All Subgroups.
TO STOP AN EXECUTION
Select the Evaluation pull-down menu and click on Abort Evaluation.
ORDER OF EXECUTION
Execute cells in the order given. Do not skip any Input cells within a given notebook.
SAVING NOTEBOOKS
You can save anytime to any directory you choose, and it is wise to save often. However, before you do your final save to reduce the size of your file, it is a good idea to delete all your output by selecting the Delete All Output selection under the Cell pull-down menu.
EXPERIENCING MAJOR PROBLEMS
Save if appropriate, then shut down Mathematica and start it up again.

Part I: Constant Velocity

Suppose that you drive your car along a straight road at a constant speed of 60 mph for 4 hours and then turn around and come back at the same speed. Let's take the reference point to be your starting position and the direction your car travels during the first four hours to be positive. The position of your car during the trip is given by the following function of time. When you execute the next command, the function s is defined, but no output is displayed. That's OK.

s=Which[t≤4,60*t, t>4,480-60*t];

\[MathematicaIcon] About Mathematica

Note that in mechanics, the symbol s usually designates position.

Now, we plot the function for the duration of the trip.

Plot[s,{t,0,8},AxesLabel->{"t","s"}]

The velocity is defined to be the time rate of change of position. That is, v = (ds/dt).  Let's find the velocity function and plot it.

v=D[s,t]

Plot[v,{t,0,8},AxesLabel->{"t","v"}]

\[MathematicaIcon] About Mathematica

According to Mathematica, the velocity, which is the derivative of the position function, is 60 mph at t=4. Is that correct? To answer this question, you should look at the two one-sided derivatives of s at t=4.

Like position, velocity has a size or magnitude and a direction. The magnitude or absolute value of an object's velocity is called its speed. If the position function, s(t), is increasing with time, then the velocity is positive, and if it is decreasing, then the velocity is negative. Physical quantities that have a magnitude and a direction are called vectors, and the position and velocity of a moving object are vector quantities.

Recall that the derivative of a function at time t is the slope of the line tangent to the graph of the function at that point. Therefore, the velocity at time t is the slope of the position function at that time. The velocity[ ] command in the next executable cell below illustrates this idea by producing a sequence of graphs that show: 1) the object as it moves along a straight line, 2) the position function, s(t), and 3) the velocity function, v(t). The velocity vector is shown on all three graphs. Note that the value for the last argument is 0 because the motion is not periodic. In all of the animation graphs, the horizontal axis represents time.

While the animation is playing, a control bar appears at the top. This bar allows you to control the speed and direction of the animation.

velocity[s,{t,0,8},0]

A note about modeling: In the preceding model, the velocity is undefined at t=4 hours. In reality, however, your car would have to slow down, turn around, and accelerate back to cruising speed at t=4 hours. This maneuver would occur over a very short interval of time (say a few minutes) when compared to the four-hour duration of the trip. The sharp corner at the turnaround time would in actuality be rounded, and the sudden jump from 60 mph to - 60 mph would have a finite negative slope to it. On the scale of eight hours, however, the graphs would look much like those depicted above, even if the more precise model were used. With these observations in mind, the above model is reasonable for describing your trip.

You Try It: Constant Rate of Change and Extreme Values

Over each 4-hour subinterval of the motion in Part I, the velocity of your car is constant at ± 60 mph. Each subinterval provides an example of a situation where the rate of change or the derivative of a function is constant. Write a brief response to each of the following questions.

1.  On the interval where v=(ds/dt) is positive, what can you say about the value of s? 

2.  What can you say about the value of s on the interval where v=(ds/dt) is negative?

3.  When v=(ds/dt) is constant on an interval, what can you say about the relationship between (ds/dt) (the slope of the tangents in the interval) and ((Δs)/(Δt)) (the slope of any secant line taken inside the interval)?

4.  At t=4 hours, the function s reaches its maximum value of 240 miles. What happens to the derivative, v=(ds/dt), at this point? What are the values of the two one-sided derivatives of s at t=4? What are the values of v=(ds/dt) slightly to the left of t=4 and slightly to the right of t=4?

5.  Over the eight-hour interval, what are the largest and smallest values of s, and at what times to they occur?

6.  What is the value of a=(((d^2)s)/(dt^2)), the acceleration, during each of the 4-hour subintervals? In the mathematical model, what happens to the acceleration at t=4 hours? Describe what the acceleration of your car would actually be like when you turn around to come back.

Part II: Constant Acceleration

Note: This exercise generates a lot of graphics and uses a considerable amount of computer memory. Before proceeding, pull down the Kernel menu, select Delete All Output, and click OK in the resulting dialog box.

If you throw an object straight up from the ground with an initial speed of 128 ft/s, its height above the ground is given by the following function of time.

Clear[s];
s=128 t-16 (t^2);
Plot[s,{t,0,8},AxesLabel->{"t","s"}]

Note that the origin is taken at the ground surface and the positive direction is upward.

Now determine the velocity function and graph it.

Clear[v];
v=D[s,t]

Plot[v,{t,0,8},AxesLabel->{"t","v"}]

Let's use velocity[ ] to depict the motion. Note that the value for the last argument is 0 since the motion is not periodic, but if you change the value to 1, the animation will simulate the bouncing motion of a perfectly elastic ball.

velocity[s,{t,0,8},0]

In this example, the rate of change or the slope of the velocity function (i.e., the acceleration) is constant at a=-g=-32 (ft/(s^2)). 

Acceleration is also a vector quantity. If the acceleration is in the negative direction, the velocity (which can be positive or negative) is decreasing with time. If the acceleration is in the positive direction, the velocity (which can be positive or negative) is increasing with time. If the velocity vector and the acceleration vector are in the same direction, then the moving object is speeding up, and if they are in opposite directions, then the object is slowing down.

The acceleration[ ] command produces a sequence of graphs that show: 1) the object as it moves along a straight line, 2) the velocity function, v(t), and 3) the acceleration function, a(t). The acceleration vector is shown on all three graphs.

acceleration[s,{t,0,8},0]

The posvelacc[ ] command shows the motion of the object, together with its position, velocity, and acceleration vectors.

posvelacc[s,{t,0,8},0]

Note that as the object travels upward, the velocity and acceleration are in opposite directions (the velocity is positive and the acceleration is negative) and the object is slowing down, whereas, on the way down the velocity and acceleration are in the same direction (both negative) and the object is speeding up.

Before we continue, there is one last thing we need to point out pertaining to the physics and mathematics of motion. While the purpose of this module is to illustrate the derivative relations between position and velocity and between velocity and acceleration, real-world applications usually work the other way around. That is, instead of starting with the position function and differentiating it to find the velocity and acceleration, we usually start with the acceleration function and use it to construct the velocity and position functions. The reason for this is that Isaac Newton taught us, among other things, that the best way to study real-world phenomena is to look at the forces that bring about change. In the context of motion problems, this philosophy is embodied in Newton's three laws of motion. The second of Newton's three laws states that if the mass of an object is constant, then the total of all the forces acting on the object is equal to its mass times its acceleration, that is, F=m a. This gives us a way to determine the acceleration function for an object by knowing the forces that act on it. Once we know the acceleration, we use it to construct the velocity function, and then we use the velocity to construct the position function. The problem then is this: if we know the derivative of a function, how do we determine what the function is? This problem is dealt with in the second big topic of calculus: antidifferentiation and integration. You can explore these ideas in a later module "Motion Along a Straight Line: Acceleration -> Velocity -> Position," which treats some of the same motions as this module, but starting with the acceleration function and then finding the velocity and position functions.

You Try It: Linear Rate of Change and Extreme Values

The motion in Part II provides an example of a situation where the derivative of a function, i.e., the velocity, is a linear function. Write a brief response to each of the following questions.

1.  On what interval is v=(ds/dt)positive? On what interval is it negative?

2.  On the interval where v=(ds/dt) is positive, what can you say about the value of s? 

3.  What can you say about the value of s on the interval where v=(ds/dt) is negative?

4.  At t=4 seconds, the function s reaches its maximum value of 256 feet. What happens to the derivative, v=(ds/dt), at this point? What is the value of v=(ds/dt) just to the left of t=4? What is its value just to the right of t=4?

5.  What does the value of v=(ds/dt) do as t increases? How is this related to the value of a=(dv/dt)=(((d^2)s)/(dt^2))and the concavity of the graph of s over the interval of motion?

6.  Over the 8-second interval, what are the largest and smallest values of s, and at what times to they occur?

Part III: Oscillations

Note: This exercise generates a lot of graphics and uses a considerable amount of computer memory. Before proceeding, pull down the Kernel menu, select Delete All Output, and click OK in the resulting dialog box.

If you hang a mass from a spring, it will eventually come to rest in an equilibrium position, where the weight of the mass is balanced by the tension in the spring. Now pull the mass down slightly and let it go. It will oscillate (move up and down) about the equilibrium position. If there were no air resistance and/or friction in the mass and spring, it would oscillate forever with the same amplitude and frequency. Since the motion is periodic, it is not surprising that the periodic trigonometric functions can be used to describe such a motion. For example, if the amplitude of the vibration is 2 centimeters and the period of the oscillations is 4π/3 seconds, then the motion is described by the following function.

Clear[s];
s=-2 Cos[((3 t)/2)];
Plot[s,{t,0,((8 π)/3)},AxesLabel->{"t","s"}]

Now we can calculate the velocity of the mass as it moves up and down and graph it.

Clear[v];
v=D[s,t]

Plot[v,{t,0,((8 π)/3)},AxesLabel->{"t","v"}]

The velocity[ ] command can be used to depict the motion. Since the motion is periodic, we set the last argument of velocity[ ] to 1 instead of 0. This gives a smooth motion in the animations without a hesitation at the wrap-around, end/beginning point of the time interval.

velocity[s,{t,0.0,8.0*Pi/3.0},1]

The acceleration of the mass is given by the derivative of the velocity.

Clear[a];
a=D[v,t]

Plot[a,{t,0,((8 π)/3)},AxesLabel->{"t","a"}]

The acceleration[ ] command illustrates the relationship between the velocity and acceleration as the mass oscillates.

acceleration[s,{t,0.0,8.0*Pi/3},1]

The posvelacc[ ] command shows the motion of the object, its position vector, its velocity, and its acceleration.

posvelacc[s,{t,0.0,8.0*Pi/3.0},1]

There are some observations to make about this motion. The first is that the acceleration is in the direction opposite the position. When the mass is below the equilibrium position, the stretch in the spring increases, thus exerting a net upward force on the mass, accelerating it in that direction. When the mass is above the equilibrium position, the stretch in the spring is reduced, resulting in a net downward force on the mass, accelerating it in that direction. The second observation is that the acceleration is proportional to the position. The first two observations can be demonstrated mathematically by noting that if s(t)=-A cos(ω t), then a(t)=(((d^2)s)/((dt)^2)) = (ω^2)A cos (ω t)=-(ω^2)s(t). 

Another thing to note is that the velocity and acceleration are 90 degrees or (π/2) radians out of phase with one another. During the first quarter-cycle of the motion, the velocity and acceleration are both positive and the mass is speeding up, moving upward. During the second-quarter cycle, the velocity is positive and the acceleration is negative, and the mass is still moving upward but now it is slowing down. During the third quarter-cycle, the velocity and acceleration are both negative, and the mass is speeding up moving downward. During the fourth quarter-cycle, the velocity is negative and the acceleration is positive, and the mass is slowing down as it moves downward. Overlaying the graphs of the velocity and acceleration functions shows these relationships.

Plot[{v,a},{t,0,((4 π)/3)}]

The velocity is v(t) = - Aω sin (ω t) and the acceleration is a(t) = - A(ω^2)cos (ω t). From basic trigonometry, we know that the sine and cosine functions are 90 degrees or (π/2) radians out of phase with one another.

The final observation is that at the instant when the mass passes the equilibrium position, the velocity reaches its extreme values (positive on the way up and negative on the way down), its speed is at its maximum value, and its acceleration is 0.

You Try It: The Second Derivative, Concavity, and Inflection Points

After you have viewed the velocity[ ] and posvelacc[ ] animations, write a brief response to each of the following questions.

1.  During intervals when the tangent line is rotating clockwise, the graph of s is said to be "concave down." Over what intervals is the graph of s concave down? What is the value of v=(ds/dt) doing in these intervals? What is the sign of a=(((d^2)s)/(dt^2)) in these intervals?

2. During the intervals when the tangent line is rotating counterclockwise, the graph of s is said to be "concave up." Over what intervals is the graph of s concave up? What is the value of v=(ds/dt) doing in these intervals? What is the sign of a=(((d^2)s)/(dt^2)) in these intervals?

3.  An inflection point is a point on the graph of s where the concavity changes from up to down, or vice versa. Describe the motion of the green tangent line as it passes over the inflection points on the graph of s. What happens to the value of v=(ds/dt) as the point on the graph passes over the inflection points? What happens to the value of a=(dv/dt)=(((d^2)s)/(dt^2))as the point on the graph passes over the inflection points?

4.  At what points on the graph of s is the slope the steepest? At what points on the graph of s does the value of v=(ds/dt)reach its extreme (maximum and minimum) values?

5.  Describe the motion of an object that moves up and down along a straight line for each of the following conditions: a) v>0 and a>0; b) v>0 and a<0; c) v<0 and a<0; and d) v<0 and a>0. If we take up as positive, specify the direction the object is moving and whether it is speeding up or slowing down.

Part IV: Decaying Oscillations

If you are getting tired of looking at our animations, you can quit here. These next two Parts, IV and V, are just for fun.

(Before proceeding with this section, pull down the Kernel menu at the top of the screen, select Delete All Output, and click OK to free memory for the graphics that will be generated by the commands that follow.)

A more realistic model for oscillations of real objects would account for the loss of energy that results in a decay in the amplitude of the oscillations. In mechanical systems, this energy loss is usually due to friction (objects rubbing against one another in some way). For the motion of the mass hanging from a spring, a more realistic position function has an amplitude that decays exponentially.

Clear[s];
s=-2 Exp[-(t/5)] Cos[t];
Plot[s,{t,0,6 π},PlotRange->All,AxesLabel->{"t","s"}]

Now let's find the velocity and acceleration and graph them.

v=D[s,t]//Simplify

Plot[v,{t,0,6 π},PlotRange->All,AxesLabel->{"t","v"}]

a=D[v,t]//Simplify

Plot[a,{t,0,6 π},PlotRange->All,AxesLabel->{"t","a"}]

It is apparent that the amplitudes of the velocity and acceleration also decay with time.

The motion can be analyzed using the velocity[ ], acceleration[ ], and posvelacc[ ] functions.

velocity[s,{t,0,6*Pi},0]

acceleration[s,{t,0,6*Pi},0]

posvelacc[s,{t,0,6*Pi},0]

Part V: Earthquake

Note: This exercise generates a lot of graphics and uses a considerable amount of memory. Before proceeding, pull down the Kernel menu, select Delete All Output, and click OK in the resulting dialog box.

During an earthquake, the floors of a building act like masses, and the columns between the floors act like elastic springs. Consequently, a single floor can be modeled as a mass that is equal to the mass of the floor and a spring with elastic stiffness equal to that provided by the columns above and below the floor. The motion of the mass in the mass-spring model emulates the actual motion of the floor in a building.

In part, the motion will consist of oscillations along a straight line. Initially, when the earthquake begins, the building is at rest and the ground motion puts energy into the building, resulting in back and forth oscillations of increasing amplitude. If the earthquake lasts long enough, a steady-state condition is reached where the amount of energy that goes into the building equals the amount dissipated by friction as parts of the building rub against one another. During this phase of the earthquake, the building sways with oscillations of constant amplitude. When the earthquake stops, the oscillations decay, and the building eventually comes to rest.

The following function can be used to describe the position of the floor in a building during an earthquake. To see how we obtained this function, see the note at the end of this part.

s=Which[t<30,2 Exp[-(t/5)] Cos[0.9798` t]-2 Cos[t]+0.40825` Exp[-(t/5)] Sin[0.9798` t],t≥30,-698.8` Exp[-(t/5)] Cos[0.9798` t]+478.3` Exp[-(t/5)] Sin[0.9798` t]];
Plot[s,{t,0,70},AxesLabel->{"t","s"}]

The graphs of the velocity and acceleration look like this.

v=(∂_t)s;
Plot[v,{t,0,70},AxesLabel->{"t","v"}]

a=(∂_t)v;
Plot[a,{t,0,70},AxesLabel->{"t","a"}]

The velocity[ ], acceleration[ ], and posvelacc[ ] functions depict the motion.

velocity[s,{t,0,60},0]

acceleration[s,{t,0,60},0]

posvelacc[s,{t,0,60},0]

Part VI: Some Help with Your Homework

The special commands in this section may be helpful with some homework exercises.

Clear[s,v,a];
s=-t^3+3 t^2-3t
v=D[s,t]
a=D[v,t]

velocity[s,{t,0,3},0]

acceleration[s,{t,0,3},0]

posvelacc[s,{t,0,3},0]

\[MathematicaIcon] About Mathematica

The Which[ ] command is useful for creating piecewise defined functions. Go Back.

Mathematica graphs a function by plotting a series of points on the function and then connecting them with straight lines, sometimes when they really should not be connected. The vertical line at t=4 hours really shouldn't be there. The upper segment of the graph at + 60 mph should not be connected to the lower segment at - 60 mph.  Go Back.