Thursday, March 21, 2013

Shoe monument for man who threw footwear at Bush

http://www.reuters.com/article/2009/01/30/us-iraq-shoe-odd-idUSTRE50T54M20090130

The video is so good.  It was probably the peak of Bush's presidency.  He dodged it like he had been training his entire life for that moment.

https://www.youtube.com/watch?v=_RFH7C3vkK4

Thursday, March 14, 2013

Errors from Rounding Pi

In honor of Pi Day, I did some calculations on the error introduced by rounding pi.  This has been done plenty of times already, but it was fun.

The key point is that rather crude approximations are still plenty accurate.  Just using 3 only leads to a 4.5% error, and the common 3.14 is good for 0.05%, which is a better tolerance than anything you're likely to do.

I also list the absolute errors when calculating circumferences of circles with various radii.  If you are calculating a circle with a radius of the observable universe, you'll need about 62 digits (first calculated in 1699) to get the error below 1 Planck length.  That ought to be enough for anybody.


 Relative error:
DigitsValueError
134.5070342%
23.11.3239353%
33.140.0506958%
43.142-0.0129662%
53.1416-0.0002338%
63.141590.0000845%
73.141593-0.0000110%
83.1415927-0.0000015%
93.141592650.0000001%
103.1415926540.0000000%

Absolute error in calculating the circumference of a circle with the given radius:
DigitsMeterMileEarthAstronomical UnitLight YearGalaxyObservable Universe
128.32 cm0.46 km1,804.17 km42,363,900 km17,908.56 AU14,159.27 ly3,993.87 Mpc
28.32 cm133.87 m529.97 km12,444,300 km5,260.62 AU4,159.27 ly1,173.19 Mpc
33.19 mm5.13 m20.29 km476,500 km201.44 AU159.27 ly44.92 Mpc
40.81 mm1.31 m5.19 km121,900 km51.52 AU40.73 ly11.49 Mpc
514.69 µm2.36 cm93.61 m2,198.01 km0.93 AU0.73 ly675,900 ly
65.31 µm0.85 cm33.81 m793.94 km50,208,700 km16,781.23 AU244,100 ly
70.69 µm1.11 mm4.41 m103.64 km6,554,400 km2,190.69 AU31,869.74 ly
892.82 nm149.38 µm0.59 m13.89 km878,100 km293.5 AU4,269.74 ly
97.18 nm11.55 µm4.57 cm1.07 km67,922.68 km22.7 AU330.26 ly
100.82 nm1.32 µm0.52 cm122.73 m7,761.55 km2.59 AU37.74 ly
1120.41 pm32.85 nm130.05 µm3.05 m193.12 km9,656,100 km0.94 ly
120.41 pm0.67 nm2.63 µm6.19 cm3.91 km195,600 km1,202.95 AU
130.41 pm0.67 nm2.63 µm6.19 cm3.91 km195,600 km1,202.95 AU
1413.52 fm21.76 pm86.16 nm2.02 mm127.94 m6,396.77 km39.34 AU
156.48 fm10.42 pm41.26 nm0.97 mm61.28 m3,063.76 km18.84 AU
160.48 fm0.77 pm3.04 nm71.35 µm4.51 m225.6 km1.39 AU
1776,925,300 ym123.8 fm0.49 nm11.51 µm0.73 m36.39 km33,476,700 km
183,074,700 ym4.95 fm19.59 pm0.46 µm2.91 cm1.45 km1,338,100 km
19925,300 ym1.49 fm5.9 pm138.42 nm0.88 cm0.44 km402,700 km
2074,713.23 ym120,239,000 ym0.48 pm11.18 nm0.71 mm35.34 m32,514.03 km
215,286.77 ym8,508,200 ym33.68 fm0.79 nm50.02 µm2.5 m2,300.72 km
22713.23 ym1,147,800 ym4.54 fm106.7 pm6.75 µm33.74 cm310.39 km
2386.77 ym139,600 ym0.55 fm12.98 pm0.82 µm4.1 cm37.76 km
246.77 ym10,889.69 ym43,109,700 ym1.01 pm64.02 nm3.2 mm2.94 km
250.77 ym1,233.65 ym4,883,700 ym114.68 fm7.25 nm362.6 µm333.59 m
262,069,113,700 pl53.82 ym213,100 ym5 fm316.37 pm15.82 µm14.55 m
27405,829,100 pl10.56 ym41,787.43 ym0.98 fm62.05 pm3.1 µm2.85 m
2834,587,700 pl0.9 ym3,561.43 ym83,626,100 ym5.29 pm264.42 nm24.33 cm
292,536,500 pl4,082,025,600 pl261.17 ym6,132,600 ym0.39 pm19.39 nm1.78 cm
3061,516.66 pl99,001,200 pl6.33 ym148,700 ym9.41 fm0.47 nm0.43 mm
3161,516.66 pl99,001,200 pl6.33 ym148,700 ym9.41 fm0.47 nm0.43 mm
32356.91 pl574,400 pl2,273,880,900 pl862.94 ym54,572,100 ym2.73 pm2.51 µm
33356.91 pl574,400 pl2,273,880,900 pl862.94 ym54,572,100 ym2.73 pm2.51 µm
3414.33 pl23,062.27 pl91,298,100 pl34.65 ym2,191,100 ym109.56 fm100.79 nm
351.96 pl3,147.15 pl12,458,800 pl4.73 ym299,000 ym14.95 fm13.75 nm
360.52 pl835.87 pl3,309,000 pl1.26 ym79,414.88 ym3.97 fm3.65 nm
370.02 pl39.27 pl155,400 pl3,650,060,700 pl3,730.65 ym186,532,700 ym171.61 pm
380 pl0.56 pl2,231.63 pl52,401,000 pl53.56 ym2,677,900 ym2.46 pm
390 pl0.56 pl2,231.63 pl52,401,000 pl53.56 ym2,677,900 ym2.46 pm
400 pl0.03 pl133.55 pl3,136,000 pl3.21 ym160,300 ym147.44 fm
410 pl0.01 pl24.13 pl566,500 pl0.58 ym28,949.81 ym26.63 fm
420 pl0 pl0.47 pl11,118.95 pl703,159,600 pl568.22 ym0.52 fm
430 pl0 pl0.31 pl7,393.36 pl467,553,800 pl377.83 ym347,603,600 ym
440 pl0 pl0 pl11.57 pl731,600 pl0.59 ym543,900 ym
450 pl0 pl0 pl11.57 pl731,600 pl0.59 ym543,900 ym
460 pl0 pl0 pl6.94 pl439,100 pl21,957,068,900 pl326,500 ym
470 pl0 pl0 pl0.46 pl29,143.95 pl1,457,197,300 pl21,667.11 ym
480 pl0 pl0 pl0.09 pl5,729.68 pl286,484,000 pl4,259.74 ym
490 pl0 pl0 pl0 pl123.89 pl6,194,300 pl92.1 ym
500 pl0 pl0 pl0 pl6.81 pl340,700 pl5.07 ym
510 pl0 pl0 pl0 pl4.89 pl244,600 pl3.64 ym
520 pl0 pl0 pl0 pl0.21 pl10,479.35 pl9,641,002,700 pl
530 pl0 pl0 pl0 pl0.02 pl1,227.78 pl1,129,559,800 pl
540 pl0 pl0 pl0 pl0 pl57.07 pl52,503,500 pl
550 pl0 pl0 pl0 pl0 pl1.47 pl1,349,300 pl
560 pl0 pl0 pl0 pl0 pl1.47 pl1,349,300 pl
570 pl0 pl0 pl0 pl0 pl0.29 pl266,300 pl
580 pl0 pl0 pl0 pl0 pl0 pl2,983.86 pl
590 pl0 pl0 pl0 pl0 pl0 pl2,401.42 pl
600 pl0 pl0 pl0 pl0 pl0 pl247.31 pl
610 pl0 pl0 pl0 pl0 pl0 pl21.96 pl
620 pl0 pl0 pl0 pl0 pl0 pl0.41 pl
630 pl0 pl0 pl0 pl0 pl0 pl0.12 pl
640 pl0 pl0 pl0 pl0 pl0 pl0.02 pl
650 pl0 pl0 pl0 pl0 pl0 pl0 pl

Wednesday, March 13, 2013

Project Prevention

Project Prevention says their main goal is to promote awareness of the dangers of using drugs during pregnancy. They are better known, however, for paying drug addicts cash for volunteering for long-term birth control, including sterilization. The organization offers US$300 (£200 in the UK) to each participant. The New York Times reports that the organization initially offered more money to women who chose tubal ligations and men who chose vasectomies than to those who chose long-term birth control like intrauterine devices, but criticism forced them to adopt a flat rate. To receive the money, clients have to show evidence they have been arrested on a drug-related offence, or provide a doctor's certificate saying they use drugs, and further evidence is needed confirming that the birth-control procedure has taken place. The organization keeps statistics on its activities through survey forms that all participants fill out, before any procedure is completed. As of August 2011 based on survey forms from 3,848 clients it had paid: 1,996 (51.9%) were Caucasian; 956 (24.8%) African American; 484 (12.6%) Hispanic; 412 (10.7%) other.

Sunday, March 10, 2013

How Long to Freeze in Space

A common Sci-Fi trope is a ship losing power and the crew slowly freezing to death.  I decided to do some calculations to see how long this would take to happen.  This turns out to be pretty hard to actually do, mainly due to the large number of unknowns.

In the vacuum of space, only one of the three types of heat transfer applies: radiation.  The formula for heat output of a body is:
`P = {dE}/{dt} = epsilon sigma A (T^4 - T_a^4)`
Where: P is power in watts, E is energy in Joules, t is time in seconds, A is surface area in square meters, and T is temperature of the object, `T_a` is ambient temperature in Kelvin.  `sigma` is a constant which is `5.67 times 10^-8 {"w"}/{"m"^2 "K"}`.  `epsilon` is the emissivity of the object, which ranges from 0-1. 

The energy contained by an object is given by:
`E = mCT`
Where E is energy, m is mass, C is specific heat, and T is temperature.  If you're going to do any calculations be careful with specific heat, as it is usually given in J/(g K), not J/(kg K).

Luckily, it's pretty easy to estimate just with a spreadsheet.  We can put each degree from say 70F to 32F and use the first formula to find the heat power output (the change between each degree is less than 1%).  That output is just in joules per second.  We can find the total heat energy of an object at a given temperature in joules.  Then you can find how long it will take to drop one degree.

However, I wanted to to solve it algebraically and get a general formula.  I played around with making a differential equation of these for a while.  Eventually I came up with a solution that ignores the ambient temperature (which at 3K in space is pretty ignorable).

Take the derivative with respect to time of the heat energy:
`{dE}/{dt} = mC {dT}/{dt}`

Now note that we already have a formula for `{dE}/{dt}` (and ignore the ambient temperature):
`epsilon sigma A T^4 = mC {dT}/{dt}`

Now we have one of those separable differential equations all the kids are always talking about:
`int {mC}/{epsilon sigma A} {dT}/{T^4} = int dt`

Evaluating the definite integral gives the formula:
`t(T_f) = {- m C}/{3 cdot A sigma epsilon}(1/T_0^3 - 1/T_f^3)`
Where: `T_0` is initial temperature, and `T_f` is final temperature, both in Kelvin.

Four of the above variables need to be estimated.  To give some idea how accurate the estimates are, all the variables are liner.  This means if you double one it'll double the time (or half it).  Most of the variables are hard to estimate to within even an order of magnitude.  The formula also mainly serves as a worst case estimate.

Being near a star would add enough heat that the problem could be over heating (indeed it is for the ISS).  As noted on that page, our current spacecraft have mylar insulating layers which reduce the effective emissivity to 0.03.  This increases the cooling time by a factor of 33 over what one would assume with a simple dull paint.

The formula also assumes the object is of uniform material and temperature.  In reality the specific heat of materials varies quite a bit.  Most metals are < 0.5, compared to water at 4.2.  It's probably fair to assume most the thermal mass comes from the metal in the ship, so I've used 0.5 in my estimates.

The formula also ignores the fact that as the outside of the ship cools heat must be transfered from the interior (via conduction and convection) before it can radiate into space.  This slows the process down more, by an amount that I don't even want to estimate.  If the ship is designed to passively hold heat (which seems like it might be a good idea), it could easily be several orders of magnitude.

Mass and surface area of a fictional ship are pretty hard to estimate, to say the least.  I got my estimates from the infamous Star Trek vs Star Wars site.  If you think the estimates are wrong, feel free to head over there and start an argument about it.

Finally, it's also worth noting here these all assume there is no internal power generated.  The power output of the runabout is about 150 kW.  Anything generating power inside would subtract from that rate and increase the time to freeze.  A human body only gives off about 100 watts each, and lights would probably be around 1 kW max.  So, it would seem that in a situation where a small ship loses all power, freezing to death would be a serious concern.  Of course humans can survive temperatures well below freezing.  It would seem like a good idea to equip small ships with survival suits with an internal power source.

The time it takes to go from 70F to 0F varies from hours to months.  The general trend is larger the object the longer it takes.  A human body would only take a few hours.  A small ship (runabout, max crew: 15) could be anywhere from 12 hours to a couple weeks.  A large ship (galaxy class, crew: about 1200) would take months to years.

I made a table with some estimates, keep in mind these are probably underestimates.  I used 0F as the final temp because I think it's reasonable for a clothed human to survive down to that.


NameLength (m)CrewSurface Area (`"m"^2`)Metric TonsTime 70F to 0F
Death Star II160,0002,500,00080,400,000,0001,500,000,000,000,0001199 years
Super Star Destroyer17,600300,000201,911,0008,322,000,0002.65 years
Borg Cube3,036130,00055,325,23560,000,000,00070 years
Enterprise-D6421,200524,74210,200,0001.25 years
Enterprise310430145,9011,000,000161 days
Runabout2382,0821,00011.3 days
Type 6 Shuttlecraft62925012.8 days
TIE Fighter61190617.8 hours
Naked Human211.800.0900.96 hours (98.6F to 84F)

Sunday, March 3, 2013