You run the pump at medium for one minute, but itβs taking too long so you bump it up to high. After two minutes on high, the raft is nearly inflated but the pump seems like itβs getting a bit hot as it works to counter-act the tendency of the raft to want to deflate, so you switch it to low for one more minute before turning it off.
A rate-versus-time graph, with the vertical axis in metres-cubed-per-minute, and the horizontal axis in minutes. The graph is a piecewise function, with each piece a horizontal line segment. The graph begins at rate \(0\) for negative time, and then
A function can only take on one output value at any given input value, which is why we have an open circle at the endpoint of each line segment in the graph in FigureΒ 5.1.2. For example, if we call that inflation rate function \(r\text{,}\) then \(r(3) = 0.25\) but \(r(2.9999) = 0.75\text{.}\) Of course, this function is just a model of the behaviour of the air pump described in ExampleΒ 5.1.1 β we could have put open circles at the beginnings of the line segments and closed ones at the ends instead, and it wouldnβt affect our analysis of the inflation of the raft.
The graph of a step function is drawn on a set of \(tq\)-axes. The initial step runs along the negative horizontal axis at height \(0\text{,}\) and ends in an open endpoint at the origin. The next four steps are horizontal line segments with a closed endpoint at the left end and an open endpoint at the right end, each beginning at the \(t\)-value where the previous ended:
The first of these steps is at height \(q = 1\) and runs for one unit of \(t\text{.}\)
There is no single constant value or formula that describes the functionβs output values at every possible input value, so we describe the functionβs output values using different output values on different subdomains.
\begin{equation*}
f(t) = \begin{cases}
0 \amp t \lt 0 \\
1 \amp 0 \le t \lt 1 \\
2 \amp 1 \le t \lt 2 \\
3 \amp 2 \le t \lt \pi \\
\sqrt{2} \amp \pi \le t \lt 4.5 \\
0 \amp t \ge 4.5
\end{cases}
\end{equation*}
Suppose we wanted to determine the output value \(f(\sqrt{3})\) without the graph in front of us. We would first scan the subdomains in the right column, and notice that the input \(t = \sqrt{3}\) falls into the subdomain \(1 \le t \lt 2\text{.}\) Matching up this subdomain with its specified output value, we find that \(f(\sqrt{3}) = 2\text{.}\)
A step function whose domain can be split into equal-length intervals so that the βstepsβ in output value only occur at boundaries between these intervals.
The step function in ExampleΒ 5.1.4 is not regular β the steps in output value from \(1\) to \(2\) and from \(2\) to \(3\) both occur after intervals of length \(1\text{,}\) but the next two steps in output value occur after intervals of length greater than \(1\text{.}\) Because the irrational number \(\pi\) is involved in these longer two interval lengths, there is no way to subdivide all these intervals into equal-length intervals so that output-value changes only occur at interval boundaries.
On the other hand, the air pump model in ExampleΒ 5.1.1 is regular because we can split the middle interval in half, and then changes in output-value still only occur at boundaries of these length-\(1\) intervals.
The rate-versus-time graph of FigureΒ 5.1.2 is reproduced, except that the step at rate \(0.75\) of duration \(2\) is split by an extra βendpointβ in the middle, so that it can instead be regarded as two separate steps, each of duration \(1\text{.}\)
When a quantity changes with a rate function that can be modelled by a step function, then the rate function is not constant over its entire domain because it is not always the same rate value for all time. However, a stepped rate function is constant over specific subdomains, so we can still apply the above formula on each of those subdomains and then total up all of those partial accumulations.
For the situation described in ExampleΒ 5.1.1, how much air has been pumped into the raft? To answer this question, we will split the inflation time period up.
You are ordering a quantity of saffron, a very expensive spice, for your bulk food preparation business. The supplier offers a discount scheme based on the amount you order:
The first 500 g ordered is priced at $3.00 per gram.
Any additional amount ordered above500 g is priced at $2.75 per gram, for orders up to 1 kg total. For example, if an order of 600 g is placed, then only the additional 100 g quantity is charged at $2.75 per gram, while the βinitialβ quantity of 500 g is still charged at $3.00 per gram.
A rate-versus-mass graph, with the vertical axis in dollars-per-gram and the horizontal axis in grams. The function graphed is a step function. The initial step runs along the negative horizontal axis, ending in a closed endpoint at the origin. The next two steps each run for a βdurationβ of \(500\) grams, each beginning with an open endpoint at the horizontal location where the previous step ended, and ending with a closed endpoint. The first such step runs at height \(3\) and the second at height \(2.75\text{.}\) The final step begins with an open endpoint at the horizontal location where the previous step left off and runs forever more at height \(2.5\text{.}\)
Consider what the calculations in ExampleΒ 5.2.1 represent on the graph of the inflation rate function. On each subdomain, we used the constant-rate accumulation formula
The rate represents the height of the graph on that particular subdomain, while the duration represents the length of time that this rate was in effect. Geometrically, the product of a height and a length represents the area of a rectangle:
So each partial accumulation calculation in ExampleΒ 5.2.1 corresponds to an area of a rectangle related to the graph of the stepped rate function. Letβs see exactly how.
A rate-versus-time graph, with the vertical axis in metres-cubed-per-minute, and the horizontal axis in minutes. The function graphed is a step function, but with only three levels. The initial level runs along the negative horizontal axis, ending in an open endpoint at the origin. The next step runs at height \(0.5\) for a one-minute duration, beginning with a closed endpoint and ending in an open endpoint. The final step runs from that horizontal location along the positive horizontal axis, beginning with a closed endpoint but with no endpoint. Finally, the rectangle formed by the middle step as top side and the corresponding width along the horizontal axis as bottom side is shaded in.
A rate-versus-time graph, with the vertical axis in metres-cubed-per-minute, and the horizontal axis in minutes. The function graphed is a step function, but with only four levels. The initial level runs along the negative horizontal axis, ending in an open endpoint at the origin. The next two steps each begin with a closed endpoint at the horizontal location where the previous step ended, and end in an open endpoint, with the first such step running at height \(0.5\) for a one-minute duration, and the second running at height \(0.75\) for a two-minute duration. The final step runs along the positive horizontal axis, beginning with a closed endpoint at the horizontal location where the previous step ended, but with no endpoint. Finally, each of the middle two steps forms a rectangle where the step is the top side and the corresponding width along the horizontal axis is the bottom side, and these two rectangles are shaded in, with the second rectangle a different color to highlight it as βnewβ (relative to the shaded rectangular area in FigureΒ 5.2.4).
A rate-versus-time graph, with the vertical axis in metres-cubed-per-minute, and the horizontal axis in minutes. The function graphed is a step function with five levels. The initial level runs along the negative horizontal axis, ending in an open endpoint at the origin. The next three steps each begin with a closed endpoint at the horizontal location where the previous step ended, and end in an open endpoint, where:
The first such step runs at height \(0.5\) for a one-minute duration.
The final step runs along the positive horizontal axis, beginning with a closed endpoint at the horizontal location where the previous step ended, but with no endpoint. Finally, each of the middle three steps forms a rectangle where the step is the top side and the corresponding width along the horizontal axis is the bottom side, and these three rectangles are shaded in, with the third rectangle a different color to highlight it as βnewβ (relative to the shaded rectangular areas in FigureΒ 5.2.5).
For the total accumulation, we added up the results of these three calculations. Graphically, the total accumulation corresponds to the total area of the rectangles formed between the stepped rate functionβs levels and the horizontal axis.
We talk above about accumulation corresponding to area, but the results of each of our accumulation calculations in ExampleΒ 5.2.1 are in units of \(\mathrm{m}^3\text{,}\) not \(\mathrm{m}^2\) β why is that?
by interpreting each rate value as a height and each time duration as a length on the rate graph. Through this correspondence between the two formulas above, the magnitudes of accumulation and graphical area will be the same, but their units of measurement will not coincide.
On a car trip from Camrose to Wetaskiwin, it takes the driver 6 min at the posted Camrose city speed limit of 50 kmβh to get out onto the highway, then 24 min at the posted highway speed limit of 100 kmβh to reach Wetaskiwin, and another 9 min at the posted Wetaskiwin city speed limit of 50 kmβh to reach the final destination.
A rate-versus-time graph, with the vertical axis in kilometres-per-hour, and the horizontal axis in hours. The function graphed is a step function, with five levels. The initial level runs along the negative horizontal axis, ending in an open endpoint at the origin. The next three steps each begin with a closed endpoint at the horizontal location where the previous step ended, and end in an open endpoint, where:
The first such step runs at height \(50\) for a duration of \(0.1\text{.}\)
The final step runs along the positive horizontal axis, beginning with a closed endpoint at the horizontal location where the previous step ended, but with no endpoint. Finally, each of the middle three steps forms a rectangle where the step is the top side and the corresponding width along the horizontal axis is the bottom side, and these three rectangles are shaded in,
Keep in mind that the stepped rate function in ExampleΒ 5.2.9 is a simplified model. In reality, a car cannot change its rate of travel instantaneously, and so our rate graph should have periods of increasing speed (that is, acceleration) and periods of decreasing speed (that is, deceleration). Moreover, it is unlikely the car was travelling at exactly50 kmβh during the city portions of the trip, or at exactly100 kmβh during the highway portion β in reality there would have been dips and rises in the rate graph, as the car went up or down hills, around corners, or was stuck behind or pulled out to pass slower-moving vehicles. However, often a simplified model is good enough, and trying to take into account all of the little variations in velocity during the trip might be too complicated for the simple purpose of estimating the distance travelled.
In fact, we will learn in the next chapter how estimating accumulation using simplified models involving stepped rate functions can actually help us to calculate accumulation exactly for more complicated models.
In ExampleΒ 5.2.2, we analyzed a purchasing scenario with a rate function describing variation in cost per unit mass, (whereas our other examples have all involved variation per unit time). Do you see how the total cost calculation in that example corresponds to a sum of areas of rectangles on the rate function graph?
One minute after inflating your raft (as in ExampleΒ 5.1.1), a previously patched leak begins leaking again at a rate of 0.2 m3βmin, and three minutes pass before you notice, quickly slap a piece of tape over the leak, and turn the air pump back on to medium for two minutes. (Weβll assume in our simplified model that all of this happens instantaneously.)
How much air is in the raft now? We just have to repeat the calculation of ExampleΒ 5.1.1, but take into account the periods of air-loss and re-inflation.
Can we still interpret the calculation in ExampleΒ 5.2.13 as a sum of rectangle areas on the rate graph? While leaking air, the amount of accumulated air in the raft is decreasing, and so we should interpret the rate of air leakage as a negative rate of variance. The static period between the initial inflation and the start of the leakage could also be interpreted as a period with rate 0 m3βmin.
If we allow rectangles to be assigned negative area and also consider a line segment along the horizontal axis as a rectangle with height \(0\text{,}\) then the above calculation is still a sum of rectangle areas.
A rate-versus-time graph, with the vertical axis in metres-cubed-per-minute, and the horizontal axis in minutes. The function graphed is a step function, with eight levels. The initial level runs along the negative horizontal axis, ending in an open endpoint at the origin. The next six steps each begin with a closed endpoint at the horizontal location where the previous step ended, and end in an open endpoint, where:
The first such step runs at height \(0.5\) for a one-minute duration.
The final step runs along the positive horizontal axis, beginning with a closed endpoint at the horizontal location where the previous step ended, but with no endpoint.
Of the six middle steps, each of the four at a positive height forms a rectangle where the step is the top side and the corresponding width along the horizontal axis is the bottom side. Additionally, the step at a negative height forms a rectangle where the step is the bottom side and the corresponding width along the horizontal axis is the top side. All five of these rectangles are shaded in, with the four extending above the horizontal axis shaded blue and the one extending below the horizontal axis shaded red.
If a function is positive on a domain, then the area bounded between the graph of the function and the horizontal axis over that domain is positively-oriented and we assign positive number to that area.
A graph is drawn on a set of \(xy\)-axes. The graph begins in the fourth quadrant and rises to a peak in the first quadrant, crossing the horizontal axis as is does so. The graph then descends to a trough in the fourth quadrant, again crossing the horizontal axis between the peak and the trough. Finally, the graph rises from that trough until it reaches the top edge of the diagram, once more crossing the horizontal axis between the trough and the apparent end of the graph.
The first two of the three points of intersection of the graph with the horizontal axis are plotted, and over the domain between those two points the graph is entirely above the horizontal axis. The region in the first quadrant that is bounded above by the graph and below by the horizontal axis is shaded in blue.
If a function is negative on a domain, then the area bounded between the graph of the function and the horizontal axis over that domain is negatively-oriented and we assign a negative number to that area.
A graph is drawn on a set of \(xy\)-axes. The graph begins in the fourth quadrant and rises to a peak in the first quadrant, crossing the horizontal axis as is does so. The graph then descends to a trough in the fourth quadrant, again crossing the horizontal axis between the peak and the trough. Finally, the graph rises from that trough until it reaches the top edge of the diagram, once more crossing the horizontal axis between the trough and the apparent end of the graph.
The last two of the three points of intersection of the graph with the horizontal axis are plotted, and over the domain between those two points the graph is entirely below the horizontal axis. The region in the fourth quadrant that is bounded below by the graph and above by the horizontal axis is shaded in red.
In the examples in this section, total accumulation was calculated as a sum of products. The situation of calculating a sum where each term in the sum follows a pattern comes up a lot in mathematics, so mathematicians have developed a special notation for it.
The Greek letter \(\Sigma\) stands for βSumβ, the variable \(k\) is called the index variable for the sum, and the βstartβ and βendβ values \(1\) and \(n\) are called the lower bound and upper bound, respectively, for the summation.
The Greek letter \(\Sigma, \sigma\) is called βsigmaβ, where \(\Sigma\) is the uppercase version and \(\sigma\) is the lower case version. This letter corresponds to the letter S in the English alphabet, hence its use to represent a Sum.
While we used the value \(k = 1\) as sort of a βdefaultβ start value in the definition of Sigma notation above, we can use any start value we like, according to the summation pattern we are trying to describe.
Take care when counting an indexed collection: the number of objects is
\begin{equation*}
(\text{ending index value}) - (\text{starting index value}) + 1 \text{.}
\end{equation*}
The β\(+ 1\)β is required because in the subtraction we have βtaken awayβ every object up to and including the one indexed by the βstarting index value,β but we actually want to include that βstartingβ object in the collection being counted. For example, if we have a sum indexed from \(k = 1\) to \(k = n\text{,}\) then we are adding up \(n\) terms, not \(n - 1\) terms.
While there are variations of Sigma notation where the index variable may βstepβ by more than \(1\text{,}\) we can avoid that by expressing each of our even numbers as \(2\) times a number that increases by only \(1\) from term to term:
Only a constant may be factored out of Sigma notation β any expression involving the index variable \(k\) cannot be factored out, because if the sum were written out that variable part would be different from term to term and so would not actually be a common factor.
So this same sum that we expressed in ExampleΒ 5.3.2 using a single Sigma expression can be re-expressed using two Sigma expressions, if we had some particular reason for wanting to do so:
Summation based on a pattern can be performed in Sage. The syntax is below.
sum(pattern, variable, start, end)
For example, the summation
\begin{equation*}
\sum_{k=1}^{5} 2 k + 1
\end{equation*}
becomes Sage input
sum(2*k + 1, k, 1, 5)
However, remember that by default the only letter that Sage treats as a variable is x, so if we want to use k for our index variable as weβve been doing in our Sigma notation, we have to first tell Sage that we want k to be treated as a variable.
Letβs unpack the notation of the definition above for the inflate-deflate-reinflate model from ExampleΒ 5.2.13. The step function in the model βstepsβ output values at the following input values.
The steps from the rate-versus-time graph of FigureΒ 5.2.14 are redrawn, this time without shading any rectangles. The horizontal positions where one step ends and the next begins have been labelled as \(t_0\) through \(t_6\text{,}\) with \(t_0\) at the origin and \(t_6\) at the closed endpoint on the horizontal axis as the beginning of the final step. The span along the horizontal axis between \(t_0\) and \(t_1\) has been labelled as \({\change{t}}_1\text{,}\) the span along the horizontal axis between \(t_1\) and \(t_2\) has been labelled as \({\change{t}}_2\text{,}\) and so on, until the final finite span along the horizontal axis between \(t_5\) and \(t_6\) has been labelled as \({\change{t}}_6\text{.}\) Finally, the heights of the six middle steps have been labelled \(h_1\) through \(h_6\text{.}\)
just as in our previous calculation, and each term in the sum represents an oriented rectangle area, as pictured in FigureΒ 5.2.14 (though one of the rectangles has height \(0\) and canβt be seen in that diagram).
The graph of FigureΒ 5.4.3 has been reproduced with some changes:
Each of the middle steps that were multiple minutes in duration has been split into multiple segments, all of duration one minute, by additional closed endpoints along the step.
The horizontal locations of the segment endpoints (new and old) have been relabelled \(t_0\) through \(t_{10}\text{,}\) so that now they are placed at one-minute intervals, with \(t_0\) at the origin and \(t_{10}\) at the closed endpoint on the horizontal axis as the beginning of the final step.
The heights of the segments have been relabelled with \(h_1\) through \(h_{10}\text{,}\) so that each one-minute segment is assigned a separate label even if it is at the same height as the previous segment.
The graph of FigureΒ 5.4.6 is reproduced, but now with highlighted rectangles:
Each of the first four steps of the graph creates a rectangle with top side along the step and bottom side along the corresponding one-minute domain on horizontal axis. These rectangles have been shaded in blue and labelled \(R_1\) through \(R_4\text{.}\)
Each of the sixth through eighth steps of the graph creates a rectangle with bottom side along the step and top side along the corresponding one-minute domain on horizontal axis. These rectangles have been shaded in red and labelled \(R_6\) through \(R_8\text{.}\)
It may seem that summing ten rectangle areas in ExampleΒ 5.4.5 is more work than summing six rectangle areas in ExampleΒ 5.4.2. But when programming a computer to do such sums, the regularly-spaced ten rectangles is easier to program then the irregularly-spaced six rectangles, and computers donβt care how many rectangle areas you ask them to sum (unless the number of rectangles is very, very large).