Monday, July 21, 2014

RFID Shielding

Got a new employee id card today - which is also the RFID card that gets us through the door sensors - and a new ecoPass - the pass that gets us on the local buses for free.  The latter used to be just a sticker that went on the former, but the buses are moving to RFID as well, so now its a card.  Obviously, they conflict with one another; while the ecoPass is in my wallet, the id card won't open doors.

Googled round a bit about RFID interference and shielding, and ended up trying a piece cut out of the back of a Coke can - cut it a couple of mm too big in every direction and fold the edges over to avoid sharp bits.  With this between the two cards, one side of my wallet (the id side) now opens doors again.  I assume the ecoPass should work from the other side of my wallet, though I haven't tested that yet.


As you can see from the back shot, I eyeballed the dimensions and got it too short to cover the complete back of the card; this doesn't appear to matter.

Friday, May 16, 2014

Pounding the Pavement

Sent this in to Randall at xkcd for his What-If column (Randall - on the very long odds that you like my question _and_ end up hitting this obscure little auto-blog; no peeking!)

Which exerts more pressure on the roadway; 200-pound me on my 30-pound mountain bike, or the 6-million-pound crawler-transport (that used to be) used to take the space shuttle to launch?

On my way to work this morning, I distractedly rode my mountain bike across some reasonably-fresh asphalt.  I worried whether I might have left a mark.  This got me thinking about the relative pressure - in the real sense; per unit-area - exerted by me and my bike.  I may be light compared to, say, a car, but the contact patches of my tires are pretty miniscule.

Several sources suggest the pressure exerted on the ground by a tire should be exactly equal to the pressure in the tire, but fail to back this up with experimental evidence.  This http://www.performancesimulations.com/fact-or-fiction-tires-1.htm refutes that and does site evidence, so I'll do it the hard way.

This was useful for contact patch sizes for mountain bikes: http://bansheebikes.blogspot.com/2013/11/wheel-size-facts-part-3-contact-patch.html.  Ends up about 4.19 in^2.  Those calculations are for ~32 PSI in the tires, which seems ludicrously low to me, but they're probably talking about dirt-track riding - I rarely get off the pavement anymore, and keep mine up around 60 PSI.  But, it also finds pretty tiny amounts of variation, so I'll hope that doesn't skew it too much (and in any case higher PSI would _decrease_ the size of my contact patches, and therefore _increase_ the pressure on the pavement.)  I weigh about 200 lbs, and my bike weighs about 30 lbs, so 230 lbs / 4.19 in^2 =~ 54.89 PSI.  (Which is actually pretty close to my tire pressure, but that's probably coincidence given the contact patch size was estimated using a different pressure.)

This http://airandspace.si.edu/collections/artifact.cfm?object=nasm_A19730875000 give me the dimensions of a single tread on one of the tracks of the crawler: 90" x 25" x 18".  Height should be the shortest, so I'm going with 2250 in^2 of contact patch.  This http://en.wikipedia.org/wiki/Crawler-transporter says it has 4 tracks with 57 treads each, but the photo down the bottom shows 33 in the air, so 24 on the ground at a time per track.  24 x 4 x 2250 = 216,000 in^2 of contact patch.  It also lists the curb weight at 5,999,000 lbs (I do _not_ weigh 6 million pounds!  How dare you!) leaving us with 27.77 PSI.  Me and my bike are pushing nearly twice as hard.

(Of course, in an ideal mathematical model the contact patches of a tire would be infinitesimally small at the point of first contact - they're bigger because either the tire or the road surface deforms.  I'm pretty sure I know which deforms most easily in the cases of: a rubber air-filled tire, asphalt, and metal treads.)

I wonder how big the contact patches are on my rollerblades?

Monday, April 15, 2013

Oribitals

How big should you make a ring-shaped orbital to get a 24-hour day?

Centrifugal acceleration a = v^2 / r

9.8 m / s^2 = v^2 / r

v = 1 rev / day = 2 * pi * r / 86400 s

9.8 m / s^2 = (2 * pi * r / 86400 s) ^ 2  / r

 = 5.289 * 10 ^ -9 * r

r = 1,853,078,528.45 m =~1.85 million km.

Yep, Banks got it about right.

Friday, December 14, 2012

This is the first time I've seen anyone make this connection in a scientific fashion. Check the research is solid before repeating it. http://www.newscientist.com/article/dn17922-carrying-a-gun-increases-risk-of-getting-shot-and-killed.html

Sunday, October 28, 2012

Cones

Geekin out the maths, and might actually have a use for this again someday.  How to custom-design a piece of a cone, to step a cylinder of one size down to another.

I want to step a cylinder of radius r1 down to a new radius r2 over a distance of d.  This is a section "trimmed" off the top edge of a cone, so the trick is to first describe the cone.  The height of the full cone (h1), the length of its side (s1), and the radius of the larger disk (r1) form a right triangle.  Next describe the smaller cone we're cutting off the tip of the larger.  The height of the offcut (h2), the length of its side, and the radius of the smaller disk (r2) also form a right triangle.  The angle between the height and the side in each of these triangles must be identical.  The tangent of that angle is the ratio of the radius over the height, and it also must be identical between the two triangles, so r1/h1 = r2/h2.  r1 and r2 were given, and h1 = h2 + d, so we solve for h2:

r1*h2 = r2*h1
h2 = r2/r1*(h2+d)
h2*(1-r2/r1) = r2/r1*d
h2 = r2/r1*d/(1-r2/r1)
h2 = d*r2/(r1-r2)

To draw a template for this cone on flat paper we need a circular sector.  The radius of this sector is the length of the side of the cone, which is just the hypoteneuse of the first triangle we described above: s1 = (r1^2 + h1^2)^(1/2).  The angle of the sector - effectively, the proportion of a whole disk we use - we can find from the fact that the outer circumference of the sector (not including the "pie cuts") must be equal to the circumference of the base of the cone, which is the disk with r1 from way back in the problem definition.  So portion of the disk to use is the ratio of (2*pi*r1)/(2*pi*s1), or simply r1/s1.

So in my case I want to go from a diameter of 5/8" to 3/8" in the course of 3/8".  To make life easier, I'll do everything in 16ths.
r1 = 5
r2 = 3
d = 6
h2 = 6*3/(5-3) = 9
h1 = 15
s1 = (5^2 + 15^2)^(1/2) = 15.81
s2 = (3^2 + 9^2)^(1/2) = 9.49
And I want 5/15.81 = 31.62% or 113.84 degrees.


But OpenOffice Draw is not a CAD program, and it won't let me specify the number of degrees in a sector.  *grumble*.  So subtracting 90 for the orientation, I get sin(23.84) = 0.40, and draw the sector out til its 1.40 inches long with a radius of 1.

(And confirmed by the "print-it-out-and-build-it method...)

Sunday, April 8, 2012

multi-dimensional hash slices in Perl

I've tripped over this enough times that you'd think I'd remember it by now, but I never do. And looking up the answer on google always seems to take me an age. So, in keeping with the title of this blog, I shall squirrel it away here in hopes that I'll remember to look here first next time...

I love slices in perl. They're brilliant. But they really don't quite do what you wish they'd do if you're trying to take a slice in the first dimension of a multi-dimensional hash. So if I've got:

%thing = ( "A" => [ "A0","A1","A2","A3" ],
"B" => ["B0","B1","B2","B3"],
"C" => ["C0","C1","C2","C3"]
);

I can happily slice up the last dimension on a constant "column" of the first:

print join ", ", @{$thing{B}}[1..2], "\n";

I can't do the reverse:

# doesn't work
#print join ", ", @thing{B..C}[1], "\n";

There are a couple of ways around this, some of which only work in certain circumstances:

print join ", ", ( map {$_->[1]} @thing{B..C} ), "\n";

works for output, but you don't have a ref to the original object anymore, so you can't change it. So while:

foreach ( @{$thing{B}}[1..2] ) {
s/B/E/;
}

Does what you'd expect - changes the values in B1 and B2:

foreach ( map {$_->[1]} @thing{B..C} ) {
s/1/4/;
}

...doesn't do the equivalent. Instead you need something like:

foreach ( B..C ) {
$thing{$_}[1] =~ s/1/4/;
}

(All of which seems pretty trivial from those examples, but when you try to do something complicated then being able to do all the referencing in the foreach parameter, and just work with $_ inside makes the code a LOT easier to read...)

Tuesday, January 31, 2012

Weej

They say only the good die young. Well that's shit, but I wish it were true.

Weej was brilliant, and wicked, and magnificent, and big-hearted, and conniving, and mischievous, and brilliant. And never in his life was he anything as bland and pedestrian as merely "good". Oatmeal is "good". Weej was chipotle-marinated spare ribs with garlic-truffle-oil potato mash, a glass of Shiraz, and a double espresso to follow. And probably one of those horrible smoke-sticks of his too. Weej could fill an empty room with a grin.

I read about other people dealing with death, and many say they find comfort in the idea of a god. I'd never dream of taking away anyone's solace at a time like this even if I could - so I'll hide this self-absorbed rant away on this backwater blog where it won't bother anyone. But I've got to get it out. I want to scream it from a rooftop. How could this make you want to worship a god? I want to _invent_ one, just so I can hunt the fucker down and kick his lily-white arse! If I actually believed one was real I'm not sure I could stop myself from writing "Yeah? Well Fuck You Too!" on the side of a mountain in 40-foot letters made of burning bibles. Keep your fucker of a god; I want my friend back.