A THEOREM OF ATHEORISM

Personal, Science — jrgreen @ 12:30 pm

After dinner at work last night, I met a new postdoc working down the hall from my office. I said hello, attempting to overcome my social awkwardness, and asked what type of research she does in the chemistry department. She replied “I’m an experimentalist. You, ahem, must be a theorist.” Whoa!

How in the spirit of chemistry did she know?! So I asked. She replied “I can just tell.” Baffling! Then I looked down and realized the first corollary and theorem, in my developing theory of how to not behave like a theorist (hereby termed atheorism):

Corollary 1: Chicken noodle soup shrapnel on a shirt is neither necessary nor sufficient to indicate someone is a theorist.

Theorem 1: Chicken noodle soup shrapnel on a male wearing a t-shirt that says “Visionary Women: Challenging assumptions and inspiring change” from 1993 is sufficient but not necessary to indicate the male is a theorist.

It turned out that I had forgotten to bring dining utensils with my dinner to work. Slurping Campbell’s chicken noodle soup seemed like a good idea at dinner time. Forgetfulness is also typical theorist behavior and will be a later theorem, when my sinful theorist nature catches up with me.

Sincerely,
A devoted atheorist

COMPUTER CHEMISTRY

Science — acosta @ 11:40 am

In this month’s Physics Today, there is an article called “Chemistry on the computer”. The first major quote from the article caught my eye. It comes from Auguste Comte, a natural philosopher, in 1830.

Every attempt to employ mathematical methods in the study of chemical questions must be considered profoundly irrational and contrary to the spirit of chemistry. If mathematical analysis should ever hold a prominent place in chemistry — an aberration which is happily almost impossible — it would occasion a rapid and widespread degeneration of that science.

Awesome. I don’t think that Mr. Comte would be very happy with me or a number of people here at Vdov.net.

TRAFFIC FLOWS

Science — acosta @ 2:25 pm

There has been a lot of talk on the tubes lately about the traffic flow problem, specifically a part of this problem that we’re all familiar with: complete stoppages that seem to have no explanation. Some recent links on the popularized tubes (aka, not the science tubes), seem to indicate that there has been some incredible breakthrough in our understanding on this subject. For example:

Slashdot: Scientists solve the mystery of traffic jams

This is fine and well, but unfortunately these people fail to mention the most important work on the subject which initially came from the theory of nonlinear wave equations, and was more or less solved in 1974. It was summed up in a classic text on linear and nonlinear waves so titled and written G. B. Whitham. The book is out of print but it’s around on Amazon as well as other stores and any self-respecting science library should have this book sitting on the shelves. The main problem is one of wave propagation leading to “shock fronts” in traffic. If one person brakes for no reason, shock waves develop and travel backwards (for most flow problems) relative to the moving frame of the cars. Consider a velocity function for cars as a function of the density.

V(\rho) = Q(\rho)/\rho

It’s quite simple to assume that V(\rho) must be a decreasing function of \rho which starts from some maximum value at \rho=0 and decreases to zero as \rho\rightarrow\rho_j, and the maximum density flow Q(\rho) occurs at some specific value of \rho. Guess what? Actual observations peg the value of \rho_j at about 255 vehicles per mile and the maximum flow density \rho_m at about 80 (or 1500 vehicles per hour). Amazingly these values scale in a near linear fashion as lanes are added to the flow on a simple highway. It turns out the maximum flow rate is actually achieved at about 20 miles per hour. If we then develop a simple expression for the propagation velocity:

c(\rho) = Q'(\rho) = V(\rho) + \rho V'(\rho)

Since the derivative of the velocity function is less than 0, propagation of shock waves in a traffic flow travel backwards, and according to Whitham, “warn the drives of disturbances ahead”. Unfortunately this has some pretty negative consequences for you and I, the driver, who will inevitably be fed up with random stoppages in the road for no particular reason. Whitham continues to make some elementary arguments on the status of a wave near the stoppage density of traffic on a road. It turns out that the second derivative of the density flow function Q(\rho) is less than zero, which means that a local increase of density propagates backwards, and shock forms somewhere behind the initial disturbance.

Now I’m sure that people have made some improvements in the mathematical description of this problem since the pioneering work of Whitham, but don’t be fooled: pretty much everything you read about “new developments” in this area in the popular media have been solved for more than 4 decades.

Cheers.

RAYLEIGH LIMIT FROM SIMPLE BALANCE

Science — acosta @ 2:00 pm

Yesterday in my class in finite element methods my professor took a couple of minutes to talk about a really simple derivation for both the Rayleigh limit and the Taylor limit. These limits basically are a balance between surface tension (holding the droplet in its spherical shape) and electrostatic repulsion. When the Rayleigh limit of charge is approached, the droplet tends to break up because the surface tension force is no longer strong enough to hold it together. There’s a ridiculously simple derivation of this equation that … well … should be obvious. But still, this might be simple enough for someone who reads vdov.net to actually read. The simple balance is surface tension against electric field.

\sigma/R \sim \epsilon \mathbf{E}\mathbf{E}

Where \sigma is the surface tension, R is the radius of the sphere, \epsilon is the permittivity and \mathbf{E} is the electric field. The following derivation follows simply by application of a little algebraic gymnastics and Maxwell’s equations/stress tensor (where q is the charge density and Q is the total number of charges).

\sigma/R \sim \epsilon \mathbf{E} \epsilon\mathbf{E} \epsilon^{-1}
\sigma/R \sim q^2 \epsilon^{-1}
\sigma/R \sim \left(Q/R^2\right)^2 \epsilon^{-1}

Therefore,

Q^2 \sim \epsilon \sigma R^3

This is remarkably similar to the actual Rayleigh limit (the only difference being a 64 \pi multiplier coming from the fact that this is in fact a sphere), which is given by:

Q^2 = 64 \pi \epsilon \sigma R^3

ASAT [SCIENCE, UPDATEx2!]

Discussion, Links, Politics, Science, World — afischer @ 8:08 pm

UPDATE: There has been a briefing by the Pentagon which has video of the missile launch, the “kill,” and a brief analysis. The launch occurred on time with no delays due to weather (only 2-3 foot seas). It looks like the shoot down was successful and the hydrazine tank was, in fact, destroyed along with the satellite. The collision occurred at 153 nautical miles above the Earth (~283km).
UPDATEII: Also, what do you know… it looks like there is already amateur photography of the debris field and the hydrazine trail, courtesty of Rob in Maui, Hawaii.

As many of you may know the US military is planning on shooting down a rogue spy satellite in a decaying orbit. It is designated USA-193. The satellite failed immediately after launch and was reported by amateur satellite watchers to have a decaying orbit. The official reason for shooting down the satellite rather than allowing it to deorbit on its own is that the ~5000 pound satellite contains about 1000 pounds of frozen hydrazine propellant that could potentially deorbit into parts of North America. It has been confirmed that the USS Lake Erie, a Ticonderoga class guided missile cruiser, will fire a modified SM-3 missile to intercept the satellite. This may occur sometime within a couple hours of this post, but it looks like weather might delay the shot.Debris field from Chinese ASAT test Despite assurances from the US, there has been wide speculation that the reason for shooting down the satellite is to test US anti-satellite (ASAT) capabilities, specifically as a reaction to the unannounced test by the Chinese which destroyed a weather satellite dubbed FY-1C in early 2007.
(more…)

REDISCOVERING GREAT SOFTWARE

Science, Television — acosta @ 4:43 pm

Often I’ll ditch a piece of software because it doesn’t fit my needs. Or because it’s not open source and a reasonable alternative comes along. Or because it frustrates the hell out of me. A year ago I developed all my unstructured meshes in Gmsh, which is a great little language for developing everything from very simple to very complex finite element geometries, which can then be imported (with some difficulty sometimes) into your PDE solver of choice. Or, as I’m doing in my chemical engineering class right now, you can write your own solver. Writing your own is solver is a wonderful exercise and very important, but insofar as you can use unstructured meshes, there’s really no reason to reinvent the wheel when Gmsh is so much better now than it was. There are obvious limitations to unstructured meshes for certain problems but they work very well for the types of problems I’m working on, especially because I often have absolutely no idea what the solution is going to look like for my dynamic systems. There is a nice little community around the software as well. It’s always great to find that software you initially dismissed over a year ago has totally reinvented itself and fixed all the issues you had with it previously. Regardless, check out Gmsh, even if you don’t do finite element calculations or calculations at all. It’s pretty fun to play around with.

Oh and it does a fantastic job of optimizing elements. This was done in 30 seconds on a single processor in a ~3-4 million element tetmesh, and basically completely eliminated the bottom 2 quadrants of mesh quality (the range in “mesh quality” here (I won’t explain the details), is 0 -> 1). If you can’t see it (someone who knows please explain to me why firefox on linux screws up image scaling so bad … I’m sure there is a simple solution but I definitely don’t know it), a blown up version is here.

qualplot.png

THE JERK

Science — jrgreen @ 11:00 pm

Today, I found a gap in my knowledge of basic physics. The story seemed right for my first post to vdov.net.

The first derivative of position is velocity and the second derivative of position is acceleration. What is the third derivative of position called? Hmm. I didn’t have a special purpose for this information, but I was curious. So I did some searching and found out it is called the jerk (link). I was so excited, it was as if the new phone books were here. I also found out that in the UK, the term jerk is instead sometimes referred to as jolt. Lame. [Side note: This summer I am moving to England. I will not conform.]

I shook the thermos song out my head long enough to wonder about the next derivatives. That’s right, there are more! How many of them have names? According to the physics FAQ, it has been suggested that the fourth, fifth and sixth derivatives be called snap, crackle and pop. Nothing has been proposed for higher order derivatives. The Rice Krispies terms don’t seem to have caught on. It’s a little surprising to me they haven’t. Scientists aren’t above adopting funny names or names that have funny acronyms (e.g., Proton Enhanced Nuclear Induction Spectroscopy). Do scientists hate elves? Maybe just the registered trademark variety.

That concludes my first post. I’m somebody! I’m in print! Things are going to start happening to me now.

MATLAB IS INFURIATING BUT HERE’S SOME CODE

Personal, Science, Technical — acosta @ 11:42 am

I’ve had to do a lot of work in Matlab recently, not because I want to work in Matlab or learn a new (albeit very contrived) language. The only reason is that I prefer not to rewrite huge sections of Matlab code that do a lot of the important work for me in my bioinformatics applications. Yes, I could write my own principal component engine, my own golay smoothing, my own normalizations and plotting code, my own peak discovery and alignment code, but hell … why would I do all of that, especially since this application is not particularly computationally expensive. Knowing that all these functions already exist in Matlab, I thought maybe this would be a one day project. Little did I know that Matlab totally sucks. Let me give an example. Let’s say you want to plot a bunch of points from some matrix of data, and some of those points come from group 1, some from group 2, etc. You’d think in something like Matlab this would be obvious. And indeed, at first approximation it is. In theory you just use a command ‘hold on’, which will hold the plot such that you can successively add data points to the plot and you won’t delete all the stuff you already added with the plot command. In theory this looks something like this (don’t worry about the other functions, they are hashes associated with each experiment such that the data gets plotted with groups of points correctly distinguished):

hold on;
for k = 1:numfiles
  for l = 1:numexpt
    if (isequal(char(grp(k)),expt(l).name)) pplot(l) = ...
    plot(P(k,compa),P(k,compb),plothash_a{l}, ...
    'MarkerSize',10,'MarkerEdgeColor','k','MarkerFaceColor',plothash_c{l});
    end
  end
end

Indeed, this works very well. So, let’s say instead I want to plot in 3D. So, I use the command ‘plot3′ instead of ‘plot’. Of course, one would expect this to be very simple. The part here that counts looks like:

hold on;
[...]
if (isequal(char(grp(k)),expt(l).name)) pplot(l) = …
plot3(P(k,compa),P(k,compb),P(k,compc),plothash_a{l}, …
‘MarkerSize’,10,’MarkerEdgeColor’,'k’,'MarkerFaceColor’,plothash_c{l});
[...]

Knowing that plot3 is the correct command, this produces a 2D plot only representative of the P(k,compa),P(k,compb) data segment. What the hell? So it turns out that if you hold a new plot with ‘hold on’, Matlab assumes you want a 2D plot. Then upon trying to plot in 3D, Matlab decides it is smarter than you are and that clearly your choice of a 2D plot outweighs your decision to use the ‘plot3′ command, and plots in 2D anyway without throwing an error. Why would ‘plot3′ tell me nothing??? I realize this is a pretty trivial complaint and there are plenty of other great examples of ridiculous crap in Matlab that makes no sense.

Anyway, done complaining. In a ton of data processing Matlab demos, the program asks you to important a series of files into a one data matrix, and does it with some very clumsy code that requires you to manually change the program every time you move to a new data set. Not really my style. Let’s say you have a bunch of data vectors organized in a series of directories (happens all the time), where the directories are representative of some data group that should be accessible as a unit. How about something like this:

repository = pwd;
expt = dir('*.enabled');
numexpt = size(expt,1);
for i = 1:numexpt
  repo{i} = strcat(repository,'/',expt(i).name,'/');
  file(i,:) = dir([repo{i} '*.csv']);
  num(i,:) = numel(file(i,:));
  files(i,:) = strcat(repo{i},{file(i,:).name});
end
expt = transpose(expt);
file = transpose(file);
num = transpose(num);
files = transpose(files);
numfiles = numel(files);
for k = 1:numfiles
  [X,Y(:,k)] = textread(files{k});
end

I use the transposes just because they are nice later in my code, they are certainly not required. I am no Matlab programmer, and I know some of you out there are, so any suggestions as to better file import mechanisms would be greatly appreciated. Short of that though, this is a million times better and far more general than the crap they put you through in the Matlab demos (specifically anything in the bioinformatics sections).

Cheers.

A FUN, INTERESTING, APPROACHABLE PAPER IN PRL (MICROSCALE SWIMMING)

Personal, Science — acosta @ 3:57 pm

Normally most of what I read in Phys. Rev. Lett. (PRL) is somewhat beyond the scope of vdov.net. However, two days ago there was a neat advance (arXiv here) on a very simple application of molecular dynamics to the microscale swimming problem. Microscale swimming is quite a bit different than what we associate with the swimming of people, animals and large machines. The Reynold’s number associated these types of processes are generally large (Re >> 1), whereas in a microscale swimming process the Reynold’s number of usually orders of magnitude below 1. Thus the importance of inertia in a microscale swimming process is effectively zero, the consequence of which is that a viscous-only flow is fully reversible.

In a viscous only flow, the Navier-Stokes equations are simplified as the inertial components (and therefore any time derivatives) must be zero. The standard Navier-Stokes equation for a Newtonian fluid reads as,

\rho\left(\frac{\partial\mathbf{v}}{\partial t} + \mathbf{v}\cdot\nabla\mathbf{v}\right)=-\nabla p + \rho\nabla^{2}\mathbf{v}+\mathbf{f}

This is a lot simpler than you think: the left hand side of the equation is characteristic of inertial forces, and the right hand size consists of a pressure gradient term, viscosity term and a body forces term (gravity, etc.). In the limit of very low Reynold’s number, these equations simplify to the Stokes equations, given as (neglecting any body forces),

0 = - \nabla p + \rho \nabla^2 \mathbf{v}

With continuity equation for an incompressible fluid as,

\nabla \cdot \mathbf{u} = 0

we have a relatively nice description of the problem. So what does this all mean for microscale swimming? These Stokes equation have no time dependence and the solutions to the equations are time-reversible. So, in a viscous enough fluid at relatively low velocity, swimming in the traditional sense won’t work. Any motion in one direction will be completely countered by the equal and opposite motion. So a flapping wing or paddle is pretty useless in these types of conditions. Certainly you or I couldn’t swim at low Reynold’s number. So microscale species develop inventive ways of getting around this problem. A lot of these solutions are detailed in the classic Life at Low Reynold’s Number (I found a free link to the paper … AIP would like to charge you for it). There are many methods of solution to the Stokes equations, the details of which I will certainly not discuss here. If you want to know more about some of the more interesting ones (Boundary Element, Streamfunction or Green’s Function methods), take a graduate class in numerical methods or fluid dynamics.

This is all great and good. What the paper in PRL has done is simply apply a reasonable molecular dynamics (MD) approach to the power and efficiency of these problems. It’s an extremely simple application of MD to a pretty easily understood phenomena, and therefore perhaps appropriate here on vdov.net. In the paper, they investigate various biological and microbiotic designs (such as biflaps motion, flagellum, legs and snaking motion), and extract infomation about the power vs. efficiency of each design. This information has some pretty important ramifications, some of which might include some interesting work on the efficiency of microscale therapeutics. The paper is extremely easy to read and the majority of the conclusions drawn should be understandable to the reader without any simulation or fluids experience.

Why then, you might ask, would I care about any of this? Well it turns out this type of fluid to molecular reduction is precisely what I am trying to do to study the collisions of droplets in a spray or on a surface. The problem specification in my situation is perhaps more involved and I certainly won’t detail it here, but this is a wonderful example on how MD and computational fluids can talk to each other. Secondly, I’m looking to put more science on the vdov.net front page, and this paper seemed like a nice place to start. All of you current or future PhDs out there are welcome/encouraged to post anything interesting at any time.

Cheers.

SIMPLE LINUX, UBUNTU, LINUS & COMPIZ

Personal, Science, Technical — acosta @ 9:05 pm

Quite a title eh? Well this is sort of a random stream-of-consciousness kind of post. So be prepared. But this place was getting a little dull recently so I thought I’d rehash some of the things I’ve done to my machines recently and perhaps review them a bit. So here goes.

I think I read (though I can’t seem to find the reference anywhere) an interview with Linus Torvalds recently in which he said something like the following (if you know the reference feel free to let me know, I’m pretty sure it was on Kernel Trap this year sometime):

I don’t use Debian or any other ‘low-level’ Linux flavors because I feel like Linux should be easy to use and manageable for day-to-day work, etc.

Those of you that know me well probably know that I have made nothing short of a career in the past 3 years going exactly in the opposite direction here. Recently however, I decided to take the plunge for a number of reasons. They are briefly: 1) I’ve got way too many machines to take care of these days, 2) I love Debian but on laptops I find it a bit annoying to have to configure dynamic things every time I move and 3) Recently I screwed up a bunch of my machines and decided it was time to reinstall them, 4) Being ridiculously OCD I needed to have all my machines running the same software and they all basically need to look the same. Lastly, and definitely most importantly, Ion3 was really having trouble running a lot of the software I needed to run, including Fluent (ANSYS), Gambit, Matlab, etc. So all these things together, along with my acquisition of a brand new laptop, made me decide to take the plunge and reinstall all my machines with … (drum-roll), 64-bit Ubuntu.

Generally I’m pretty happy with my choice. I loved the Ion3 window manager and Debian in general, but Ubuntu is basically Debian with some fancy crap built on top of it. So the backend is basically the same. Plus the update cycle is way better in Ubuntu … well, at least faster. As far as using Gnome, I’m not completely sold yet. I sort of like it … I guess, and I’m getting used to it. But I do miss the simplicity of Ion3. I don’t, however, miss configuring everything manually in Debian for my laptop or the huge number of problems I had with applications really not liking the Ion3 windowing model.

Oddly, Ubuntu Gusty’s (7.10) compositing window manager (Compiz Fusion 0.52) is pretty annoying. There are really no real benefits to it so far as I can tell, other than Aero/Aqua-type effects. And there are plenty of annoyances. As I first got back to reinstalling my systems, basically everything that didn’t work with Ion3 well also didn’t work with Compiz, so I had to disable it out of the box on all of my machines. Annoying.

Alec turned me on to ‘unison’ as a nice little remote folder syncing utility, which is quite wonderful. I use it now to sync my document tree between my 3 work machines (work laptop, work desktop and home desktop). It’s designed for just 2 machines but it works equally well with 3.

I also got a nice new laptop recently, a Dell Latitude D430, which is their ultra-portable business machine. I’ve used it extensively already and generally I’m quite happy with it. Ubuntu runs great on it — I haven’t really been able to detect even the slightest hitch yet — it’s got fantastic battery life and the performance sacrifices due to ultra-portability and long battery life really don’t affect me in the slightest. It’s really going to be brilliant to be able to work on a plane or while traveling, not to mention when I just need to get out of lab for any number of reasons (there are lots of them).

I’m not sure I have much else to say. Lots of real work to get done since my OP is over, as my boss wants to publish pretty soon and I really don’t have enough yet done to do that. Hopefully I’ll be writing paper #2 in February. I doubt anyone will really care about this post but it’s here for you if you like; I had to write something, this place is dead. Hey you … write something for vdov.

Cheers.

OP DONE, I’M A DOCTORAL CANDIDATE [UPDATED]

Personal, Science — acosta @ 11:23 pm

After having spent the vast majority of the last 2 months working on my OP and defense, it’s finally over, and I passed just fine with no corrections. Dare I say the defense was even, well, fun. Therefore, I’m finally, officially, a doctoral candidate. All that’s left for me between now and my Ph.D. is, well … almost everything important. At least everything important to my own research and career in the future. Of course in the grand scheme of things this is far more stressful but at least Purdue seems to think I’m worthy of a Ph.D. At some point I’ll put up my slides/paper on my personal page. Cheers.

I put up my OP paper. You can take a look at it here.

DU BOIS LEMMA

Science — acosta @ 8:28 am

I used something in my course on continuum mechanics last week that was pretty interesting, and I only now realize I’ve used it all the time without ever thinking about it. It is the so-called “Du Bois-Reymond Lemma”, and it goes something like: if an integral formula equals zero and is a continuous indefinite integral, then the integrand must vanish. It’s so ridiculously simple and yet I never actually thought about it before. This is particularly useful when, for instance, deriving the equation of continuity from the mass conservation form of the Reynold’s Transport Theorem.

\frac{d}{dt}\iiint_{V(t)}f(\mathbf{x},t)dV = \iiint_{V(t)} \left[\frac{\partial f}{\partial t} + \nabla\cdot\left(f\mathbf{v}\right)\right]dV

Apply to mass conservation by,

\iiint_{V(t)}\rho(\mathbf{x},t)dV = m
\frac{dm}{dt} = 0

And we have,

0 = \iiint_V \left[\frac{d\rho}{dt} + \rho\left(\nabla\cdot\mathbf{v}\right)\right]dV

Therefore the equation of continuity is simply,

\frac{\partial \rho}{\partial t} + \nabla\cdot(\rho\mathbf{v}) = 0

Fun. Cheers.

Next Page »
vdov.net is an anthony costa production. ownership of the content provided is retained by the author and by vdov.net.