Pong

## June23th 2015 Calculating Calories

Given a particular track, how can we (approximately) calculate the spent calories from the track?

We basically only have time $t$ and velocity $v(t)$. So we define the calories spent as time integral of a function $W(v)$, where $W(v) is describing the actual power level for a particular velocity and activity. Since the function$W(v)$is not known, we first assume that it can be represented as a quadratic polynomial:$W(v) = c_0 + c_1v + c_2v^2$Then the spent calories are$kcal = \int_t W(v)dt$Using discrete arithmetic the calories are$kcal_i = \sum_i W(v_i)\Deltat_i == c_0 \sum_i\Deltat_i + c_1 \sum_iv\Deltat_i + c_0 \sum_iv^2\Deltat_i$For each track the above three terms can be easily tabulated. So we create 3 tables, where each entry corresponds to the corresponding sum term of the above formula:$T_{0_i} = \sum_i\Deltat_iT_{1_i} = \sum_iv\Deltat_iT_{2_i} = \sum_iv^2\Deltat_i$Now we write$kcal_i = c_0 T_{0_i} + c_1 T_{1_i} + c_2 T_{2_i}$So for a particular period of time from starting time$t_i$to end time$t_j$the spent calories during that time period are:$kcal_{i..j} = kcal_j - kcal_i = c_0 (T_{0_i}-T_{0_j}) + c_1 (T_{1_i}-T_{1_j}) + c_2 (T_{2_i}-T_{2_j})$This is a general equation for the calories spent during a particular activity, where the coefficients$c_0$,$c_1$and$c_2\$ are specific for the particular activity and person.