Friday, 2 November 2012

Recovery

Let's assume a disaster strikes.  You have an incredibly efficient logistics team, who have access to large ships, air freight, and helicopters capable of dropping supplies into any location needed.

Assume you pack everything in a 20' shipping container.  This gives you 33.1 m^3 of volume, and a net load of 28,200kg.  What do we need to pack into this?

  1. Water.  1 m^3 of water weighs 1000 kg, and contains 1000 liters.  Woo metric system.  ($6.20 / 12L)
  2. Food. Let's go with MREs, and this page, so a case is 12 MRE/case, which weighs 20lbs and is 16"x11.5"x10".  Metricize, and we find that 12MRE = 9.07185 kg and 0.0301522 m^3. ($60/case)
  3. Blankets. Let's get some of those space blankets.  A case of these contains 200, 0.2lb each, case size 17.5"x9"x10". ($1.35ea)  Let's do regular blankets too.  6"x6"x15", 3.6lb, $17.
  4. Other supplies.  Let's say we want to reserve 25% of the container for medical supplies/generators/communication equipment/etc.
Ok, now solve.  One person needs about 2 liters of water a day under regular circumstances.  Let's bump this to 10L/day because you're rebuilding civilizationStaten Island.  One person also requires 3 meals a day, and should probably have one space blanket and two regular blankets.  Let's bump that to four regular blankets, and assume the excess represents extra clothing, etc.  This gives us the equations:

Usage = [W, M, S, B] = [10 * D * N, 3 * D * N, 1 * N, 4 * N] 
Weight (kg)  /unit   = [1        , 0.75599  , 0.090718, 1.6329]
Volume (m^3) /unit   = [0.001    , 0.0025127, 1.2905e-4,0.008849]

W = k1 * W_w + k2 * W_m + k3 * W_s + k4 * W_b
V = k1 * V_w + k2 * V_m + k3 * V_s + k4 * V_b
N_people = k4 / 4 = k3 => 4 * k3 = k4
         = k2 / (3D) = k1 / (10D) => k2 = (3/10) k1
W = D * N * (10 * W_w + 3 * W_m) + N * (W_s + 4 * W_b)
V = [...]

[12.267970 6.622318;0.017538 0.035525] * [N * D ; N]

Ok, I come up with plausible solutions:
N  D  Weight     Volume   W / Wc W / Wm   V / Vc V / Vm

58 30 21382.3622 32.5766 [1.0110 0.7582] [1.3122 0.9842]

60 29 21383.6069 32.6476 [1.0110 0.7583] [1.3151 0.9863]
62 28 21335.7796 32.6485 [1.0088 0.7566] [1.3151 0.9864]
64 27 21238.8805 32.5793 [1.0042 0.7532] [1.3124 0.9843]
65 27 21570.7380 33.0883 [1.0199 0.7649] [1.3329 0.9996]
67 26 21412.4990 32.9314 [1.0124 0.7593] [1.3265 0.9949]
69 25 21205.1882 32.7043 [1.0026 0.7520] [1.3174 0.9880]
72 24 21243.8591 32.8635 [1.0044 0.7533] [1.3238 0.9929]
75 23 21208.9221 32.9174 [1.0028 0.7521] [1.3260 0.9945]

Where Wc and Vc are the 75% critical limits, and Wm and Vm are the absolute container limits.

How much is this going to cost?  Let's take the maximal people solution.  This means we need:
75 * 23 * 10 L of water      @ $6.20 / 12 ea = $8912.5
75 * 23 * 3  MRE             @ $60 / 12 ea   = $25875
75           space blanket   @ $1.35 / 1 ea  = $101.25
75 * 4       regular blanket @ $17   / 1 ea  = $5100
1            shipping container @ $3000 / 1ea= $3000
============================================== $42988.75


So, for something in the $50000 range, you can support 75 people for three weeks.  Ok, so we can't solve all of Staten Island's problems with these, as supporting its population of 470467, you'll need 6300 containers, at a cost of about a third of a billion dollars.  Still, this seems like the kind of thing the government could just stockpile in a few places, put them on a train towards where it looks like disaster might be happening, and drop them into place as needed.  Having a dedicated recovery unit that is ready to go anywhere at anytime, the initial recovery impact is likely to be more dramatic, providing a more efficient (and PR popular) recovery.

Tuesday, 25 September 2012

Distribution widths.


Copying comments from a source file is totally the same as writing a blog post, right? Has anyone really considered the full-width N-max of a gaussian before, and then extended that parameter to non gaussian data?  Here's how they would start, if they did:

/* Discussion on FWHM for Gaussian lines:
   Given a gaussian distribution defined by PDF = 1 / sqrt(2 * pi) * exp(-0.5 * u^2),
   then you can define a fractional max location by:
   PDF / PDF_MAX = exp(-0.5 * u^2) / exp(-0.5 * 0^2);
   PDF / PDF_MAX = exp(-0.5 * u^2)
   sqrt(-2.0 * log(R)) = u
   So, for a given ratio of the maximum R, the half-width R-max is located at u.
   This leads to the full-width R-max location being at
   FWRM = 2.0 * sqrt(-2.0 * log(R))

   Since we've used u, we can add the sigma dependence back in by noting that u = x / s:
   FWRM = 2.0 * sqrt(-2.0 * log(R)) * sigma
 
   The standard value is the FWHM, or R = 0.5:
   FWHM = 2.0 * sqrt(-2.0 * log(0.5)) = 2.0 * sqrt(2.0 * log(2.0))

   Do this for quarter max, R = 0.25:
   FWQM = 2.0 * sqrt(-2.0 * log(0.25)) = 2.0 * sqrt(2.0 * log(4))
        = 2.0 * sqrt(2.0 * 2.0 * log(2.0)) = sqrt(2) * FWHM
   And for 3/4 max, R = 0.75:
   FW3QM = 2.0 * sqrt(-2.0 * log(0.75)) = 2.0 * sqrt(2.0 * log(4/3))
         = 2.0 * sqrt(2.0 * (log(4) - log(3)))
         = 2.0 * sqrt(2.0 * (2.0 * log(2.0) - log(3)))
         =~ 0.64423 * FWHM

   If a distribution is "wingier" than a Gaussian, then FWQM will be inflated, such that
   FWQM_wingy > FWQM_Gaussian

*/

Sunday, 3 June 2012

I seem to always have trouble on my return flights from Austin.

I seem to always have trouble on my return flights from Austin.  I've been stuck in Denver and Phoenix, and I was reasonably sure that I was going to end up stuck in San Francisco as well.

I arrived at AUS with plenty of time to spare, and went through the "Premiere Line" for security, which means I get to skip over all the waiting and go directly to the driver's license check.  Yay, frequent flier benefits!

I then got pizza:
which put me behind the worst fast food orderer I've seen in a long time.  First he didn't know what pizza he wanted. Then, after choosing and moving on to pay, he decided he wanted a second slice, and asked if it could just be put into the same box.  Since a box holds one slice, that couldn't happen, so he accepted the second box.

Anyway, by the time I got to the gate, I noticed an important fact: there was no plane connected to the jetbridge.  This continued for almost an hour, until the flight came in late, leading to the second problem: there was no crew to fly the now-available plane to SFO.  I've never been able to understand how airlines can manage their logistics so poorly.  You know you have a flight at airport X at time T.  That flight requires a set of N crew members, who need to be replaced after some number of hours.  Therefore, you need some number of crew sets k = ceil(dT / H).  Not having a crew I think has been the problem in both my Denver and Phoenix flight issues.

Upon arriving at SFO, I discovered the actual reason for the delay for the flight: the airport only had one open runway, and all traffic had to use that.  I didn't know anything about this, suggesting that United didn't do a very good job of notifying travelers.  The one benefit of this was that all flights were delayed, so leaving Austin an hour late didn't decrease my layover very much.  I went to the gate, and saw what I thought was my name noting that I'd been given an upgrade to first class, as seat 3-A was listed for someone with my same first initial and first three characters of my last name.

So, using this set of data for last name frequencies, and this data for first names (assuming first initial fractions are reasonably constant over time, so I don't need to convolve an age cohort function against time variable first names), suggests that my first name is more likely than random (0.068126 compared to 1/26 = 0.038462), but that my truncated last name isn't that common (0.0024997 compared to SMI = 0.010087).  Therefore, randomly selecting from the US population gives me a upgrade name that has a probability of 1.7030e-04.  Now, confining this to a plane makes it a birthday problem, and this seat map suggests a United 757-200 has 188 seats.  This leads to a probability that someone else on the plane has the same upgrade name as me of 0.031512 (Edit: For comparison, Roger Smith has a probability of 0.10684, significantly worse than me.) This is higher than I would have thought, but since it's a birthday problem, that's pretty much always the case.  Still, this would give me a ~97% confidence that I had the upgrade to first class, meaning I would be able to count on a meal on the flight.
I had some emergency chocolate that I'd packed before leaving home, and I discovered it while sitting there.  It had a raspberry filling.
Tl;dr: I didn't get the upgrade, this flight fell into the 3.15%.

In any case, I made it home without much trouble (despite all that), and was able to get to see a really nice sunset over the Pacific Ocean:
I'm sure the clouds have a specific name too. Altocumulus?  Is that right?