Toxic waste

The Turcot interchange is one of those awful pile-of-spaghetti places where three highways meet. To make things worse, it's also the site of a currently-abandoned rail yard. Its aesthetics are marginally redeemed by some fairly impressive graffiti, but unfortunately the concrete of the raised roadways is falling apart - literally, in chunks as large as a meter square. So the plan is to rebuild it.

As often happens when they do this sort of thing, they took some samples of the ground, and it turns out it's a horrible mess. Gasoline, diesel, motor oil, PCBs, asbestos, mercury, all it lacks is a little radioactivity and maybe some pathogens and it'd cover all the bases. This is actually not too surprising, since the site used to be a lake (now completely swallowed by urban plumbing), and in fact that whole area is polluted. The Lachine canal, which passes nearby, was opened for pleasure-boating only once it had been established that all the above nastiness was in the muck on the bottom and unlikely to be disturbed. There's a strip of parkland on one side, and on the other is what used to be some pretty sketchy housing, now being replaced by upmarket condos. What the new tenants of the condo think of the toxic waste reclamation site facing them across the canal I don't know. It just looks like a fenced-off grassy berm, with a little museum of sorts explaining how the cleanup works.

What I find most surprising about all this is the origin of the pollution. I associate pollution with heavy industry - silver mines, smelters, pulp mills. But there's none of that here in Montreal, and there never really was. In fact those tend to have their own dedicated waste treatment plants that do a pretty good job of cleaning up after them (at least here in Canada). What caused the pollution in this area seems to be largely the rail yards - a century of variously leaky and dilapidated rail cars filled with any old thing, sitting on sidings, dripping away. There's no treatment system set up for that, and so all the accumulated foulness seeps into the soil.

For the most part this sort of soil contamination in an urban setting is fairly benign - if there's no construction going on, the pollutants tend to just stay put in the soil. The one exception to watch out for is gardens. If you grow food in soil full of mercury, well, the food is liable to have alarming levels of mercury in it. Unfortunately a number of community gardens - otherwise a wonderful idea for a city of apartment-dwellers - have been found to have contaminated soil.

I grow my plants in pots.

Full post

Singularity

I'd just like to take a moment to mention I game I rather like. It's a modest game, not one you'll play a thousand times, but also not one that will take up a gigabyte of disk or require a computer that dims the lights when you turn it on.

Endgame: Singularity is a video game in which you play an university lab's AI program that accidentally escapes. Your goal is to research the technology to achieve technological singularity. Unfortunately, the humans are just a step behind you and if they find out you exist, they'll devote the world's resources to destroying you.

(Full disclosure: I wrote part of the game, namely the sunclock time/date display. It's embarrassingly inefficient, but good enough for government work. Plus it lets you find out whether it's night outside!)

Full post

Light bending


Whether or not General Relativity is the correct theory of gravity on very large scales, it has passed all tests (many pulsar-based) when applied to planetary and solar system scales. One important feature of the theory is that in a gravitational field, light follows curved trajectories (technically geodesics are "as straight as possible", but they are curved in the practical sense). In familiar settings, this means tiny but detectable effects in laboratory experiments, or small but measurable deflection of stars near the Sun. But it turns out that pulsars are small enough and massive enough that light near their surfaces is bent a great deal - enough that you can actually see almost all of the surface of the pulsar at the same time.

This may sound bizarre, and to some degree it is, but it produces potentially measurable effects. A pulsar's radio emission is produced by plasma somewhere in its magnetosphere, and in fact we're not at all sure just where the emitting plasma is. But for many pulsars, their X-ray emission comes from "hot spots" on the surface, at the magnetic poles. For young pulsars, these hot spots arise because the magnetic field in the crust makes it much easier for heat to flow out where the field is vertical than where it's at an angle. For the very old millisecond pulsars, these hot spots arise from gigantic sparks in the magnetosphere blasting the surface with high-energy particles, heating it. In either case, we sometimes see X-ray pulsations with a thermal spectrum, and light-bending can explain some of the properties of these pulsations.

I did a few very simple simulations of the light-bending, and made some illustrative videos.


I made a set of three videos illustrating this effect. For a rotating pulsar, there are a number of geometric parameters, including the angle between the line of sight and the rotation axis, the angle between the rotation axis and the magnetic axis, and the size of the hot polar cap. I fixed values for all these. There is also the question of the physical size of the pulsar: the more compact and dense it is, the more light-bending we will see. I have generated three videos. The first shows the geometry with no light bending:



Below the actual animation I have a little plot showing a pulse profile, based on a very simple model (blackbody emission from the polar cap). If I make the pulsar more compact (R=3M), I get:



And more compact still (R=2.1M):



The size of each pulsar model is given in "geometrized units", where R=2M is the size of a black hole, the most extreme possible light bending. For a 1.4 solar mass neutron star, this is 4.1 km. Realistic neutron star models vary quite a lot in radius, from ~6 km to ~24 km (~3M to ~12M), so light bending will probably not be as strong as the neutron stars depicted here.

There are other effects to consider as well; neutron stars are expected to have atmospheres, and in fact their spectra do not look like black-body spectra. The atmospheres affect these results by "limb darkening", that is, the radiation that emerges is directed more vertically than simple black-body radiation, so these pulse profiles are not really right. This can be done better, but I just wanted to write a quick hack (using the usual suspects, python, numpy, scipy, and matplotlib) and get a feel for the effect.


Full post

Statistical confusion

I was reading the recent papers on arxiv.org, preparing for our weekly neutron star discussion group, and I came across a paper that appears to be based on a statistical error. The content is not really my field, but I'm pretty sure the mathematics are a bit dubious.

The subject of the paper is MOND, "Modified Newtonian Dynamics". Newtonian gravity and general relativity seem to be excellent fits to observations in the solar system and in stronger fields, but as soon as you go to weaker fields - galaxy rotation curves or cosmology - the observations disagree with the data. The standard way to deal with this problem is to invoke some invisible massive material, so-called "dark matter", in just the amounts needed to make the data line up with the predictions of standard gravity. The idea of MOND is to point out that the problems all arise at around the same acceleration a, and to postulate that the problem is our theory of gravity.


This paper is in response to another, fairly recent one, that pointed out that there are globular clusters where the accelerations of the stars as they orbit the cluster are about a. So MOND effects should be visible there. The first paper measured radial velocities of seventeen stars in the cluster, and claimed their velocities were not consistent with MOND. This new paper claims that in fact the radial velocities are consistent with MOND.

In particular, this paper takes the collection of radial velocities and tests them against the predicted distribution with the Kolmogorov-Smirnov test. They find that the probability of obtaining a KS score this extreme is 0.36 or 0.27, and claim that "based on a KS test, which is the relevant statistical test for small samples, the currently available data are insufficient to discriminate between Newtonian gravity and MOND." There are several errors in this statement.

First of all, it is not true that the KS test is "the relevant statistical test for small samples". There are many tests applicable to small samples, and the KS test is in fact one of the weaker tests. That is, for many data sets, the KS test will report no significant difference while some other test would (correctly) report a significant difference. So the fact that the KS test does not show a significant difference doesn't mean that no test will. In particular, the authors don't even show that the previous paper's statistical test is invalid; they simply state "Given the small sample size, the formal error on the velocity dispersion is not sufficient to discriminate between various models, [...]". Maybe it is, but since neither paper gives details on how the errors on this dispersion were obtained, I find it hard to judge.

The second problem is that as far as I can tell, they misapply the KS test. The KS test tests whether a given data set is drawn from a given distribution. But the probability values it returns are correct only if the distribution is known a priori - if one has found some of the distribution's parameters by fitting to the data, one must use a different approach for calculating the p values. If one doesn't, one obtains p-values that are too high: that is, the data appears more plausible than it really is.

Just out of curiosity I retyped the data in the more recent paper. They claim that MOND predicts (under certain conditions) that the stellar velocities should be a Gaussian with a dispersion of 1.27 km/s. There are seventeen stars on their list, one of which ("star 15") is somewhat ambiguous. But a quick test shows that the population standard deviation of the sixteen good stars is 0.544 km/s; if the stellar population really has a standard deviation of 1.27 km/s, simulation shows a value this low should arise with a probability of about 0.0005: either the data is a bizarre fluke or this particular MOND prediction is wrong. (Notice that I haven't made any assumptions whatsoever on the sample size.) Including star 15 increases the spread of the observed velocities, making the probability of getting a value this low as high as 0.013, still quite strong evidence against this particular prediction of MOND.

(A quick test with scipy's implementation of the Anderson-Darling test reveals that the data are consistent with a normal distribution if you omit star 15; if you include it the data becomes less consistent, giving a probability of data this unusual between 0.05 and 0.10. This test correctly takes into account the fact that it is estimating both the mean and dispersion of the underlying normal distribution. In any case it seems unlikely the standard deviation I use above is being thrown off by bizarre outliers.)

Full post

Liquid metal


Electromagnetism is complicated. Fluid dynamics is also complicated. For a real headache, though, try working on a problem where both kinds of effect are relevant (sadly, this covers most of astrophysics). Even if you make some simplifying assumptions and get the theory of magnetohydrodynamics, you are still left with all sorts of complicated effects. Leaving aside from the much more complicated equations you might expect, magnetic fields and velocity fields define two potentially different directions at each point, meaning that you can very rarely get away with assuming spherical symmetry to get down to a one-dimensional problem. Nevertheless there are some neat phenomena that occur.

One gadget I'd like to build is a demonstration of is a fluid pump in which the only moving material is the fluid. It turns out there are simple effective designs (PDF) (some of which are in use in nuclear power plants). The biggest problem turns out to be choosing an appropriate fluid.


The basic requirement is that the fluid be conductive. A low resistivity would make the design easier, but as long as the resistivity isn't too high something can probably be arranged. So as I see it the feasible solutions are:

  1. Aqueous solution of some sort (e.g. salt water, vinegar). Unfortunately you tend to get electrochemistry happening: the current is carried by the motion of the ions, but as you add and remove electrons at the electrodes you get things like 2Cl- -> 2Cl -> Cl2, which aren't good for your electrodes or your health. You might be able to work around this with a sufficiently low voltage - as I understand it these reactions need a minimum of a volt or so to happen at any significant rate - but supplying power at such a low voltage is awkward. Apparently high frequencies work too - at tens of kilohertz or megahertz the ions don't migrate enough in any one direction to make much difference. But this means you have to use electromagnets, and moreover, electromagnets that work at those high frequencies.

  2. Mercury. Liquid metal, nice and conductive. Quite poisonous, at least in vapor form or when reacted with other things. Also very dense (so hard to get moving) and somewhat expensive per milliliter. It's really the poisonousness that's the problem.

  3. Wood's metal or "cerrobend". Melts in hot water. Contains a lot of cadmium, which is rather poisonous. Not too expensive. The gadget would need some means of heating to keep the metal liquid; for a demonstration that's meant to run for very long, this means a thermostat and safety systems.

  4. NaK. Eutectic alloy of sodium and potassium, liquid at room temperature. More reactive with water than either sodium or potassium. Non-toxic, at least in the subtle environmental sense, though even after the sodium and potassium have reacted with water you're left with concentrated hydroxides which will destroy skin. Might be possible to handle safely under clear mineral oil (but is a fire hazard if ever broken). May wet glass easily, making a sealed arrangement problematic. May be expensive.

  5. Galinstan. Eutectic alloy of gallium indium and tin. Liquid at room temperature. Not very toxic (probably safe provided you don't eat it or bathe in it, though oxide dust in the atmosphere is possibly a problem). Wets glass, so it would quickly render a container opaque. Is oxidation an issue? Expensive.


I think the way to go is with galinstan and a fairly small fountain. This conveniently lets you use little permanent "supermagnets". I'd aim for a U-shaped channel, with an electrode in the middle and on either side of the U. I'd have to figure out what voltage and current would be needed, but I could probably arrange to use a few volts at a few amps, which should be easy to get (out of a PC power supply, maybe even). The electrode material is another question - it looks like copper or aluminum would be attacked by the galinstan, but stainless steel should be okay.

Full post

Climate Change

I came across an interesting site the other day. It's videotaped lectures of a course on climate change, offered as a general science course (i.e. for non-science majors, who are required to take some number) at the University of Chicago. I'm not entirely happy with the way he handled quantum mechanics, but for the purposes of the course he does a fine job. And the later material in the course was all new to me - he talks about climate models, how you'd build one and what goes into one. The course is, quite sensibly, mostly about climate science, leaving discussions of what can be done about climate change almost entirely aside.


Full post
There was an error in this gadget