2011/11/29

Suspense at the Gym

Imagine the following... You're on your back, doing your last repetition of bench press. You put a bit more weight than usual (80kg, actually), and with a last feat of strength and a distorted smile of triumph, you complete the rep and put the bar back. You take a breath to savor the moment, stand up, take a sip of water from your bottle, and go to the side to take the weights off. Wait, what are you doing?

There's a lot of weight on the other side of the bar! Won't the bar flip over if you take the weights off on this side? Do you have to go back and forth and gradually take the weights off? You don't know what to do, you're kinda scared to remove the weights, you're still panting, and you suddenly wish you'd read a blog talking about pivot points.

Center of Mass
A typical olympic bar weighs 20kg (45 lbs), and you put 80kg in weights, which totals to 100 kg. When the weights are on each side, the system's center of mass is at the middle.


What happens when the weights on one side are removed? The center of mass is shifted towards the weighted side. The bar will flip if the center of mass goes beyond the hook.


So, will 40kg of weight be enough to flip the bar?


The Barbell
First, let's define the barbell and weight plates. Everything is different everywhere, but I'm trying to stay as close to reality as possible. The barbell we're using is based on a normal olympic barbell. Assuming a constant volumetric mass (density), you can get the weight of the different components.


Let's also define our weight plate set.


Let's also assume that, with your current set-up, the hook (pivot point) is 0.100 meter (10 centimeters) from the larger part where you put the weights, so 0.545 meter from the end. Also, for the example, your 40 kg weight plates are: 3× 10 kg + 2× 5 kg.


40 Kilograms on One Side
How can you know if the bar is going to fall? The farther from the pivot point a weight is, the heavier its impact will be. For example, if you have a 5 kg weight 0.1 meter from the pivot, its impact will be less than the same weight a meter away. As a matter of fact, it will have ten times less impact (1 ÷ 0.1).

It's not so easy, though. We don't have pinpoint weights. They are spread out, so we need to use integrals. Let's first calculate how the barbell will act around the pivot point.

You can calculate how much the weight is spread out by dividing the weight by its length. For example, the 10 kg weight is spread over 0.026 meter, so it is 10kg / 0.026m = 385kg/m. This will be used during the integral calculations.


Now, the farther the weight is, the more impact it has on the system. This is linearly proportional to the distance.


By calculating the area under the curve (the integral), we can compare the two sides of the pivot. The heavier side will win and bring the bar down. Of course, if the left side is heavier, the bar will just rest on the left hook and stay there.

With some calculations (which will be seen shortly), we can learn that the left side is 13.28kg·m, or equivalent to a 13.28kg weight placed a meter away from the pivot, while the right side is equivalent to a 12.17kg weight a meter on the other side. For simplicity, this will be called the impact.

Left side is heavier, so that's enough to keep the bar on the hooks, but the choice of weights could definitely be better. The weights that are farther have a lot more impact - the two 5kg have a 4.76kg·m impact, compared to the three 10kg's 5.23kg·m impact. If we would have chosen four 10kg, they would have had a total impact of 7.49kg·m. Two 20kg would have a 6.8kg·m impact.


Mathematics
What is the impact of the barbell alone? We can split the bar into its constituents, depending on the position.


We can formulate the following integrals


and, knowing the density of the constituents and their position, calculate everything.



That means that if the added weights' impact is less than 11.1kg·m (13.28 - 2.18), the bar will not fall.

The rest is similar. If you have, for example, a stack of twenty 1.25kg, their impact will be 8.375kg·m (integral from 0.135m to 0.535m, with density 62.5kg/m).


When Will the Bar Fall?
Turns out that for normal weight ranges, it's pretty hard to make the bar fall.

If you take a single 25kg weight and place it at the very end, it will be enough to cause a crash. A single 20kg at the end will not, though.

Under a smart weight selection, three 20kg weights will be just enough to tilt the bar. If it happens, it means you were bench-pressing 120kg (264lbs), and at that weight, you should have a spotter.

2011/11/25

Minimalism in the Living Room

Ever since I had enough money to buy a computer, I always had the huge powerful ones. At first it was the games, then the video-editing, then just because I wanted the latest technology so that my applications would run quickly and smoothly.

That changed recently as I began to understand the rise of web applications and decentralization. Software is now run on servers, and their interface shown to you through your selected browser. Cross-platform is less and less a problem, though it now lies with cross-browser. Your photos, files, and data are on the cloud. The time when the only thing you need is a browser is quickly coming.

I want to get rid of my huge computer. I also have a handy laptop, and if possible, I'd like to get rid of it too. I want to clean the living room, and be able to look around and not feel visually attacked by all the things around me!

A part of my job is to design web sites, and I've become more and more interested in minimalism, or at least in a way to show the data in the most simple way. User experience is very important, and rely in small part on removing the useless visual clutters. Why not do the same in my living room? I look around... The kitchen is not bad - a couple fruits slowly ripening on the counter, and some small appliances in a corner next to the window. The living room is something else. Clockwise: a bookcase with some books, movies, and random stuff, followed by a huge thousand-dollar desk, a seldom-used PS3, a 32" LCD TV, a 21" LCD monitor, and a laser printer. Under the desk, partially hidden by an expensive wheeled chair, lies the beast, casting a blue glow on a huge powerbar and a web of wires and cords.


What if I sell the monitor, give the computer and printer to someone, sell the bookcase, build a smaller one, sell the huge desk, hang the TV on the wall, and build a minimalist place to store the PS3 and the few movies? I could even get rid of the PS3 and buy a blu-ray reader. How would that look?


I stopped video-editing a couple years ago, but I am still using my computer to draw and to program, with the occasional movie. I think everything else I do these days is through the internet. I guess I could do that with my laptop, but I feel the wind of change is stronger than that. I want to change everything. I want my home experience (related to computers) to be limited to a tablet (Apple or Samsung - I haven't made my choice yet).

After some searching, I learned that it is possible to use a Wacom tablet on the web, which means it is possible to draw without the need for an installed application. I first tried the deviantART Muro web app, made a drawing, and then found out they don't have a crop tool. The drawing was ok, though, once I got used to it (about 5 minutes). There is also Autodesk's Sketchbook, a 50$ windows application, which can be had as an iPad app for 5$. Didn't try it yet, but it looks promising, if you combine it with a Wacom pen for the iPad. I'll have to test these.

Second is the programming. It seems Cloud9 has good reviews. You can set it to work on a GitHub account pretty easily. At work, I program with Visual Studio, and I guess I could use the opportunity to finally learn the simpler and more attractive Python / Django at home. Didn't do much research on that, but programming on the web sure seems easier said than done. Maybe I could completely stop programming at home? Or maybe stay an hour or two after work to continue my personal projects? I could then spend my free time to read, or take a walk...

For the movies, there is of course streaming web sites like Netflix. Also, the movies you buy can be bought as downloads (iTunes). I'll have to check if I can output a movie from the iPad to the tv...

I'll wait for the iPad 3 and the next Samsung tablet, and compare the two. Then I'll make a decision about my living room.

2011/11/22

Working Parents

A recent trend among couples is that both are working. They meet, get married, have kids, but both are so dependent on material possessions or various expensive services that they continue working and just give their children to some caretaker every day of the week. Or maybe they never thought about it that much, and continued their day-to-day lives. Or maybe they have too much debt...

You rarely saw that in the 1920s, 1950s, even 1980s. Women requested more and more rights, and wanted the freedom to do what they wanted. I'm not saying it's a bad thing (far from it), but a consequence of this newly found financial independence is that they want to keep it, and not rely on someone else. Also, we have a society so centered on material possessions that we are willing to forget family values.

I once started the subject with someone. What she replied was "I went to the university for this job, why would I throw it away?" What better reason would you need than for your children?

Please don't get me wrong - I'm not saying it's because women continued to work, but because both parents kept working. If my future love wants to keep working after we get kids, I'll seriously consider giving up my own job and take care of the kids and the house, all day long.

Think about how your parents were when you were a kid. Chances are that, if you're about my age or older, your mother was staying home. Dad left home in the morning, after breakfast. Mom took care of you, played with you, prepared lunch, did some cleaning, washed some laundry, and prepared the dinner just before dad got back from work. Then what? Both were having a nice evening, doing relaxing things, playing with you, or whatever.


Your mother had a job - a very demanding one, and unpaid, but consider the alternative... Both your parents wake up and hurry to eat breakfast and dress you, and both take their respective car in opposite directions, one of them bringing you to a daycare center. You stay there, playing with friends, until one of your parents come and get you back. Both parents get back home, it's 17h30, dinner is not made, and they hurry to prepare something quick (and unhealthy) before spending the evening doing a batch of laundry and cleaning the kitchen, to finally take a breath 20 minutes in front of the TV before going to bed. You, all that time, couldn't get your parents' attention, and had to play by yourself or with your siblings. And then, it's the weekend, and your parents spend it working and cleaning everything that they didn't have enough time to during the week.



This is a trend, and it's a totally voluntary one. People right now are preferring a life of stress and higher pay grades, instead of spending quality time with their family. Yes, they can afford a 60" plasma TV, and the latest PC, and they can give a smartphone to each of their kids even if they costs 60$ per month. But at what cost?

You mother had a job - and in every aspect of it, it's the most rewarding job ever. You help your kids grow up, see them take their first steps, you're there to hug them when they hurt themselves (they always do), and most important of all, you take your time and give them your values. Not the values of a daycare provider - I'm not saying their values are wrong, just that they are not yours.

That leads me to wonder exactly why our society is like that. What has become of the American dream? Was "keeping up with the Joneses" the problem? I guess it's a possibility. Ads are made in such a way that we feel compelled to buy stuff, all the time. Remember the excitation just before you buy something? It's like a drug. We are fed images of things that we don't need, and are "told" that we "should buy it" because "normal people" have it.


Does a family really need two jobs? It costs an average of 10,000$ per year for daycare, per child. Plus a second car (let's say 5,000$ per year, over five years), plus gas, plus the extra cost of ready-to-eat food... Maybe add to that a vacation, because of the added stress? All these extra expenses that occur only as consequences to having both parents working. After taxes, you're left with a net amount of what... 1,000$? 10,000$? 20,000$?

I urge people to consider a life more centered on family values, and less on material possessions. Do you have debts? Pay it back, and as soon as possible! Buy a used car instead of a brand-new 35,000$ one (or for crying out loud, buy the 20,000$ one!). Do you really need *all* those channels on your tv? Do you really need that expensive piece of clothing with a brand on it? Cook instead of going so often to the restaurant. There are so many expensive things that we don't see around us. And when you are done with your debt, invest what you have left - it will pay in the long run.



Maman, papa, merci du fond du coeur pour ce que vous avez fait pour Mélanie et moi.

2011/11/18

Happy Birthday!

I learned recently that Time-Warner has the copyright to the song "Happy Birthday to You". Technically, they can sue you if you sing it publicly.

This has got to be the most memorable song everyone sing, every year, since their first birthday. Why is there even a copyright on such a happy song? Because TW reportedly receive around 2 million dollars in royalties, evey year. It can cost several thousand dollars to use the song in a movie. And the suing thing was not even a joke - though they were covered in shame for doing so, some smartass somewhere thought it was worthwhile to sue a group of camping scout girls.

I really need to know what they were thinking, if they really thought they could get a lot of money out of this, and who approved the action. After the media coverage, they apparently settled for a symbolic 1 cent (if I remember correctly?), but the intent was there from the beginning.

Companies like this are the ones that we should boycott, but how exactly can we do that? TW owns New Line Cinema, Time inc, and HBO, along with a dozen other subsidiaries. That's pretty big. We can boycott companies like Sony in favor of Samsung, for example, but if I want to boycott New Line Cinema, I'll notice pretty quickly that no other film studio has another version of the Lord of the Rings.


So I guess my question would be: why the *fuck* isn't Time-Warner giving this song back to the public domain, where it belongs? Yeah, yeah... Money...

2011/11/15

Pendulum Waves

Did you see the Pendulum Waves video?

It shows a set of properly configured pendulums. When viewed from the side, the brain can recognize different patterns as the bobs swing back and forth at different speed.

The experiment is set up with 15 bobs. The first one is set to do 51 cycles in 60 seconds, the second is set to do 52 cycles in 60 seconds, all the way to the last bob, which is set to do 65 cycles in 60 seconds.


One Pendulum
Let's look at a single pendulum. You bring the bob at a 30° angle, and let it go. It's position over time would be defined as a sine wave.



Two Pendulums
Let's see what happens if you have two pendulums, but they are not synchronized. Pendulum α does 3 cycles in a second, while pendulum β does only 2. Their displacement over time would look like this:


With this graph, we can easily see that at the beginning and at every second, both pendulums are at the left. Also, at 0.5 and 1.5 seconds, pendulum α is at the right, while pendulum β is at the left. This is what our brain recognize as a pattern.


Fifteen Pendulums
Patterns become more apparent with more pendulums, but they can also look more random. The brain recognize when the bobs form groups that are going in the same way, or form a shape (here, this is typically a wave).


The brain seems to have some difficulties to notice patterns made of five groups and more. Forms can also become hard to notice when there is not enough bobs (resolution) to correctly show the wave. For example, when the bobs are first let go in the video, they form a wave of increasing frequency, until, after about 13 or 14 seconds, the brain can't make out the wave anymore.


Mathematics
The most important thing in the experiment is to carefully time the bobs. How to do that?  The formula to find a pendulum's cycle (taken from wikipedia, because this was far beyond my skills) is


In the video, the initial angle seems to be around 30°, so we can use this value (and greatly reduce the complexity of the formula). Also, gravity on Earth is 9.80665 m/s^2. That simplifies the formula to


For those who care, the graph of the angle modifier looks like this:


If we want the first bob to oscillate 51 times per minute,


we have to set the length of cord to almost one third of a meter, which is pretty much what we can see in the video. With the same formula, we can find that the quickest bob should have a 0.20448 meter cord.


Furthermore, the dark-blue curve on the graph is the same curve that the bobs make initially in the video. Trivia: for a bob to oscillate once per minute, it would need a cord almost 1 kilometer long. For it to oscillate once per day, the cord would be longer than the distance from the Sun to Saturn.

I have made a small online calculator for such pendulums. You can find it at my web site. At the time of writing, giving the data to find the angle is not implemented (I will have to code a brute-force algorithm for that, or an approximation), but you can easily find the other data.

2011/11/11

Evolution of Jilwutses

What motivates everyone (humans, animals, everything) is the survival of its own species. Examples of ways to survive are becoming stronger, and making more babies. On the long term, the way to achieve that is through evolution.

The following is an example of how evolution works with natural selection following a mutation.


The Gist
Let's create a fictional race of little animals called Jilwutz. These wild animals are about the size of a medium house cat. Times are tough, jilwutses are delicious, and predators are abundant. A female jilwutz can have a pretty large litter of baby jilwutses, but most of them are eaten before the age of procreation. In average, though, the global jilwutz population is rising steadily, but very slowly.


One day, a baby jilwutz is born with a mutation in its ears. This defect allows it to hear better than the other jilwutses. It is now one of the first to flee from predators, because it can hear them faster. This gives it a natural advantage over the other jilwutses, and a higher chance of survival.


If this mutation is not hereditary, the story ends here. If it is, this mutation can be passed to its descendants, all of which will have better chances of survival. Over time, the population of mutated jilwutses will become more populous than normal ones. Over even more time, only the mutated jilwutses will be left.

Natural selection wins. The jilwutz race is stronger.


A Mathematical Scenario
Let's define this fictional animal in more details. A jilwutz can live an average of two years, the first six months being still infertile. They have two estrous cycles per year, and thus, in average, let's say that they participate in 2.9 mating seasons, and that 54% of the females are impregnated during these and successfully give birth after a three weeks gestation. They have a litter of 1.4 baby jilwutses, on average.

Thus, on average (again), each female jilwutz will give birth to 2.2 babies during her life (54% impregnation  × 1.4 babies × 2.9 mating seasons). 1.1 of these are female, which will continue the tree of jilwutz life.The jilwutz population will grow by a factor of 1.1 every generation.


The mutated jilwutz is born. Being able to hear better, its life expectancy rises to two and a half years, so that it, and its descendants, participate in an average of 3.7 mating seasons (instead of 2.9). These mutated jilwutz females will bear an average of 2.8 babies in a lifetime.


In fact, because the normal jilwutses are easier to kill, their population will diminish faster and faster as the mutated population grows. The jilwutz population over time would perhaps look like this:


Many more layers of difficulties can be added. The mutation is assumed to be hereditary, but it doesn't mean it's passed to all children. It could, for example, have 25% chance of being passed  if only one parent have the mutation, and 80% chance if both have it. The effect could be dimmed if one parent doesn't have it.

But if the mutation catches on to enough jilwutses, over time, it will become the standard. Now, because the jilwutz population grows more rapidly, the predators have more food to eat, and their own population (at least in the area) will also rise, which will decrease the number of jilwutses again.

Everything stays the same...

2011/11/08

Running a Marathon

















Pain is temporary; pride lasts forever.

Also, the wall is a really subtle bitch ;).

2011/11/04

My Workout Training

I started working regularly at the gym a few months ago (started at the end of april 2011). I bought the three most user-recommended books from amazon about bodybuilding, exercises, and how the body reacts to physical strain. I wanted to give myself the best chance that i could get to progress, and to stay healthy (though I injured myself a couple times while not being careful).

Right at the beginning, I knew (from experience and from one of the books) that the body takes about two weeks to get used to something. I based my workout on that, and, as the months flew by, adjusted and upgraded it. This is my current workout training, and a work in progress. It may look complicated, but you easily get used to the repetitive flow it has.

Notes:
- I train in the morning, before going to work. I managed to get a 4h45-waking-up schedule in my daily routine. Yes, I find it hard, especially because I have to get to sleep early. I skip gym (or running) once in a while...
- I do about five minutes of running on the treadmill as a warmup, then two additional sets of four reps with lower weights before the first set.
- In a session, I train for about an hour. I only do the last superset if I will have enough time.
- I don't use weight for my back extensions. I noticed my back tended to be sore when I did.
- I don't train my legs that much, because I also run. I didn't want my muscle training to interfere with my half-marathon and marathon trainings. When I feel like it (and it's not too cold in the winter), I do a long distance run on the weekend, usually between 10 - 20km.
- I usually don't follow the rest timings. They tend to be around a minute when I'm not too distracted by the TVs.
- I know this training is not perfect, and some aspects may be frowned upon. Until I upgrade it again, I like it that way. I *know* I'm training my shoulders a lot.
- You can tell I'm a geek.


Strength: 8 sets of 4 repetitions, 32 seconds rest.
Hypertrophy: 4 sets of 8 repetitions, 64 seconds rest.
Endurance: 2 sets of 16 repetitions, 128 seconds rest.
Core exercises and Legs: I initially started at 20 of each, and add 1 every week. When I reach 40 reps, I go back to 25, but with a bit more weight using a medicine ball. I usually do these in order: Crunches, Back Extensions, Alternating Sit-ups, Squats, Sit-ups, Back extensions, Cycling Russian Twists, and Lunges.


Week 1 - Free Weights, Hypertrophy
Monday
Superset Chest - Triceps
Superset Shoulders - Shoulders
Core Exercises and Legs
Superset Chest - Triceps
Tuesday
Superset Back - Biceps
Superset Shoulders - Shoulders
Core Exercises and Legs
Superset Back - Biceps
Wednesday
1h - 1h15 run
Thursday
Same as monday, but slow repetitions
Friday
Same as tuesday, but slow repetitions

Week 2 - Machines, Hypertrophy
Monday
Superset Chest - Triceps
Superset Shoulders - Shoulders
Core Exercises and Legs
Superset Chest - Triceps
Tuesday
Superset Back - Biceps
Superset Shoulders - Shoulders
Core Exercises and Legs
Superset Back - Biceps
Wednesday
1h - 1h15 run
Thursday
Same as tuesday, but slow repetitions
Friday
Same as tuesday, but slow repetitions

Week 3 - Body Weight and TRX
Monday
Various types of Push-ups, Dips, TRX exercises (chest and triceps), and Core
Tuesday
Various types of Chin-ups, Inverted Row, TRX exercises (back and biceps), and Core
Wednesday
1h - 1h15 run
Thursday
Same as tuesday, but slow repetitions
Friday
Same as tuesday, but slow repetitions

Weeks 4, 5, 6
Same as week 1, 2 and 3, but Strength

Weeks 7, 8, 9
Same as week 1, 2 and 3

Weeks 10, 11, 12
Same as week 1, 2 and 3, but Endurance

I feel all this is keeping my body alert - I'm not giving it enough time to get used to anything.

I recently went to the gym with my sister on a sunday, and did some TRX with her. I was sore the next day, which prompted me to notice that maybe my body was getting too used to the same exercises over the months. That's when I added the third weeks (I'm starting next monday, actually).

2011/11/01

Archimedes and the Earth

Archimedes is quoted as saying "Give me a place to stand, and I will move the Earth".


Levers are an easy way to gain a mechanical advantage. Basically, you can lift an object by using less force, but at the cost of applying the force for a greater distance.




The distances the forces are applied are proportional to the distances to the pivot point. For example, if you want to lift an object weighing 100 Newtons (a mass of approximately 10kg) and you want to use a force of only 50N, the length of lever from your side must be twice the length on the object's side. Mathematically, 100N × d1 = 50N × d2, which gives that 2 × d1 = d2, or d1 = d2 / 2.


Somehow, Archimedes needs an immovable pivot point, and a body with some gravity for him to apply a force to his lever. Even then, he wouldn't be moving it against the normal gravity we all love, but against the gravity of the sun, which would be approximately




If we assume that the planet he is standing on has the same gravity as Earth (9.81m/s^2) and that it is so massive that the distance it's going to move back will be derisive (the two assumptions are, of course, in conflict), he would need to apply a force of 50N for a meter in order to move the Earth 1.41E-27 meters up, which is smaller than the size of an electron (in fact, it is even closer to the Plank length).


To have a better grasp of it, lets put Archimedes on an infinite plane with a gravity of 10m/s^2 (almost that of Earth), and ignore the fact that the gravity will change depending on how high he is (ie, he is somewhere with a constant gravity). He wants to lift an object weighing 6x10^25N (or 6x10^24kg, almost the mass of Earth, under a 10m/s^2 gravity) for a meter. Let's assume that Archimedes is using his whole body weight (let's say a mass of 100kg, so a weight of 1000N). How far down will he have to push his side of the lever?




That distance is more than 60 times bigger than the milky way, and all that in order to lift the Earth for one meter. I'm not even talking about how long this would take him! If he were to freefall, bringing the lever with him (let's assume a terminal velocity of 100m/s, or 360km/h), it would take him 6x10^20 seconds. That's about a thousand times the age of the universe.


This scenario brings a somewhat unrelated, but interesting concept - propagation of matter. When Archimedes starts to bring his lever down, the effect is not felt immediately at the other end. Indeed, the effect is propagated at the speed of light. In our present case, assuming that the pivot is one meter away from the Earth, it would take more than 6 million years for the Earth to start moving up. Exactly the same thing when he stops applying the force, so it would take him another 6 million years for the Earth to lift one meter.


The last image is exaggerated, but gives an idea of how it would look. An interesting thing to understand is that the lever is straight. Should it be made from unbendable metal, it would look the same.



Conclusion: *technically*, Archimedes could lift the Earth. The point here is that, given a long enough lever, you can lift a very heavy load by using a smaller force over a greater distance.