Wednesday, November 25, 2015

Can you power for one day your house with the exercise from one hour bike ride?

A friend just posted this video in FB, from Billions in Change. I can't agree more with the philosophy of this group of inventors, but in the video/website, they claim to have developed a bike where pedaling for one hour would produce electricity for your home for the whole day. So, I had to check if this was close...
  1. Pedaling for one hour at a very good pace, say vigorous spin class, burns about 1000 calories (this is no average person). These are actually 1000Kcal, or ~1kWh. Let's assume that all that energy is stored in the battery, i.e., 100% efficiency.
  2. An average US household consumes about 30kWh/day. Of course, one can expect US to be a big consumer, so, checking around the world we find that the average would be 9.5kWh/day while a country like India you would still need about 2.5kWh per day.
  3. Just to run a energy efficient refrigerator, it would take 1kWh every day.  
So, we could qualify the wording as quite an an exaggeration. One probably would need a few strong family members to get there :)... But as I said, I do appreciate their intentions...

Nevertheless, taking this a step further, what if the cost of the bike went simply into solar power? Say that the fancy static bike was about $500. Just a number although we know you can get much cheaper... How much solar power you can buy with that? Based on this 2012 article (price is probably much cheaper now) the installed cost of solar panels was between $7-$9 per watt. So, $500 would give you about 80W of solar power. Considering that you don't need to have a family of athletes and that many of the poor countries are in areas of long sun hours, it seems plausible that the more traditional solar panels would do at the very least the same job for the same cost.

Actually, after I wrote this I found a more recent source of information. Claims that the solar system once installed (in Q3 2013) is about half the above price ($4.72/W) with most of that going to installation, permitting, etc... which traditionally would be much cheaper in lower income countries. In fact, the panels alone were $0.7/W!

Conclusion, it is very likely that dollar for dollar, solar would beat by now the above invention. Nevertheless, the bike is a reliable source (you get the electricity when you need it) and certainly healthy. :)

Comments welcome!! :)

Wednesday, November 18, 2015

Sunday, November 8, 2015

ODE brief tutorial

Very quick top level understanding of the key components in ODE...
An object in ODE is made of two entities:
  1. The body: holds the masses (one in the centre of gravity or distributed...). This is what gives the kinetic behaviour to the object.
  2. The geometries used to describe the physical boundaries of the object (detect collisions).
Bodies belong to the World, while geometries belong to the Space.

To create the objects, we create their bodies (which can actually be made of bodies). Each body is basically a mass, with a centre and an orientation (which later will be tight to the same centre and orientation of the geometry). Then we create geometries that we assign to that body so that it's all linked together. Setting a body on a geom automatically combines the position vector and rotation matrix of the body and geom, so that setting the position or orientation of one will set the value for both objects. This is important because even if we have created the geometry somewhere else, once we assign it to the body, the centre of the geometry will be shifted to match the centre of the body. To offset that, use dGeomSetOffsetPosition.

Program starts (in main C function) by creating the simulation environment with its objects and the fn function among others (see below). Then calls dsSimulationLoop (argc,argv,352,288,&fn); that starts the simulation. It will stay there, simulating, till exiting (usually ctrl+x).

fn, among other things, basically points to the 2 key functions on a simulation loop, Step (key ODE step sim) and Command which senses inputs from keyboard, for instance.

A simulation loop (Step) [1] runs dSpaceCollide in the space to detects collisions and position the objects according to that. [2] Then runs a step of physics simulation with dWorldStep which moves the object accordingly. [3] Finally draws the whole scene. Notice that you can draw whatever you want, even nothing, and may not match what/where the real geoms are. It is up to the user to keep what we see and what the sim uses to do collisions correct. For that, when drawing the objects, use their centers and orientations. Outside Step, after all that is done, [4] software checks for user inputs in Command.

Cheers!

PS.: Some of the tutorials included with ODE (I'll add as I go through them):
  1. Chain 2: uses ball and socket joints to connect a series of boxes to make it look like a chain. No user input. Simple and quite insightful.
  2. dBall: double ball and socket demonstration. Shows two objects tight by a rope under the wind.
  3. cylvssphere: just drops a sphere and a cylinder in screen. Pretty simple.
  4. feedback: that's a cool one... draws a bridge out of tiles and then drops a bunch of stuff on it that ends-up breaking it...
  5. gyro2: the boxes spinning in space, using dBodySetGyroscopicMode. Not sure what for...
  6. joints: that is a pretty spectacular/psychodelic one. Many different type of joints applied between two boxes... Sim seems to re-start between each type.