Pages

Showing posts with label Exercise. Show all posts
Showing posts with label Exercise. Show all posts

Sunday, December 29, 2024

Tour de Living Room

A number of years ago, Marika and I got a Peloton bike, and I've often wondered whether the data from logged rides is available. This week I did some digging, and I found a couple people exploring the same question. It turns out Peloton offers the same type of REST API that I learned about when I was exploring the PUC data! Unfortunately, it's largely undocumented, but I was able to get what I was interested in by following those links above. The bike records several different statistics: the speed I'm pedaling measured in revolutions per minute (rpm), the resistance applied to the pedals measured as a percent, the output power resulting from those two factors measured in Watts, and my heart rate measured by my watch in beats per minute (bpm).

Because I'm a physicist, I was both delighted by the use of SI units for the power (Watts) and total energy (Joules), and disappointed that resistance is simply given as a percentage. I know that the output power depends on both the cadence and resistance, so we can plot those 3 together and see what the relation is:

It's a little hard to see, but if you look at points with similar resistance (color), they show a roughly linear relation between the cadence and output. As resistance increases, so does the slope. Unfortunately, the data Peloton gives is rounded to integers, so it's hard to get a precise measure of the relation.

The classes we take on the bike give target ranges for cadence and resistance over the course of a ride. The bike shows where you are relative to the min and max, and I've noticed that sometimes I can stay roughly in the center, and other times I'm ping-ponging from end to end. My impression was that it was higher resistances that made it more difficult to stay stable, so to back that up I split the rides into regions based on changes in the target resistance/cadence, and plotted the standard deviation of my cadence:

This doesn't show a relation as cut and dry as I expected, but we can see that the highest deviations all are during resistances higher than 30%, which is where I start to feel strained.

The final thing I wanted to look at was long term trends – Can I see improvement in my performance? I took some summary statistics for each ride, and plotted them with the number of days since we got it. First I looked at the distribution of output power over each ride:

The dots show the median power, and the lines show the 25th/75th percentiles. At the very beginning, I was a bit overambitious, and tried a class that was way above my abilities, then settled into a more consistent level. After a significant break (our time living in the RV, which barely has space for us and Eros, let alone a bike), I've been on a nice upward trend. The other improvement I wanted to look for was a trend in heart rates – Ideally, I should be able to achieve the same output power with a lower heart rate.

Since it takes time for my heart rate to respond to changes in effort, I decided a better measure was the max rate with the total work done over the course of each ride. You can see above, I do manage to hit higher work totals for the same heart rate, and for the lower work totals, my heart rate is lower – Progress!

If you have your own Peloton and want to see your stats (or maybe develop a Peloton analysis package?) you can find my code here.

Sunday, May 3, 2020

Ellip-Service

In the pre-corona times, Marika and I would go to the gym fairly regularly, and I would often wonder about the construction of the elliptical machines. It seemed like an interesting problem to create a mechanical linkage that would result in your feet tracing an ellipse. Unfortunately, the ones at the gym had things closed up, so it was difficult to see what was going on. My in-laws though, have a model where the workings are more exposed:


The blue circle is a wheel that the machine applies resistance to, and the red is an arm handle that swings back and forth in an arc. These two are connected together to the foot pedal. The main things I wondered were, does this in fact trace an ellipse, and how does the force vary over a cycle?

I made a model in Python to create an animation of a cycle:

The green trace shows the path of your foot through one cycle, and it's pretty far from an ellipse. I was especially surprised to see it has a pinched end at the start. That made me wonder about the arbitrary choice I made to start the wheel and the arc at their rightmost points. Instead, we could introduce a phase difference, and look at how the foot trace changes:
It seems we can't do much better at making an ellipse, but we can do a lot worse!

Turning to the second question, we can find the force needed by getting the acceleration, which is just the second derivative of the position. If the wheel moves at a constant rate then with the original 0 phase shift we get
This suggests that the force is far from constant, and not even a simple variation. It's possible one of the other phase differences would give a more regular shape, but I'm still surprised by how complicated these can get with what seems like a simple mechanical system!

Monday, December 23, 2019

Yabba-dabba-doo!

Coming back to Michigan means going to the gym again! I'm always interested in the energy measurements given by the machines – Calories are a unit of energy, but with a capital "C", they're actually kilocalories, with a lowercase "c". Here's a 30-minute workout on the elliptical:

This says I burned 268 Calories to go 2.43 miles, or 0.009 miles/Calorie.

A few years ago, my parents got the all-electric Chevy Bolt, which also shows the energy used to go a distance, and so I was curious to see how I stack up to their car in terms of efficiency. I asked Sally to send me a photo of one of the status screens:

The number we're interested in is the 3.0 miles/kilowatt-hour. Kilowatt-hour is another unusual measurement of energy, since Watts are energy per time (specifically Joules per second) which we multiply by a time to get back to energy.

To compare these two, we can convert the units to match: 0.009 miles/Calorie = 7.74 miles/kWh, meaning running on an elliptical is 2.58 times as efficient as a modern electric car! You might be thinking a new charging method is in order...
Giphy

...unfortunately, the energy demands of hauling a car around are a bit higher than your own body, as shown by another status screen:

The total energy of 22.4 kWh comes to almost 20,000 Calories, which I don't think is in the range of many humans!