<< 
      Graphics`Colors`
Off[
        General::"spell1"];
Off[
        General::"spell"];
MakeDataBarsOnly[dataTable_]:=Module[
{n, x = dataTable[[All, 1]], 
              y = dataTable[[All, 2]], maxY, minY, bars, edges, 
              prettyBars, points = dataTable}, 
n = 
              Length[x]; 
If[Max[y] > 0, maxY = Max[y], 
              maxY = 0]; 
If[Min[y] < 0, minY = Min[y], 
              minY = 0]; 
bars = 
              List[]; 
Do[
              bars = Append[bars, 
                  Graphics[{GrayLevel[0.9], 
                      Rectangle[{x[[j - 1]], 0}, {x[[j]], 
                          y[[j - 1]]}]}]], {j, 2, 
                n}]; 
edges = List[]; 
Do[
              edges = Append[edges, 
                  Graphics[{GrayLevel[0.7], 
                      Line[{{x[[j]], 0}, {x[[j]], 
                            y[[j]]}, {x[[j + 1]], 
                            y[[j]]}, {x[[j + 1]], 0}}]}]], {j, 1, 
                n - 1}]; 
prettyBars = 
              Join[bars, edges]; 
dots = 
              ListPlot[points, PlotStyle -> {PointSize[0.02]}, 
                DisplayFunction -> Identity]; 
Return[
              Show[{prettyBars, dots}, Axes -> True, 
                AxesOrigin -> {x[[1]], 0}, 
                DisplayFunction -> $DisplayFunction, 
                PlotRange -> {minY, maxY}]];
];
MakeDataBars[dataTable_, yhat_] := 
          Module[
{n, x = dataTable[[All, 1]], 
              y = dataTable[[All, 2]], bars, edges, prettyBars, 
              points = dataTable}, 
n = 
              Length[x]; 
bars = 
              List[]; 
Do[
              bars = Append[bars, 
                  Graphics[{GrayLevel[0.9], 
                      Rectangle[{x[[j - 1]], 0}, {x[[j]], 
                          y[[j - 1]]}]}]], {j, 2, 
                n}]; 
edges = List[]; 
Do[
              edges = Append[edges, 
                  Graphics[{GrayLevel[0.7], 
                      Line[{{x[[j]], 0}, {x[[j]], 
                            y[[j]]}, {x[[j + 1]], 
                            y[[j]]}, {x[[j + 1]], 0}}]}]], {j, 1, 
                n - 1}]; 
prettyBars = 
              Join[bars, edges]; 
dots = 
              ListPlot[points, PlotStyle -> {AbsolutePointSize[10]}, 
                DisplayFunction -> Identity]; 
curve = 
              Plot[yhat[t], {t, Min[x], Max[x]}, 
                DisplayFunction -> Identity]; 
Return[
              Show[{prettyBars, dots, curve}, Axes -> True, 
                AxesOrigin -> {x[[1]], 0}, 
                DisplayFunction -> $DisplayFunction]];
];
MakeRiemannBars[f_, xPartition_] := 
          Module[
{n, x = xPartition, y, minY, maxY, bars, 
              edges, prettyBars, points = dataTable}, 
y = 
              f[x]; 
If[Max[y] > 0, maxY = Max[y], 
              maxY = 0]; 
If[Min[y] < 0, minY = Min[y], 
              minY = 0]; 
n = 
              Length[x]; 
bars = 
              List[]; 
Do[
              bars = Append[bars, 
                  Graphics[{GrayLevel[0.9], 
                      Rectangle[{x[[j - 1]], 0}, {x[[j]], 
                          y[[j - 1]]}]}]], {j, 2, 
                n}]; 
edges = List[]; 
Do[
              edges = Append[edges, 
                  Graphics[{GrayLevel[0.7], 
                      Line[{{x[[j]], 0}, {x[[j]], 
                            y[[j]]}, {x[[j + 1]], 
                            y[[j]]}, {x[[j + 1]], 0}}]}]], {j, 1, 
                n - 1}]; 
prettyBars = 
              Join[bars, edges]; 
curve = 
              Plot[f[t], {t, Min[x], Max[x]}, 
                DisplayFunction -> Identity]; 
Return[
              Show[{prettyBars, curve}, Axes -> True, 
                AxesOrigin -> {x[[1]], 0}, 
                DisplayFunction -> $DisplayFunction, 
                PlotRange -> {minY, maxY}]];
];

Enter Data

data = {{0, 20.4}, {0.1,  20.3}, {0.2,  19.4}, {0.3,  
            17.3}, {0.4,  14.0}, {0.5,  9.8}, {0.6,  5.3}, {0.7,  
            1.6}, {0.8,  0}};

Plot the data

\(\(p1 = 
        ListPlot[
          data, 
PlotStyle -> {Blue, 
              AbsolutePointSize[4]}, 
ImageSize -> {800, 
              500}, 
AxesLabel -> {"Time (s)", \*""Acc (m/(s^2))""}, 
PlotLabel -> "Acceleration", 
TextStyle -> {FontSize -> 
                18}];\)\)

In first 0.1 seconds, if the acceleration is constant at 20.4, speed increase will be

20.4*0.1

After the next 0.1 seconds at 20.3 speed will be

2.04 + 20.3*0.1

after next 0.1 it will be

4.07 + 19.4*0.1

and so on, the final answer will be:

20.4*0.1 +  20.3*0.1 +  19.4*0.1 + 17.3*0.1 + 14.0*0.1 + 9.8*0.1 +  
      5.3*0.1 +  1.6*0.1

This answer is the same as the sum of the area of the bars pictured below:

MakeDataBarsOnly[data];

This is only an approximation because the athelete does not accelerate at a constant rate for all of the 0.1 seconds. Using the answers to Homework 5 in Module 3 the best fitting model of the form y = (at^4) + (bt^3) + c is:

bestA = 150.5095888097792`;
bestB = -160.27957686128454`;
bestC = 20.421702256476273`;
acc[t_] = bestA*t^4 + bestB*t^3 + bestC;

Show the model against the data:

p2 = 
        Plot[acc[t], {t, 0, 0.8}, PlotStyle -> {Red}, 
          ImageSize -> {800, 500}, 
          DisplayFunction -> Identity];
Show[{p1, p2}];

So if we assume that the athlete maintains a constant acceleration for 0.05 seconds then his speed at 0.8 sec will be:

acc[0.00]*0.05 + acc[0.05]*0.05 + acc[0.10]*0.05 + 
      acc[0.15]*0.05
 + acc[0.20]*0.05 + acc[0.25]*0.05 + 
      acc[0.30]*0.05 + acc[0.35]*0.05
 + acc[0.40]*0.05 + 
      acc[0.45]*0.05 + acc[0.50]*0.05 + acc[0.55]*0.05
 + 
      acc[0.60]*0.05 + acc[0.65]*0.05 + acc[0.70]*0.05 + 
      acc[0.75]*0.05

This can be represented graphically as the sum of areas of the rectangles pictured below:

MakeRiemannBars[acc, Range[0, 0.8, 0.05]];

A better approximation still would be to assume that the acceleration was constant for each 0.01 seconds.

acc[0.00]*0.01+acc[0.01]*0.01+acc[0.02]*0.01+

Using Sum will simiplify this:

Sum[acc[0.01*i]*0.01, {i, 0, 79}]
MakeRiemannBars[acc, Range[0, 0.8, 0.01]];

Better still:

Sum[acc[0.001*i]*0.001, {i, 0, 799}]
MakeRiemannBars[acc, Range[0, 0.8, 0.001]];

Notice that the total area of the bars is very close to the area under the curve

The best we can do with this process would be to let the width of the bars tend to zero, i.e.

Limit[Sum[acc[dt*i]*dt, {i, 0, 0.8/dt - 1}], dt -> 0]

In addition to this being the speed of the sprinter at 0.8 seconds it is also the area under the curve of acc[t] from t = 0 to t = 0.8

Additional velocities that can be calculated

It is possible to use the ideas about to find the athelete's speed at any stages in the first 0.8 of a second

Find the athelete's speed after 0.4 seconds

Let's see a picture first

MakeRiemannBars[acc, Range[0, 0.4, 0.01]];

The corresponding approximation is

Sum[acc[i*0.01]*0.01, {i, 0, 0.4/0.01 - 1}]

The exact answer is

Limit[Sum[acc[i*dt]*dt, {i, 0, 0.4/dt - 1}], dt -> 0]

Athlete's speed is 7.45 m/s after 0.4 seconds

Another example: Find the amount by which the athlete increased their speed from 0.2 to 0.6 seconds

A picture

MakeRiemannBars[acc, Range[0.2, 0.6, 0.01]];

This is a little different because it does not start at 0, but we could calculate the total speed accumulated up to 0.6 and subtract the amount accumulated at 0.2 seconds

speedAt06 = 
      Limit[Sum[acc[i*dt]*dt, {i, 0, 0.6/dt - 1}], dt -> 0]

speedAt02 = 
      Limit[Sum[acc[i*dt]*dt, {i, 0, 0.2/dt - 1}], dt -> 0]

speedAt06 - speedAt02

So the athlete adds an additional 5.37 m/s onto their speed from 0.2 to 0.6 seconds

Alternative Method (Differential Model)

Acceleration is the instanteneous rate of change of speed, i.e., ((dv(t))/dt) = a(t) To solve this to find v(t) we:

DSolve[v'[t] == acc[t], v[t], t]

Define the velocity function:

v[t_] = 
      20.421702256476273` t - 40.069894215321135` (t^4) + 
        30.101917761955836` (t^5) + C[1]

So the increase in speed  is v[0.8]-v[0]

v[0.8] - v[0]

Additional velocities that can be calculated

Speed at 0.4 seconds

v[0.4] - v[0]

Speed gained from 0.2 to 0.6

v[0.6] - v[0.2]

This demonstrates that although the alternative method is hard to set up, once that has been done all subsequent calculations are easier.