Game Development Reference
In-Depth Information
Although the details of how to quantify energy are not core to our discus-
sion, there is one very important observation to make: Equation (11.24)
is dimensionally consistent. On the left, the quantity measured is energy,
which in the SI system is measured in joules. But on the right, the con-
sumption rate is measured in watts. How can this be? Remember that the
integral represents a summation, and the infinitesimal items being summed
are the product of the integrand (in this case, P(t)) and a infinitesimal bit of
the domain of integration (in this case, dt). In terms of a Riemann integral,
the former determines the height of each slice, and the latter determines its
width. Here, dt represents an infinitesimally small step in time, measured
in seconds, so the units on the right are W × s = (J/s) × s = J. Thus, the
left- and right-hand sides of Equation (11.24) are measured in joules.
We can extend this example by calculating the electricity bill, rather
than just the total usage. Of course, if the price for energy is fixed, then we
simply multiply the consumption by the price. But what if the price varied
on a moment-by-moment basis? (This shouldn't be too hard to imagine
nowadays.) In this case, we would be integrating the cost rather than
the energy. We determine how to calculate the cost of a single interval
of duration dt (a “differential” slice of time) and then sum over all the
intervals:
End time
Total
cost
Calculating electricity
cost
=
RateOfExpendature(t) dt
Start time
End time
=
ConsumptionRate(t) Price(t) dt.
Start time
Moving on to another example of the integral, imagine a man using
a sewing machine with a foot pedal that has variable-speed response. If
he depresses the pedal just a bit, the sewing machine advances the fabric
slowly, and if he “puts the pedal to the metal,” the sewing machine moves at
its fastest rate. Now, imagine his daughter sitting under the table watching
her father sew. She can only see the pedal, but not the sewing machine
or the fabric. The only information available to the girl is the amount of
depression of the pedal, and we assume that, based on her knowledge of
sewing machines and foot pedals, she can infer a function f(t) that describes
the rate that the fabric is moving at time t. The girl watches the pedal
for a minute or so, and then her father stops and asks her, “How far have
I traveled along the fabric?” Let's say this girl is particularly bright and
knows some integral calculus, so she integrates the function f(t), to yield
the total amount of fabric that has passed under the needle. As we see
later, this sort of question is actually quite close to the types of mechanics
problems that are solved with integrals in video games!
Search WWH ::




Custom Search