This object is in archive! 
Calculation of Energy
Answered
I have written a spreadsheet to analysis an exported csv file and I am interested in how you calculate the energy used. This should be proportional to weight. I have a calculation that sums walking energy, increase in potential energy and kinetic energy., As it happens, the result is not far off the Locus Map value, yet Locus Map does not know my weight. How do you calculate it?
Actually, I see Locus Map does have my weight - but I would still like to know how the energy is calculated.
Actually, I see Locus Map does have my weight - but I would still like to know how the energy is calculated.
Good day Mike,
Locus Map currently uses two methods to compute consumed calories.
First is based on the known heart rate value (in case of usage of some heart rate chest belt). If HR value is not known, energy is computed based on predefined activity for a track and computed basal metabolic. Both methods anyway need to know your sex, age, weight. These values may be defined in Locus Map in settings > Track recording > Personal details.
You did not know about this "Personal detail" dialog right? Then it seems to be too hidden in settings.
Also, one interesting topic (which was not yet used/implemented) is here: http://help.locusmap.eu/topic/what-are-the-parameters-used-for-calculating-the-calories .
If you have additional questions, feel free to ask.
Good day Mike,
Locus Map currently uses two methods to compute consumed calories.
First is based on the known heart rate value (in case of usage of some heart rate chest belt). If HR value is not known, energy is computed based on predefined activity for a track and computed basal metabolic. Both methods anyway need to know your sex, age, weight. These values may be defined in Locus Map in settings > Track recording > Personal details.
You did not know about this "Personal detail" dialog right? Then it seems to be too hidden in settings.
Also, one interesting topic (which was not yet used/implemented) is here: http://help.locusmap.eu/topic/what-are-the-parameters-used-for-calculating-the-calories .
If you have additional questions, feel free to ask.
Thanks, but that did not explain how it is calculated. I have written a macro to read LocusMap csv files (now writing one for gpx files) and I am using an energy calculation based on data from BUPA. I have started with walking on a level, firm surface for which I fit a curve to the reference:
KJ = Weight*Time*(0.125888*v^3 - 0.532833*v^2 +0.951283*v + 2.471667)/1000
where weight is Kg, Time is secs, v is mph (funny mix of units, I know)
To this I add the increase in potential energy (mgh2-mgh1) and the increase in kinetic energy (½mv2² - ½mv1²), only considering increases in h and v. I sum these for all the track points to get a total for the track.
I will be incorporating other types of walking from the same site eventually.
What I wanted to know was the equations that you use. On an example walk, LocusPro calculates 1269KJ. I calculate 1485KJ, which is 1346KJ from walking, 85KJ from potential and 54KJ from kinetic.
Thanks, but that did not explain how it is calculated. I have written a macro to read LocusMap csv files (now writing one for gpx files) and I am using an energy calculation based on data from BUPA. I have started with walking on a level, firm surface for which I fit a curve to the reference:
KJ = Weight*Time*(0.125888*v^3 - 0.532833*v^2 +0.951283*v + 2.471667)/1000
where weight is Kg, Time is secs, v is mph (funny mix of units, I know)
To this I add the increase in potential energy (mgh2-mgh1) and the increase in kinetic energy (½mv2² - ½mv1²), only considering increases in h and v. I sum these for all the track points to get a total for the track.
I will be incorporating other types of walking from the same site eventually.
What I wanted to know was the equations that you use. On an example walk, LocusPro calculates 1269KJ. I calculate 1485KJ, which is 1346KJ from walking, 85KJ from potential and 54KJ from kinetic.
Exact equation?
In case of Locus, the method based on "not known Heart rate values" is the following:
The major complaint I see here is ignoring elevation changes as also mentioned in the second topic. Not sure yet, how to correctly add support for it here.
Is my explanation clear?
Exact equation?
In case of Locus, the method based on "not known Heart rate values" is the following:
The major complaint I see here is ignoring elevation changes as also mentioned in the second topic. Not sure yet, how to correctly add support for it here.
Is my explanation clear?
Thanks, I will dig deeper into those references to find suitable equations for my macro. Then I will know how clear it is!
My equation is a simple curve fit to the reference I quoted that would be valid from 2-5mph on flat hard surfaces. From my simple calculation, on a walk that is about 5km long and about 70m altitude, the elevation change is about 6% of the energy and the kinetic energy even less. That seems typical of my walks around town (Bristol, UK).
Thanks, I will dig deeper into those references to find suitable equations for my macro. Then I will know how clear it is!
My equation is a simple curve fit to the reference I quoted that would be valid from 2-5mph on flat hard surfaces. From my simple calculation, on a walk that is about 5km long and about 70m altitude, the elevation change is about 6% of the energy and the kinetic energy even less. That seems typical of my walks around town (Bristol, UK).
I have now written a spreadsheet to read and analyse gpx files to compare with LocusMap. Initially, I wanted to check the energy expended, but I find large discrepancies in many areas. I generally use the ‘walking’ activity. I have obtained all my METs from the Compendium of Physical Activities, fitted them to walking speeds 0-5mph and applied the Harris Benedict MET correction for weight, height, age and gender (which is 1.26 for me).
Height gain and loss. I summate the increase in height in every step to height gain and the decrease in every step to height loss. I have found that, on long, hilly walks up to 14 miles, the height gain and height loss calculated this way can be over 1,000 metres more than LocusMap.
Activity type. LocusMap seems to be a bit confused with activity types. Apart from my normal longer walks, I have performed some simple tests on a 150m stretch of flat, firm road, walking backwards and forwards at different speeds.
I have compared overall energy and find that my calculations produce significantly higher energy than LocusMap. My analysis includes the MET correction. Strangely, if LocusMap were to have erroneously divided its energy by this correction, there would be a reasonable match. Of course, MET should be multiplied by this correction.
Nordic walking has METs of 0.15 above walking at ‘normal’ speed and 1.3 above walking at 5+ mph. LocusMap energy can increase by a factor of over 2 at low speeds and 0.59 at higher speeds when this activity is selected. And this behaviour is in the opposite sense – i.e. increasing with low speed.
Hiking has METs of about 1.75 above walking. LocusMap calculated the hiking energy to be between 0.88 and 3.47 times the walking value! And the highest factor is at the lowest walking speed. Bizarre!
For climbing, the MET is at least 8 – around twice that of walking – but LocusMap produces climbing energy levels between 16% and 62% of walking. There is something wrong here.
In running, at the highest speed, less energy is used than walking. The MET for running is between 6 and 23 – much higher than for walking. This does not make sense.
I have now written a spreadsheet to read and analyse gpx files to compare with LocusMap. Initially, I wanted to check the energy expended, but I find large discrepancies in many areas. I generally use the ‘walking’ activity. I have obtained all my METs from the Compendium of Physical Activities, fitted them to walking speeds 0-5mph and applied the Harris Benedict MET correction for weight, height, age and gender (which is 1.26 for me).
Height gain and loss. I summate the increase in height in every step to height gain and the decrease in every step to height loss. I have found that, on long, hilly walks up to 14 miles, the height gain and height loss calculated this way can be over 1,000 metres more than LocusMap.
Activity type. LocusMap seems to be a bit confused with activity types. Apart from my normal longer walks, I have performed some simple tests on a 150m stretch of flat, firm road, walking backwards and forwards at different speeds.
I have compared overall energy and find that my calculations produce significantly higher energy than LocusMap. My analysis includes the MET correction. Strangely, if LocusMap were to have erroneously divided its energy by this correction, there would be a reasonable match. Of course, MET should be multiplied by this correction.
Nordic walking has METs of 0.15 above walking at ‘normal’ speed and 1.3 above walking at 5+ mph. LocusMap energy can increase by a factor of over 2 at low speeds and 0.59 at higher speeds when this activity is selected. And this behaviour is in the opposite sense – i.e. increasing with low speed.
Hiking has METs of about 1.75 above walking. LocusMap calculated the hiking energy to be between 0.88 and 3.47 times the walking value! And the highest factor is at the lowest walking speed. Bizarre!
For climbing, the MET is at least 8 – around twice that of walking – but LocusMap produces climbing energy levels between 16% and 62% of walking. There is something wrong here.
In running, at the highest speed, less energy is used than walking. The MET for running is between 6 and 23 – much higher than for walking. This does not make sense.
Hi Mike,
let's bring some more light here.
Nordic walking: app use activity ID 17302, so defined MET is 4.8f. Locus use this value for all speeds when Nordic walking activity is selected. Result then should be:
Your computed basal metabolic rate * time (part of day) * activity MET.
Hiking: here was choose probably too aggressive 17040. Will change it to 17080
Climbing: ah thanks, copy & paste error. Will fix and use 15535 with MET as 5.8
Running: most complicated. App use many values since 1.1 m/s (MET 3.0) up to 6.2 m/s (MET 23.0) and interpolate between them based on speed.
Walking: Similar to running, just different values.
---
Difference between walk & run is a mystery for me. I tested it on my bike record to change it to walk & run and running display almost twice as big energy consumption. Do you use some track recording without heart rate values?
---
The difference in sum of elevation: Locus Map does some post-processing of elevation and filtration of data before use. If you use any web services or other apps, you will almost never get the same values.
---
If you send me something to test (exported GPX track + values to compare), I'll gladly check if in the app aren't any another issues. It is of course possible.
Hi Mike,
let's bring some more light here.
Nordic walking: app use activity ID 17302, so defined MET is 4.8f. Locus use this value for all speeds when Nordic walking activity is selected. Result then should be:
Your computed basal metabolic rate * time (part of day) * activity MET.
Hiking: here was choose probably too aggressive 17040. Will change it to 17080
Climbing: ah thanks, copy & paste error. Will fix and use 15535 with MET as 5.8
Running: most complicated. App use many values since 1.1 m/s (MET 3.0) up to 6.2 m/s (MET 23.0) and interpolate between them based on speed.
Walking: Similar to running, just different values.
---
Difference between walk & run is a mystery for me. I tested it on my bike record to change it to walk & run and running display almost twice as big energy consumption. Do you use some track recording without heart rate values?
---
The difference in sum of elevation: Locus Map does some post-processing of elevation and filtration of data before use. If you use any web services or other apps, you will almost never get the same values.
---
If you send me something to test (exported GPX track + values to compare), I'll gladly check if in the app aren't any another issues. It is of course possible.
Thanks very much for the feedback, Menion.
Firstly, I only use the walking category in LocusMap. I have checked the other categories to get some insight as to how LocusMap calculates energy and see if I can find any correlation. For example, if I can find consistent factors between categories, then these should relate to the METs from the Compendium of Physical Activity.
Nordic walking. Yes, activity ID 17302 with MET 4.8 at 3.5-4 mph. Walking at 3.5mph and 4mph (IDs 17200 and 17220) have METs 4.3 and 5, so we could say 4.65 average. Nordic walling thus adds 0.15 to the MET at these speeds. I would therefore expect an increase of 0.15/4.8 (3%) from LocusMap when reclassifying my walk from ordinary walking to Nordic walking. But I get a factors over 2x, or 200%. At 5mph, the difference between Nordic walking and ordinary walking is an increase in MET of 1.3 over the walking MET of 8.5, or 15%. LocusMap gives 59%.
Hiking. There are various activities, but METS are about 1.75 above walking. I would expect to see some constant factor in the LocusMap energy calculation not far away from this. However the factor varies wildly between 0.88 and 3.47. Unfortunately, the hiking categories the CPA provides have no dependence on speed.
Running. Apart from a walking/running and plying with children ID 05175 with MET 3.5, the running categories 12010-12200 provide METs of 6 to 23. At 4mph, running has MET of 6 compared to walking of 4.5. At 5mph, running and walking are the same at 8.3. There should never be a situation where running uses less energy than walking.
Heart rate values. I don't use these. I am only comparing energy calculations with the CPA that does not present any dependence on this variable.
Elevation. I calculate this from the gpx file produced by LocusMap, so I presume there is consistency here. However, I find my devices report elevation a bit unreliably from the same location on different occasions. I was wondering whether LocusMap performs some averaging to smooth out discrepancies in elevation and produce more realistic values of hGain and hLoss.
I have attached a file of short gpx files walking the same 145m walk at diferent speeds. There is also a summary of the energies calculated for different categories compared with my calculation.
Thanks very much for the feedback, Menion.
Firstly, I only use the walking category in LocusMap. I have checked the other categories to get some insight as to how LocusMap calculates energy and see if I can find any correlation. For example, if I can find consistent factors between categories, then these should relate to the METs from the Compendium of Physical Activity.
Nordic walking. Yes, activity ID 17302 with MET 4.8 at 3.5-4 mph. Walking at 3.5mph and 4mph (IDs 17200 and 17220) have METs 4.3 and 5, so we could say 4.65 average. Nordic walling thus adds 0.15 to the MET at these speeds. I would therefore expect an increase of 0.15/4.8 (3%) from LocusMap when reclassifying my walk from ordinary walking to Nordic walking. But I get a factors over 2x, or 200%. At 5mph, the difference between Nordic walking and ordinary walking is an increase in MET of 1.3 over the walking MET of 8.5, or 15%. LocusMap gives 59%.
Hiking. There are various activities, but METS are about 1.75 above walking. I would expect to see some constant factor in the LocusMap energy calculation not far away from this. However the factor varies wildly between 0.88 and 3.47. Unfortunately, the hiking categories the CPA provides have no dependence on speed.
Running. Apart from a walking/running and plying with children ID 05175 with MET 3.5, the running categories 12010-12200 provide METs of 6 to 23. At 4mph, running has MET of 6 compared to walking of 4.5. At 5mph, running and walking are the same at 8.3. There should never be a situation where running uses less energy than walking.
Heart rate values. I don't use these. I am only comparing energy calculations with the CPA that does not present any dependence on this variable.
Elevation. I calculate this from the gpx file produced by LocusMap, so I presume there is consistency here. However, I find my devices report elevation a bit unreliably from the same location on different occasions. I was wondering whether LocusMap performs some averaging to smooth out discrepancies in elevation and produce more realistic values of hGain and hLoss.
I have attached a file of short gpx files walking the same 145m walk at diferent speeds. There is also a summary of the energies calculated for different categories compared with my calculation.
Hello,
problem with walking vs nordic walking was partially described before.
Main problem here is, that NW has defined an only single activity, so only 17302, so no matter how fast you go, it will always compute MET 4.8.
I just checked this on my simple 15 km walk and I get also almost 2xhigher value for NW. Reason? The slow speed of walk vs required speed around 4.65 for correct NW.
Hiking? Same problem ... a single defined parameter that completely ignores speed value.
----
Perfect, I have found one serious issue in my interpolation that may caused inaccurate values, mainly for higher speeds. Will be fixed in next version, thanks!
----
And elevation values ... what you get in GPX is not exactly what you see in app. In GPX are raw , almost original data. In app are usually used filtred and optimized values. So simply sum of gain/loss from GPX will be always higher then what you get in app.
Menion
Hello,
problem with walking vs nordic walking was partially described before.
Main problem here is, that NW has defined an only single activity, so only 17302, so no matter how fast you go, it will always compute MET 4.8.
I just checked this on my simple 15 km walk and I get also almost 2xhigher value for NW. Reason? The slow speed of walk vs required speed around 4.65 for correct NW.
Hiking? Same problem ... a single defined parameter that completely ignores speed value.
----
Perfect, I have found one serious issue in my interpolation that may caused inaccurate values, mainly for higher speeds. Will be fixed in next version, thanks!
----
And elevation values ... what you get in GPX is not exactly what you see in app. In GPX are raw , almost original data. In app are usually used filtred and optimized values. So simply sum of gain/loss from GPX will be always higher then what you get in app.
Menion
Thanks again, Menion.
As my main interest is calculating energy, I need to get some reasonable estimate of potential energy expended. Therefore, elevations are important. When you 'filter and optimise' values, what does that actually mean, and why do you do it? As the gpx file has fluctuations, it would appear that you effdctively make your adjustments to the gpx file data. What algorithm do you use?
Thanks again, Menion.
As my main interest is calculating energy, I need to get some reasonable estimate of potential energy expended. Therefore, elevations are important. When you 'filter and optimise' values, what does that actually mean, and why do you do it? As the gpx file has fluctuations, it would appear that you effdctively make your adjustments to the gpx file data. What algorithm do you use?
No need to thanks.
If you are interested in better computed energy values for your activities (which looks like you are), you may help me to improve it. As I wrote, elevation change currently does not affect computed energy, mainly because I was not able to find some useful source of information anyway I'll gladly improve it.
How Locus optimize altitude values ... something should be left as company secret ;) anyway it is few some basic filters that cooperate together to filter unexpected changes in altitude values. Why this? Altitude measured with GPS (vertical accuracy) is usually a lot worst then horizontal accuracy, so these values need to be optimized. If you import exported GPX file to other mobile or web apps, you mostly get different values in every app, because every app do this on its own. There is no universal system globally used.
No need to thanks.
If you are interested in better computed energy values for your activities (which looks like you are), you may help me to improve it. As I wrote, elevation change currently does not affect computed energy, mainly because I was not able to find some useful source of information anyway I'll gladly improve it.
How Locus optimize altitude values ... something should be left as company secret ;) anyway it is few some basic filters that cooperate together to filter unexpected changes in altitude values. Why this? Altitude measured with GPS (vertical accuracy) is usually a lot worst then horizontal accuracy, so these values need to be optimized. If you import exported GPX file to other mobile or web apps, you mostly get different values in every app, because every app do this on its own. There is no universal system globally used.
If you want to include elevation in your energy calculation, it is simply mgh, or mass (Kg) * gravity (9.81m/s2) * height (m). Units are Joules. I take only hGain and ignore hLoss. I sum it up step by step, but one can just simply use the net hGain at the end of the walk. The question then is what hGain actually is - something for the inner circle, it seems!
In the CPA, there is sparse data for walking on slopes. It was not possible to come up with any coherent dependency. Therefore, I take the MET on the level and add the potential energy. To me, this seems reasonable for moderate slopes. By moderate, I mean where the leading leg does not need to bend. I expect higher slopes would burn a bit more energy when the knees are worked.
Underestimating the energy burn is, for me, preferable because I am not tempted by an energy justification to eat a piece of cake!
If you want to include elevation in your energy calculation, it is simply mgh, or mass (Kg) * gravity (9.81m/s2) * height (m). Units are Joules. I take only hGain and ignore hLoss. I sum it up step by step, but one can just simply use the net hGain at the end of the walk. The question then is what hGain actually is - something for the inner circle, it seems!
In the CPA, there is sparse data for walking on slopes. It was not possible to come up with any coherent dependency. Therefore, I take the MET on the level and add the potential energy. To me, this seems reasonable for moderate slopes. By moderate, I mean where the leading leg does not need to bend. I expect higher slopes would burn a bit more energy when the knees are worked.
Underestimating the energy burn is, for me, preferable because I am not tempted by an energy justification to eat a piece of cake!
Replies have been locked on this page!