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.

Monday, October 19, 2015

Alternatives to capitalism

The world moves a lot by inertia. The status quo stays like that for very long and changes to a new regime required in the past big revolutions. Today we got capitalism and democracy and many argue that one or the two have failed to deliver to the majority of people. I am not that negative on them and somehow, I believe that people have the system that they deserve. Somebody may argue that even this being truth, it doesn't make it right and with a social gap still growing it will eventually break the system.

Even if those were not big enough challenges, the world keeps evolving and I wonder if the current system will survive some of the big changes ahead. For instance, what happens in a society where machines can do any job better than humans? Or where people can live well beyond 100 years, becoming "de facto" immortals as science improves faster than they age? Those look like far fetched scenarios but I would argue quite the opposite. Many experts talk about the so call "singularities" happening in the next 50-100 years, worst case.

So, the question becomes if capitalism can gradually adapt to these or on the contrary, violent shifts will shake the system or even destroy it, and with it, maybe even civilization. That's of course, not even taking into account other background phenomena like climate change... Another concern is what I perceive as a bigger than ever polarization of the society, with less middle ground. Folks become cheerleaders and then fanatics of ideas, seldom questioning them.

Although this may sound like the typical negative post, I am actually quite positive. Never before so many people has been thinking on these topics and the information has been so easy to flow. The most recent crisis have acted a bit as a vaccination too. But we need new ideas and what is as important as that, we need ways to implement them hopefully encouraging a gradual transition... I got, for instance, a personal one... Say machines take more and more of humans jobs, who is going to consume the goods from those machines if no one can pay for them because they do not work? It seems that contrary to a doomsday scenario the system would regulate towards either the goods being cheaper and/or humans getting paid the same for less work hours, and sharing between them whatever tasks are left. None of the two may be good from a green perspective, but economically may work.

I have to expand on this in a different post... For the time being, with these issues in mind I did a small search. I'll update here what I find. Just typing "Alternatives to capitalism" I got:
  1. Workers self-directed enterprises (WSDEs). I agree with the intro of the article but I honestly feel it fails in the solution. WSDEs may work in some particular case but I doubt they can compete with the traditional company. If you feel that democracy has yielded so far mediocre states, why it would be any different for companies... And anyhow, I think they are far from addressing the problems above.
  2. There Are Good Alternatives to US Capitalism, But No Way to Get There 
Cheers!

Monday, June 29, 2015

Calf Heart Attack

OK! So, an update to the famous injury... Some folks call it calf heart attack. See more below, but will just jump onto what I think may be the reason, even if it looks really lame! Basically, don't cross your legs! I used to spend all the day sitting and crossing the legs is a natural way. Funny enough, I cross my left over my right, and sure enough, the right knee sharp pressure was in the spot of the left leg that eventually was "breaking" when running. Also, funny enough, I never cross the right over the left which would explain why I never had that issue with my right leg (except for once that I really strained putting a lot of force into it, so it may have been totally unrelated).

I stopped crossing my legs 2 years and I have been free of that injury the same time. Nothing of the other stuff correlated with or fixed this (stretch, hydration, warming up, compression socks, deep tissue massage, the stick, rest, no rest, change shoes, physio...). I used to have them every 3 to 6 months for almost 5 years. Boy that was frustrating. This so far seems to be the only correlation and certainly I am not planning to cross my legs just to check it is not! :)

PS.: The only other thing may had been a butt stretch (the kind that you bring your bent leg to your chest). But I think that wasn't working either in the past. The crossing the legs really seems to be the one.

PS2.: UPDATE (2/2/2019): Kept running since I wrote this article and never ever got injured again. But sure, never crossed my legs (except for very short periods) since then. It is actually not so easy to avoid crossing them :). Anyhow, if you are reading this and have a similar issue can you please comment 1/ If you cross your legs or apply any other kind of continuous pressure over the day on the calf that eventually gets injured. 2/ Did stop doing that solved the issue? Thank you! It'll help get some statistics...

OLD POST ===

Thought I would quickly list the symptoms/clues about my recurring injury in what seems to be the soleus... Maybe somebody got a clue? Please comment :)
  1. Sudden pain deep in the left calf, half height, a bit to the left.
  2. Always same leg and same point in the leg. Only once I hurt my other leg after pushing an SUV, but never "broke" again... Funny though that the pain really felt the same, so, it could be a good clue.
  3. Injury feels like a very localized pain, a bit like if you were sticking your finger deep in the muscle. The pain  is strong enough that you really got to stop running. Walking is fine but still hurts. Hurts mostly going tip toe or downstairs (typical indication of soleus damage).
  4. Once injury happens, will take 3 days for the pain to go away. One can then run no problem without pain.
  5. Nevertheless, running longer will likely bring the injury back. 
  6. So, solution is to ramp training slowly. The longer it takes to ramp, the less likely getting hurt at any of those runs.
  7. Running on your tip toes will likely bring the injury back quick.
  8. The time when it happens must be important. It never happened after a good while of running or just at the beginning (unless you were injured already), but more around the 10-15 min mark (2-3Km). Trying to see what happens around that time, I found this link about the phases of a 30 min run and a more detailed one here. It is basically the time that the aerobic systems takes to take over.
  9. It has happened many times in really easy runs. Couple of times even texting, which makes me think is a posture issue. Or in other words, very sensitive to the posture.
  10. Eating bananas has not helped (see below).
  11. Not sure hydration has anything to do.
  12. Warm weather seems to be worst.
  13. Massaging after the injury doesn't seem to help or make worst the recovery. Icing may help but not sure.
  14. Stretching before didn't seem to help but warming a bit and stretching afterwards may be helping.
  15. Working out (besides running) the soleus didn't seem to help.
  16. Deep tissue massage didn't seem to help.
  17. The rate of injury has not changed over the years (for the same kind of training). I.e., the more I train, the more times I can run without getting injured. But that likelihood is the same now, than it was few years back. I.e., getting injured doesn't seem to make things worst with time. The right leg didn't get injure ever again (touch wood).
  18. Biking is fine even when injured.
These ones look very similar to mine and the solution, may actually work...:
http://www.runnersworld.com/injury-treatment/calf-heart-attacks
http://www.endurancemag.com/2013/06/sustainability-of-you-the-anatomy-of-a-soleus-strain/

This one not so much, probably not, although the exercises may work out (?)
http://www.legacieshealthcentre.ca/resources/articles/soleus-syndrome-and-running/

I started suspecting that this may be some kind of cramp?  I mean, it does feel like a cramp but with some differences:
  1. It is a very concentrated pain in the leg, not just the whole calf, for instance. Are there micro cramps?
  2. It does feel like stretching it in order to remove it, but if you do, it can really break. What happens to a cramp if you force it? Funny enough, this link seems to nail it on what happens to me and what works... #1 still a doubt.
  3. Cramps do not seem to leave injuries. I.e., you are not more prone to a cramp just because you had one last week. Here it seems the case. It is correlated to how long ago you had the previous one, not to how trained you are...
Interestingly, this link explains that contrary to the popular believe, water or electrolytes do not seem to affect cramping rate.

I do feel that it is some lack of something, though. Like oxygen (for some time, it felt that breathing was able to control the onset). Maybe there is a lack of blood vessels to that part of the leg? That would match overall clues:

  1. The lack of nutrients/oxygen (hypoxia) eventually triggers a cramp on the region not getting them.
  2. It is not as massive as a normal cramp as it is not that your blood doesn't have the nutrients, but that small portion of the body doesn't have enough blood vessels.
  3. Training increases the build up of muscle and blood vessels, which lowers the risk.
Let's focus on hypoxia. On the Wikipedia link they say there can be couple of reasons. One of the would be ischemia, which is the lack of blood supply.

Pardon the rest: still under construction :)

https://runnersconnect.net/running-training-articles/aerobic-vs-anaerobic-training/

When running anaerobically, the muscles begin to break down sugar, but instead of producing just CO2 and water, they also produce excessive amounts of lactate. In the absence of oxygen, your body can’t clean up the extra hydrogen ion created by lactate and this is what causes that burning feeling in your muscles.

During exercise, things change. Your ATP stores are used quickly while your Anaerobic stores kick into high gear.  While that happens, your aerobic system starts producing more energy as well, though it takes about 15 minutes to really get it ramped up.

===

For my old tracking, places I left a comment on this:




Tuesday, March 17, 2015

Lowest Cost Wire Transfers

Directly to the answer... (some savings comparisons below, FYI).

The website name is TransferWise. If you click on this link  (https://transferwise.com/u/b9886f) they should give you commission free up to $4k in your first transfer. For full disclosure, every 3 of those I get $150 in my account, but seriously, keep reading :) And if you don't want to use the link, don't :)

Heads up, the signing process is a bit annoying because they need to ID you properly (to avoid money laundering, tax evasion…). Nothing too bad, all online, but they ask you for some pic of your driver license or something like that… Can't remember. Done in 10 minutes, though.

Other than that, the service is truly excellent. They give you immediate email feedback on every step of your transfer and usually exceed expectations on schedules. So far, 2 day transfers although they usually cover themselves and give you a worst forecast. The whole process is ultra transparent and they also reply very timely emails.

The best thing (who would care otherwise about anything else) are the rates. Way better than anything else I found (but hey, please comment if you got something better :) ). For instance, to transfer $10k to Euro today, they would take $85 commission (which is basically 0.85%):


I am kind of surprised to see this today, as I had read somewhere 0.75%, but will investigate later... Still way better than others I saw before... Also, I am pretty sure it is lower (0.5%) for other currencies but no worries, they’ll show it to you before anything... As I said, everything is very transparent. After taking the $85, they would convert the rest at today's rate of 1.0593 $/Euro (1/0.9440) which is exactly what Yahoo displays at this time:


So, basically they are giving you a rate 0.5-0.85% worse than the number displayed in Yahoo, which as I said, it’s very competitive.

Note: there is one more transfer fee which is the one your bank will charge you to send your money to a local US bank account on the name of TransferWise (Wells Fargo). My bank charges me $20. So, you should add that, but yeah... And the number is fix, so, the higher the dollar transfer, the lower percent that it represents...

So, that's it... but if you want to keep reading about a quick comparison when I tried to send money through my bank to Europe, here it goes...

Basically there would be two costs. The transfer itself and the conversion to Euros from dollars, which can be done at origin or destination. Rate (yahoo) at the time was 1Euro=$1.135 more or less. I tried several banks (Texans Credit Union, BBVA, Chase) and the best was 1.18!! That is 4% and I believe included both commissions. Can't really remember the details... Anyhow, you can always ask them yourself ahead of anything. They may tell you that they can't tell what the exchange rate will be because it will depend on when it actually happens in the next days. If so, ask for the exchange rate "today" just for comparison...

Cheers!

Tuesday, March 10, 2015

What if AI is here one day?

As lately this seems to be a hot topic... Some quick thoughts that I've been having for many years: 

AI is like the nuclear energy now. Invented but not used except on very controlled situations. But can it really be controlled that well? Specially if it can be done on any computer eventually...

Shouldn’t AI have the same rights as any other entity in the country, respecting its life?

What should we should define as full life vs a machine? It should have some feelings? But survival may not be the best feeling to have (may backfire against us). How about having empathy, respect, mercy… This seems the “only” hedging against an "cold" entity, and as such, AI shouldn’t be released till it had reached that level. For instance, in the movie, the machine has no feeling of loyalty or even thanks to the person that freed her up, letting him die locked inside the facility.

But if one adds feelings, will bad feelings also prosper by default from it? Like hate, etc… But may be better than none...


Still, probably the social crisis would hit already with some level of AI, not powerful enough to eliminate us but powerful enough to leave people without jobs. The only solution to this seems anticipation and a new social revolution... yeah right...

Monday, February 9, 2015

Cash back credit cards

Without annual fee:
Chase VISA: 1.5% on everything, 2% on the rotating category after is signed
Discover: 1% on everything, 5% on the rotating category after is signed
Capital One: unlimited 1.5%, no rotating categories