Search This Blog

Sunday, January 20, 2013

A UsefulChem Update from 2006-2013 (a little out of date)


Automation components in UsefulChem


This page describes the evolution of software tools which process the usefulchem-molecules blog into a variety of useful formats, e.g., spreadsheets, RSS feeds, and CML for molecular visualization/manipulation tools such as Jmol, as well as adding additional chemical information (InChIs, MWs, supplier info) for the molecules in the UsefulChem project. I will also discuss the on-going development of an automated RSS feed reader for extracting and performing further processing this chemical information, and potential future work in these areas. For more information on this work, and to follow new developments, please refer to my blog entries at http://usefulchem.blogspot.com.

Initial work with Excel / Excel VBA:

Molecule entries in http://usefulchem-molecules.blogspot.com are characterized primarily by a UC number (e.g., UC0188), a SMILES notation, and an image, although other information, such as CAS number, is often added. To summarize and expand on this data in a convenient format, a program in Microsoft Excel Visual Basic for Applications (VBA) (http://showme.physics.drexel.edu/usefulchem/Software/MoleculeBlogInfo/MoleculeBlogInfo.zip) was developed which downloads this page, parses out the desired information, and generates a spreadsheet (http://showme.physics.drexel.edu/usefulchem/Software/MoleculeBlogInfo/usefulchem-molecules/usefulchem-molecules.xls) in which each row represents one blog entry. Given that the blog format itself is rather loose – for example, the SMILES entry might be prefixed by “SMILES” or “SMILES:” – and can change over time, the search criteria for fields were made fully configurable by placing them in an initialization (.ini) file.

Additional information beyond that provided by the blog, such as links to suppliers, were desired, and for this purpose several different freely available software packages and libraries were used. Molecular weight information and molecular format files (CML, MOL) were generated from the SMILES using the CDK Java libraries, while InChI descriptors were produced by OpenBabel. Image files were at first generated using ChemSketch, although these are now simply downloaded directly from the blog itself. Supplier information was acquired by sending HTTP GET requests to chmoogle.com (now eMolecules.com), and processing the responses gleaned from this service.

In addition to the spreadsheet, this software also creates HTML and CML files (e. g., http://showme.physics.drexel.edu/usefulchem/Software/MoleculeBlogInfo/usefulchem-molecules/UC0088.htm) for each blog entry, which in combination allow the molecules in the blog to be viewed with the Jmol applet.

 
RSS feeds and Automation Software in Java:

The spreadsheet format for the usefulchem-molecules blog was a useful beginning. It was, however, not very amenable to automated data processing or other kinds of display desired, particularly for the internet/web. An initial attempt to address these deficiencies involved modifying the Excel VBA software to generate an RSS 1.0 feed (http://showme.physics.drexel.edu/usefulchem/Software/MoleculeBlogInfo/usefulchem-molecules/usefulchem-molecules.rss) of the blog data in addition to its other output. The advantage to having the data in a feed is that can then be viewed using any number of available desktop or web-based readers, such as RSS Bandit (http://www.rssbandit.org) or Bloglines (http://www.bloglines.com). Furthermore, as RSS is simply XML, feeds can contain other XML formatted data, such as Chemical Markup Language (CML). Thus, a feed can be downloaded and parsed for its CML by software such as Bioclipse (http://www.bioclipse.net) or Jmol (http://jmol.sourceforge.net).

A shortcoming of using Excel VBA is that it does not easily lend itself to automation. Also, it is neither truly an open source development platform nor portable to other operating systems such as Unix or Macintosh. Therefore, to address these shortcomings, I rewrote the VBA code in the Java programming language, which is both free (see http://java.sun.com/javase/downloads/index.jsp to download the Java Development Kit) and is implemented on all major operating systems. Once in Java, it was straightforward to set the software up as an service to be run periodically. As a result, the RSS feed and associated files are now regenerated automatically whenever additions or changes are made the usefulchem-molecules blog.

A zip file containing both the source and compiled code for the Java software to convert the usefulchem-molecules blog to an RSS feed can be found at http://showme.physics.drexel.edu/usefulchem/Software/Java/MoleculeBlogInfo/MoleculeBlogInfo.zip.


CMLRSSReader:

Having an RSS feed with special fields provides a launching platform of essentially unlimited opportunities for further treatment of chemical information. Standard RSS readers, however, rarely display little more the and several other standard fields in a feed. Furthermore, they are not extendable or configurable to include additional processing via plug-ins or “hook” programs on a feed, its entries, or the various specialized fields it can contain. Thus, a specialized reader seemed necessary.

Writing a simple feed reader is actually not a particularly difficult software project, and there is a lot of help available in books and web sites (I used “RSS and Atom Programming” from Wrox books (Wrox.com) as a guide for all my RSS programming). I have developed such a reader, again using Java, which begins to address some of our specialized requirements for feeds containing CML and other chemical information. This reader and associated software, which can be downloaded from http://showme.physics.drexel.edu/usefulchem/Software/Java/CMLRSSReader/CMLRSSReader.zip, is still at an early stage in development and can currently handle only RSS 1.0 feeds (and so far has only been tested on the usefulchem-molecules and two other closely related feeds), but demonstrates some of what can be done along lines described above. In addition to the standard reader features of automatically downloading and managing multiple feeds, displaying information contained their item entries, and as tracking new or changed items, the software also allows specialized programs to be executed on the feeds themselves and their contents. In its current form, programs can be configured to run after feed file download and/or processing. These programs can be written in any language, even DOS BAT files (although Java must be used on processed feeds, as they are stored via Java serialization), and can perform any processing/reporting desired, such as calculations using the CML in the feed, internet searches, database entry, and/or e-mailing results to the interested parties.

Two examples of this capability are already being used to automatically generate and upload information for display on the web. One, ExtractHTMLPages, is a Java program that parses the usefulchem-molecules feed file for its item fields and generates an HTML file for each item. ExtractHTMLPages also generates an index file (http://showme.physics.drexel.edu/usefulchem/Software/MoleculeBlogInfo/usefulchem-molecules/Items/UsefulChemistryMolecules.html) of the item HTML files which, using a combination of JavaScript and HTML iframes, allows any of them to be selected for viewing from a drop-down list. When CMLRSSReader downloads a feed, which it does whenever the feed has been updated (which in the case of usefulchem-molecules, occurs whenever the blog is updated), it automatically runs ExtractHTMLPages, generating and uploading all of these files to the web server.

The other example, ExtractNewItems, is a Java program which works with processed feeds to record and detail changes to the feed. When new items are added to the usefulchem-molecules feed, or new information about an item is added or modified, ExtractNewItems generates and uploads two files: newItems.html (http://showme.physics.drexel.edu/usefulchem/Software/MoleculeBlogInfo/usefulchem-molecules/newItems.html) and newItems.xls. True to their names, these files list items that have been added or updated since the last time the program was run. Ultimately, the reason for a new listing will also be given, such as new supplier information, but this is not currently implemented.

Future Directions:

Quite a bit of ground has been covered, and a lot of evolution occurred, since the initial work with Excel VBA. A certain amount of consolidation and strategic consideration would seem to be worthwhile at this point. To begin, the numerous web sites and pages generated would benefit from some organization. This can be done with a single page, or small set of pages, providing links to and descriptions of the various software tools and the pages they generate.

Second, although I have tried to make the CML RSS reader software highly flexible, it needs to be tested for compatibility with other RSS 1.0 feeds containing CML if it is to become of general use to the scientific community. Additional development is almost certainly going to be needed here (no one should expect to be that lucky!). I am also eager to see how the reader might interact with other software, such as Bioclipse, for example in providing CML and other data in automated fashion. This should prove fruitful, as Bioclipse obviously provides so much more in the way of processing and visualization tools than the reader itself. Other enhancements include a replacement for Java’s JEditorPane for displaying item data (JEditorPane’s handling of HTML is fairly primitive), other improvements to the user interface, and more configurable program extensions and/or plug-ins.

Finally, a lot of technologies have yet to be explored in this area. One excellent candidate is the combination of Ajax in HTML pages with chemical information web services. Ajax provides the ability to dynamically query web sites and services without the overhead in time and resources of retransmitting/reloading entire pages. In conjunction with JavaScript events and dynamic HTML, this can essentially turn an ordinary browser into a full-featured software user interface. Ajax also appears quite easy to use. For some simple examples of what can be done with Ajax, see http://showme.physics.drexel.edu/usefulchem/Software/Ajax/UsefulChemistryMolecules/UsefulChemistryMolecules.htm and http://showme.physics.drexel.edu/usefulchem/Software/Ajax/UsefulChemistryMolecules/UsefulChemistryMolecules2.htm (simply hover over any of the UC numbers).

Also, I have just begun to learn about OpenOffice, and hope to convert the Excel applications into them.

Some More Belated JCAMP Work for UsefulChem

Blog Text I have developed a Java package to decompress NMR data taken from our Bruker instrument and stored in JCAMP format.  This software was adapted from Robert Lancashire's jspecview program, specifically the JDXCompressor.java and Coordinate.java classes.  It reads a set of compressed JCAMP NMR files according to a configuration file with the following format: the program's output is a BLOCK JCAMP file, in this case output.jdx, containing the decompressed data from the input files.  Right now only a few of the header fields are retained, those needed for plotting the spectra via Excel VBA software (work in progress!).  An example of this can be downloaded here.

SA expert pushes asteroid mining

SA expert pushes asteroid mining

2012-10-12 14:34
Ron Olivier of SIP wants SA to develop a space mining programme. (Duncan Alfreds, News24)
Ron Olivier of SIP wants SA to develop a space mining programme. (Duncan Alfreds, News24)

kalahari.com



Cape Town - In the future, South African mining companies may become space firms, if a local engineer has his way.

Engineer Ron Olivier is pushing for SA to develop a space mining programme that will either exploit raw materials on the Moon or on Near Earth Objects (NEOs) like asteroids.

The idea holds promise because of the capacity developed when SA built a satellite and launched it into space, he said.

"It came from expertise; it came from my time at SunSpace where we built spacecraft out of basically nothing and reasonably successfully so," Olivier of Shamayan Innovation Partnerships (SIP) told News24.

His presentation at the SA Space Association Congress in Cape Town proposed that a mission to mine NEOs could "produce the largest economic benefit" to the country since the discovery of gold and diamonds.

Extraterrestrial mining

Olivier suggests that partnerships with countries in the Brics could jumpstart a programme to mine asteroids of at least 1km and rich in mineral resources.

The idea may not be as far-fetched as Google's Larry Page and director James Cameron have backed a company called Planetary Resources to mine asteroids.

Some think that NEOs contain high levels of iron ore, platinum, nickel and zinc and that if it could be extracted efficiently, may present a business model to conduct extraterrestrial mining activities.

Olivier suggested that a space port similar to the International Space Station (ISS) could be used to launch missions to asteroids.

"We may want to use an ISS type of organism out there, and then exploit that and launch from there. At the moment the ISS exists and it's been shown to be possible - that you can do that, but it will take a couple of billion to construct that.

In his presentation, Olivier suggested that a 1km asteroid can deliver $150bn in platinum value at current prices and if a re-usable vehicle could be developed to be cost-effective, it made a space mining programme viable within a decade.

"Most probably closer to 10 years than 50 years: Number one, South Africa has immense innovation in the industrialisation of Earth-bound mining machinery," he said.

Partnerships

Unlike Planetary Resources that plans to send astronauts to mine asteroids, SIP intends unmanned robots to do the work.

"The automation is restricted in this country because of our requirements to provide a tremendous amount of jobs to people. No such restrictions are out there in outer space.

"You don't need to transport miners to outer space to go and mine there; in fact, it would be stupid to do so. You have to take machines there and necessity is the mother of all invention," said Olivier.

He proposes partnerships with experts in various disciplines to reduce costs and secure funding.

"What I have suggested here is a purely commercial outlook with some government funding on the side of it. But nothing like funding that whole project. It's a commercial venture."

The idea may seem a bit out of this world, but Olivier said that once the programme was up and running companies would back it.

"SIP is at the stage where it needs quite a bit of funding just in order for me to get around, so we're starting off at zero base. And this is the thing that makes it even crazier to the normal mind, but at the SunSat programme we started at zero base as well."

Olivier challenged South African companies to consider that such a project would be viable as the cost of resources escalate.

"I'm going to say to the companies: 'Either come in, or be left out.'"


- Follow Duncan on Twitter

NASA Funding

Have discovered the recent comments on PENNY4NASA:

Penny4NASA was founded to uphold the importance of Space Exploration and Science. We believe wholeheartedly that our federal funding of the National Aeronautics and Space Administration, at a wimpy 0.48% of the total, does not reflect the hugely important economical, technological and inspirational resource that this agency has been throughout its 50+ year history. With approximately $10 coming back into the economy for every $1 spent, thousands of new science and engineering students becoming inspired continuously, and the multitude of technologies that NASA research has both directly and indirectly made possible, we believe that NASA needs to be funded at a level of at least 1% of the US federal budget. This isn’t a partisan argument, and this isn’t a fiscal budget argument. What this is, is the American people saying that as a society, we want our tax dollars to reflect the importance of science and space exploration. And 0.48% doesn’t cut it. We are calling for NASA budget to be increased to at least 1% of the US annual budget.

I wrote the following the PA congressmen:

Today at 12:44pm
Support Doubling Funding for NASA and the Future Priorities of U.S. Involvement in Space
Dear Representative:
I support Doubling Funding for NASA and the Future Priorities of U.S. Involvement in Space because with even one percent of the federal budget allocated toward NASA, we could essentially half the time of developing space technology and the serious scientific and economic benefits that would result from it; e.g., mining ores & minerals from asteroids would greatly reduce pollution here on Earth. We would all, as well, and not just Americans, finally perceive a future worth working toward, a future which would help us overcome the problems of nations and cultures competing with each other. Thank you.

Wednesday, January 16, 2013

Chapter Two of the Third row


The Idiot’s Guide to Making Atoms

Avagadro’s Number and Moles

Writing this chapter has reminded me of the opening of a story by a well-known science fiction author (whose name, needless to say, I can’t recall): “This is a warning, the only one you’ll get so don’t take it lightly.” Alice in Wonderland or “We’re not in Kansas anymore” also pop into mind. What I mean by this is that I could find no way of writing it without requiring the reader to put his thinking (and imagining) cap on. So: be prepared.

A few things about science in general before I plunge headlong into the subject I’m going to cover. I have already mentioned the way science is a step-by-step, often even torturous, process of discovering facts, running experiments, making observations, thinking about them, and so on; a slow but steady accumulation of knowledge and theory which gradually reveals to us the way nature works, as well as why. But there is more to science than this. This more has to do with the concept, or hope I might say, of trying to understand things like the universe as a whole, or things as tiny as atoms, or geological time, or events that happen over exceedingly short times scales, like billionths of a second. I say hope because in dealing with such things, we are extremely removed from reality as we deal with it every day, in the normal course of our lives.

The problem is that, when dealing with such extremes, we find that most of our normal ideas and expectations – our intuitive, “common sense”, feeling grasp of reality – all too frequently starts to break down. There is of course good reason why this should be, and is, so. Our intuitions and common sense reasoning have been sculpted by our evolution – I will resist the temptation to say designed, although that often feels to be the case, for, ironically, the same reasons – to grasp and deal with ordinary events over ordinary scales of time and space. Our minds are not well endowed with the ability to intuitively understand nature’s extremes, which is why these extremes so often seem counter-intuitive and even absurd to us.

Take, as one of the best examples I know of this, biological evolution, a lá Darwin. As the English biologist and author Richard Dawkins has noted several times in his books, one of the reasons so many people have a hard time accepting Darwinian evolution is the extremely long time scale over which it occurs, time scales in the millions of years and more. None of us can intuitively grasp a million years; we can’t even grasp, for that matter, a thousand years, which is one-thousandth of a million. As a result, the claim that something like a mouse can evolve into something like an elephant feels “obviously” false. But that feeling is precisely what we should ignore in evaluating the possibility of such events, because we cannot have any such feeling for the exceedingly long time span it would take. Rather, we have to evaluate the likelihood using evidence and hard logic; commonsense can seriously mislead us.

The same is true for nature on the scale of the extremely small. When we start poking around in this territory, around with things like atoms and sub-atomic particles, we find ourselves in a world which bears little resemblance to the one we are used to. I am going to try various ways of giving you a sense of how the ultra-tiny works, but I know in advance that no matter what I do I am still going to be presenting concepts and ideas that seem, if anything, more outlandish than Darwinian evolution; ideas and concepts that might, no, probably will, leave your head spinning. If it is any comfort, they often leave my mind spinning as well. And again, the only reason to accept them is that they pass the scientific tests of requiring evidence and passing the muster of logic and reason; but they will often seem preposterous, nevertheless.

First, however, let’s try to grab hold of just how tiny the world we are about to enter is. Remember Avogadro’s number, the number of a mole of anything, from the last chapter? The reason we need such an enormous number when dealing with atoms is that they are so mind-overwhelmingly small. When I say mind-overwhelmingly, I really mean it. A good illustration of just how small that I enjoy is to compare the number of atoms in a glass of water to the number of glasses of water in all the oceans on our planet. As incredible as it sounds, the ratio of the former to the latter is around 10,000 to 1. This means that if you fill a glass with water, walk down to the seashore, pour the water into the ocean and wait long enough for it to disperse evenly throughout all the oceans (if anyone has managed to calculate how long this would take, please let me know), then dip your now empty glass into the sea and re-fill it, you will have scooped up some ten thousand of the original atoms that it contained. Another good way of stressing the smallness of atoms is to note that every time you breathe in you are inhaling some of the atoms that some historical figure – say Benjamin Franklin or Muhammad – breathed in his lifetime. Or maybe just in one of their breaths; I can’t remember which – that’s how hard to grasp just how small they are.

One reason all this matters is that nature in general does not demonstrate the property that physicists and mathematicians call “scale invariance.” Scale invariance simply means that, if you take an object or a system of objects, you can increase its size up to as large as you want, or decrease it down, and its various properties and behaviors will not change. Some interesting systems that do possess scale invariance are found among the mathematical entities called fractals: no matter how much you enlarge or shrink these fractals, their patterns repeat themselves over and over ad infinitum without change. A good example of this is the Koch snowflake:

which is just a set of repeating triangles, to as much depth as you want. There are a number of physical systems that have scale invariance as well, but, as I just said, in general this is not true. For example, going back to the mouse and the elephant, you could not scale the former up to the size of the latter and let it out to frolic in the African savannah with the other animals; our supermouse’s proportionately tiny legs, for one thing, would not be strong enough to lift it from the ground. Making flies human sized, or vice-versa, run into similar kinds of problems (a fly can walk on walls and ceilings because it is so small that electrostatic forces dominate its behavior far more than gravity).


Scale Invariance – Why it Matters

One natural phenomenon that we know lacks scale invariance, we met in the last chapter is matter itself. We know now that you cannot take a piece of matter, a nugget of gold for example, and keep cutting it into smaller and smaller pieces, and so on until the end of time. Eventually we reach the scale of individual gold atoms, and then even smaller, into the electrons, protons, and neutrons that comprise the atoms, all of which are much different things than the nugget we started out with. I hardly need to say that all elements, and all their varied combinations, up to stars and galaxies and larger, including even the entire universe, suffer the same fate. I should add, for the sake of completeness, that we cannot go in the opposite direction either; as we move toward increasingly more massive objects, their behavior is more and more dominated by the field equations of Einstein’s general relativity, which alters the space and time around and inside them to a more and more significant degree.

Why do I take the time to mention all this? Because we are en route to explaining how atoms, electrons and all, are built up and how they behave, and we need to understand that what goes on in nature at these scales is very different than what we are accustomed to, and that if we cannot adopt our thinking to these different behaviors we are going to find it very tough, actually impossible, sledding, indeed.

In my previous book, Wondering About, I out of necessity gave a very rough picture of the world of atoms and electrons, and how that picture helped explained the various chemical and biological behaviors that a number of atoms (mostly carbon) displayed. I say “of necessity” because I didn’t, in that book, want to mire the reader in a morass of details and physics and equations which weren’t needed to explain the things I was trying to explain in a chapter or two. But here, in a book largely dedicated to chemistry, I think the sledding is worth it, even necessary, even if we do still have to make some dashes around trees and skirt the edges of ponds and creeks, and so forth.

Actually, it seems to me that there are two approaches to this field, the field of quantum mechanics, the world we are about to enter, and how it applies to chemistry. One is to simply present the details, as if out of a cook book: so we are presented our various dishes of, first, classical mechanics, then the LaGrangian equation of motion and Hamiltonium operators and so forth, followed by Schrödinger’s various equations and Heisenberg’s matrix approach, with eigenvectors and eigenvalues, and all sorts of stuff that one can bury one’s head into and never come up for air. Incidentally, if you do want to summon your courage and take the plunge, a very good book to start with is Melvin Hanna’s Quantum Mechanics in Chemistry, of which I possess the third edition, and go perusing through from time to time when I am in the mood for such fodder.

The problem with this approach is that, although it cuts straight to the chase, it leaves out the historical development of quantum mechanics, which, I believe, is needed if we are to understand why and how physicists came to present us with such a peculiar view of reality. They had very good reasons for doing so, and yet the development of modern quantum mechanical theory is something that took several decades to mature and is still in some respects an unfinished body of work. Again, this is largely because some it its premises and findings are at odds with what we would intuitively expect about the world (another is that the math can be very difficult). These are premises and findings such as the quantitization of energy and other properties to discrete values in very small systems such as atoms. Then there is Heisenberg’s famous though still largely misunderstood uncertainly principle (and how the latter leads to the former).


Talking About Light and its Nature

A good way of launching this discussion is to begin with light, or, more precisely, electromagnetic radiation. What do I mean by these polysyllabic words? Sticking with the historical approach, the phenomena of electricity and magnetism had been intensely studied in the 1800s by people like Faraday and Gauss and Ørsted, among others. The culmination of all this brilliant theoretical and experimental work was summarized by the Scottish physicist James Clerk Maxwell, who in 1865 published a set of eight equations describing the relationships between the two phenomena and all that had been discovered about them. These equations were then further condensed down into four and placed in one of their modern forms in 1884 by Oliver Heaviside. One version of these equations is (if you are a fan of partial differential equations):





 
Don’t worry if you don’t understand this symbolism (most of it I don’t). The important part here is that the equations predict the existence of electromagnetic waves propagating through free space at the speed of light; waves rather like water waves on the open ocean albeit different in important respects. Maxwell at once realized that light must be just such a wave, but, more importantly, that there must be a theoretically infinite number of such waves, each with different wavelengths ranging from the very longest, what we now call radio waves, to the shortest, or gamma rays. An example of such a wave is illustrated below:



To assist you in understanding this wave, look at just one component of it, the oscillating electric field, or the part that is going up and down. For those not familiar with the idea of an electric (or magnetic) field, simply take a bar magnet, set it on a piece of paper, and sprinkle iron filings around it. You will discover, to your pleasure I’m certain, that the filings quickly align themselves according to the following pattern:


The pattern literally traces out the, in this case, magnetic field of the bar magnet, but we could have used an electrically charged source to produce a somewhat different pattern. The point is, the field makes the iron filings move into their respective positions; furthermore, if we were to move the magnet back and forth or side to side the filings would continuously move with it to assume their desired places. This happens because the outermost electrons in the filings (which, in addition to carrying an electric charge, also behave as very tiny magnets) are basically free to orient themselves anyway they want, so they respond to the bar’s field with gusto, in the same way a compass needle responds to Earth’s magnetic field. If we were using an electric dipole it would be the electric properties of the filings’ electrons performing the trick, but the two phenomena are highly interrelated.

Go back to the previous figure, of the electromagnetic wave. The wave is a combination of oscillating electric and magnetic fields, at right angles (90°) to each other, propagating through space. Now, imagine this wave passing through a wire made of copper or any other metal. Hopefully you can perceive by now that, if the wave is within a certain frequency range, it will cause the electrons in the wire’s atoms to start spinning around and gyrating in order to accommodate the changing electric and magnetic fields, just as you saw with the iron filings and the bar magnet. Not only would they do that, but the resulting electron motions could be picked up by the right kinds of electronic gizmos, transistors and capacitators and resistors and the like – here, we have just explained the basic working principle of radio transmission and receiving, assuming the wire is the antenna. Not bad for a few paragraphs of reading.

This sounds all very nice and neat, yet it is but our first foot into the door of what leads to modern quantum theory. The reason for this is that this pat, pretty perception of light as a wave just didn’t jibe with some other phenomena scientists were trying to explain at the end of the nineteenth century / beginning of the twentieth century. The main such phenomena along these lines which quantum thinking solved were the puzzles of the so-called “blackbody” radiation spectrum and the photo-electric effect.


Blackbody Radiation and the Photo-electric Effect

If you take an object, say, the tungsten filament of the familiar incandescent light bulb, and start pumping energy into it, not only will its temperature rise but at some point it will begin to emit visible light: first a dull red, then brighter red, then orange, then yellow – the filament eventually glows with a brilliant white light, meaning all of the colors of the visible spectrum are present in more or less equal amounts, illuminating the room in which we switched the light on. Even before it starts to visibly glow, the filament emits infrared radiation, which consist of longer wavelengths than visible red, and is outside our range of vision. It does so in progressively greater and greater amounts and shorter and shorter wavelengths, until the red light region and above is finally reached. At not much higher temperatures the filament melts, or at least breaks at one of its ends (which is why it is made from tungsten, the metal with the highest melting point), breaking the electric current and causing us to replace the bulb.

The filament is a blackbody in the sense that, to a first approximation, it completely absorbs all radiation poured onto it, and so its electromagnetic spectrum depends only on its temperature and not any on properties of its physical or chemical composition. Other such objects which are blackbodies include the sun and stars, and even our own bodies – if you could see into right region of the infrared range of radiation, we would all be glowing. A set of five blackbody electromagnetic spectra are illustrated below:


Examine these spectra, the colored curves, carefully. They all start out at zero on the left which is the shortest end of the temperature, or wavelength (λ, a Greek letter which is pronounced lambda) scale; the height of the curves then quickly rises to a maximum λ at a certain temperature, followed by a gradual decline at progressively lower temperatures until they are basically back at zero again. What is pertinent to the discussion here is that, if we were living around 1900, all these spectra would be experimental; it was not possible then, using the physical laws and equations known at the end of the 1800s, to explain or predict them theoretically. Instead, from the laws of physics as known then, the predicted spectra would simply keep increasing as λ grew shorter / temperature grew higher, resulting it what was called “the ultraviolet catastrophe.”

Another, seemingly altogether different, phenomenon that could not be explained using classical physics principles was the so-called photoelectric effect. The general idea is simple enough: if you shine enough light of the right wavelength or shorter onto certain metals – the alkali metals, including sodium and potassium, show this effect the strongest – electrons will be ejected from the metal, which can then be easily detected:


This illustration not only shows the effect but also the problem 19’th century physicists had explaining it. There are three different light rays shown striking the potassium plate: red at a wavelength of 700 nanometers or nm (an nm is a billionth of a meter), green at 550 nm, and purple at 400 nm. Note that the red light fails to eject any electrons at all, while the green and purple rays eject only one electron, with the purple electron escaping with a higher velocity, meaning higher energy, than the green.

The reason this is so difficult to explain with the physics of the 1800’s is that physics then defined the energy of all waves using both the wave’s amplitude, which is the distance from crest or highest point to trough or lowest point, in combination with the wavelength (the shorter the wavelength the more waves can strike within a given time). This is something you can easily appreciate by walking into the ocean until the water is up to your chest; both the higher the waves are and the faster they hit you, the harder it is to stay on your feet.

Why don’t the electrons in the potassium plate above react in the same way? If light behaved as a classical wave it should not only be the wavelength but the intensity or brightness (assuming this is the equivalent of amplitude) that determines how many electrons are ejected and with what velocity. But this is not what we see: e.g., no matter how much red light, of what intensity, we shine on the plate no electrons are emitted at all, while for green and purple light only the shortening of the wavelength in and of itself increases the energy of the ejected electrons, once again, regardless of intensity. In fact, increasing the intensity only increases the number of escaping electrons, assuming any escape at all, not their velocity. All in all, a very strange situation, which, as I said, had physicists scratching their heads all over at the end of the 1800s.

The answers to these puzzles, and several others, comes back to the point I made earlier about nature not being scale invariant. These conundrums were simply insolvable until scientists began to think of things like atoms and electrons and light waves as being quite unlike anything they were used to on the larger scale of human beings and the world as we perceive it. Using such an approach, the two men who cracked the blackbody spectrum problem and the photoelectric effect, Max Planck and Albert Einstein, did so by discarding the concept of light being a classical wave and instead, as Newton had insisted two hundred years earlier, thought of it as a particle, a particle which came to be called a photon. But they also did not allude to the photon as a classical particle either but as a particle with a wavelength; furthermore, that the energy E of this particle was described, or quantized, by the equation


in which c was the speed of light, λ the photon’s wavelength, and h was Planck’s constant, the latter of which is equal to 6.626 × 10-34 joules seconds – please note the extremely small value of this number. In contrast to our earlier, classical description of waves, the amplitude is to be found nowhere in the equation; only the wavelength, or frequency, of the photon determines its energy.

If you are starting to feel a little dizzy at this point in the story, don’t worry; you are in good company. A particle with a wavelength? Or, conversely, a wave that acts like a particle even if only under certain circumstances? A wavicle? Trying to wrap your mind around such a concept is like awakening from a strange dream in which bizarre things, only vaguely remembered, happened. And the only justification of this dream world is that it made sense of what was being seen in the laboratories of those who studied these phenomena. Max Planck, for example, was able, using this definition, to develop an equation which correctly predicted the shapes of blackbody spectra at all possible temperature ranges. And Einstein elegantly showed how it solved the mystery of the photoelectric effect: it took a minimum energy to eject an electron from a metal atom, an energy dictated by the wavelength of the incoming photon; the velocity or kinetic energy of the emitted electron came solely from the residual energy of the photon after the ejection. The number of electrons freed this way was simply equal to the number of the photons that showered down on the metal, or the light’s intensity. It all fit perfectly. The world of the quantum had made its first secure foot prints in the field of physics.
There was much, much more to come.

The Quantum and the Atom

Another phenomena that scientists couldn’t explain until the concept of the quantum came along around 1900-1905 was the atom itself. Part of the reason for this is that, as I have said, atoms were not widely accepted as real, physical entities until electrons and radioactivity were discovered by people like the Curies and J. J. Thompson, Rutherford performed his experiments with alpha particles, and Einstein did his work on Brownian motion and the photo-electric effect (the results of which he published in 1905, the same year he published his papers on special relativity and the E = mc2 equivalence of mass and energy in the same year, all at the tender age of twenty-six!). Another part is that, even if accepted, physics through the end of the 1800s simply could not explain how atoms could be stable entities.

The problem with the atomic structure became apparent in 1911, when Rutherford published his “solar system” model, in which a tiny, positively charged nucleus (again, neutrons were not discovered until 1932 so at the time physicists only knew about the atomic masses of elements) was surrounded by orbiting electrons, in much the same way as the planets orbit the sun. The snag with this rather intuitive model involved – here we go both with not trusting intuition and nature not being scale invariant again – something physicists had known for some time about charged particles.

When a charged particle changes direction, it will emit electromagnetic radiation and thereby lose energy. Orbiting electrons are electrons which are constantly changing direction and so, theoretically, should lose their energy and fall into the nucleus in a tiny fraction of a second (the same is true with planets orbiting a sun, but it takes many trillions of years for it to happen). It appeared that the Rutherford model, although still commonly evoked today, suffered from a lethal flaw.

And yet this model was compelling enough that there ought to be some means of rescuing it from its fate. That means was published two years later, in 1913, by Niels Bohr, possibly behind Einstein the most influential physicist of the twentieth century. Bohr’s insight was to take Planck’s and Einstein’s idea of the quantitization of light and apply it to the electrons’ orbits. It was a magnificent synthesis of scientific thinking; I cannot resist inserting here Jacob Bronowski’s description of Bohr’s idea, from his book The Ascent of Man:

Now in a sense, of course, Bohr’s task was easy. He had the Rutherford atom in one hand, he had the quantum in the other. What was there so wonderful about a young man of twenty-seven in 1913 putting the two together and making the modern image of the atom? Nothing but the wonderful, visible thought-process: nothing but the effort of synthesis. And the idea of seeking support for it in the one place where it could be found: the fingerprint of the atom, namely the spectrum in which its behavior becomes visible to us, looking at it from outside.

Reading this reminds me of another feature of atoms I have yet to mention. Just as blackbodies emit a spectrum of radiation, one based purely on their temperature, so did the different atoms have their own spectra. But the latter had the twist that, instead of being continuous, they consisted of a series a sharp lines and were not temperature dependent but were invoked usually by electric discharges into a mass of the atoms. The best known of these spectra, and the one shown below, is that of atomic hydrogen (atomic because hydrogen usually exists as diatomic molecules, H2, but the electric discharge also dissociates the molecules into discrete atoms):


This is the visible part of the hydrogen atom spectrum, or so-called Balmer series, in which there are four distinct lines: from right to left, the red one at 656 nanometers (nm), the blue-green at 486 nm, the blue-violet at 434 nm, and the violet at 410 nm.

Bohr’s dual challenge was explain both why the atom, in this case hydrogen, the simplest of atoms, didn’t wind down like a spinning top as classical physics predicted, and why its spectrum consisted of these sharp lines instead of being continuous as the energy is lost. As said, he accomplished both tasks by invoking quantum ideas. His reasoning was more or less as this: the planets in their paths around the sun can potentially occupy any orbit, in the same continuous fashion we have learned to expect from the world at large. As we now might begin to suspect however, this is not true for the electrons “orbiting” (I put this in quotes because we shall see that this is not actually the case) the nucleus. Indeed, this is the key concept which solves the puzzle of atomic structure, and which allowed scientists and other people to finally breathe freely while they accepted the reality of atoms.

Bohr kept the basic solar system model, but modified it by saying that there was not a continuous series of orbits the electrons could occupy but instead a set of discrete ones, in-between which there was a kind of no man’s land where electrons could never enter. Without going into details you can see how, at one stroke, this solved the riddle of the line spectra of atoms: each spectral line represented the transition of an electron from a higher orbit (more energy) to a lower one (less energy). For example, the 656 nm red line in the Balmer spectrum of hydrogen is caused by an electron dropping from orbit level three to orbit level two:


Here again we see the magical formula , the energy of the emitted photon, in this case being equal to E, the difference in energy between the two orbits. Incidentally, if the electron falls further inward, from orbit level two to orbit level one – this is what is known as the Lyman series, in this case accompanied by a photon emission of 122 nm, well into the ultraviolet and invisible to our visual systems. Likewise, falls to level three from above, the so-called Paschen series, occur in the equally invisible infrared spectrum. There is also a level four, five, six … potentially out to infinity. It was the discovery of these and other series which confirmed Bohr’s model and in part earned him the Nobel Prize in physics in 1932.

This is fundamentally the way science works. Inexplicable features of reality are solved, step by step, sweat drop by tear drop , and blood drop by drop, by the application of known physical laws; or, when needed, new laws and new ideas are summoned forth to explain them. Corks are popped, the bubbly flows, and awards are apportioned among the minds that made the breakthroughs. But then, as always, when the party is over and the guests start working off their hangovers, we realize that although, yes, progress has been made, there is still more territory to cover. Ironically, sometimes the new territory is a direct consequence of the conquests themselves.

Bohr’s triumph over atomic structure is perhaps the best known entrée in this genre of the story of scientific progress. There were two problems, one empirical and one theoretical, which arose from it in particular, problems which sobered up the scientific community. The empirical problem was that Bohr’s atomic model, while it perfectly explained the behavior of atomic hydrogen, could not be successfully applied to any other atom or molecule, not even seemingly simple helium or molecular hydrogen (H2), the former of which is just after hydrogen in the periodic table. The theoretical problem was that the quantitization of orbits was purely done on an ad hoc basis, without any meaningful physical insight as to why it should be true.
And so the great minds returned to their offices and chalkboards, determined to answer these new questions.

Key Ideas in the Development of Quantum Mechanics

The key idea which came out of trying to solve these problems was that, if that which had been thought of as a wave, light, could also possess particle properties, then perhaps the reverse was also true: that which had been thought of as having a particle nature, such as the electron, could also have the characteristics of waves. Louis de Broglie, in his 1924 model of the hydrogen atom, introduced this, what was to become called the wave-particle duality concept, explaining the discrete orbits concept of Bohr by recasting them as distances from the nuclei where standing electron waves could exist only in whole numbers, as the mathematical theory behind waves demanded:


De Broglie’s model was supported in the latter 1920’s by experiments which showed that electrons did indeed show wave features, at least under the right conditions. Yet, though a critical step forward in the formulation of the quantum mechanical description of atoms, de Broglie still fell short. For one thing, like Bohr, he could only predict the properties of the simplest atom, hydrogen. Second, and more importantly, he still gave no fundamental insight as to how or why particles could behave as waves and/or vice-versa. Although I have said that reality on such small scales should not be expected to behave in the same matter as the scales we are used to, there still has to be some kind of underlying theory, an intellectual glue if you prefer, that allows us to make at least some sense of what is really going on. And scientists in the early 1920’s still did not possess that glue.

That glue was first provided by people like Werner Heisenberg and Max Born, who, only a few years after de Broglie’s publication, created a revelation, or perhaps I should say revolution, of one of scientific – no, philosophic – history’s most astonishing ideas. In 1925 Heisenberg, working with Born, introduced the technique of matrix mechanics, one of the modern ways of formulating quantum mechanical systems. Crucial to the technique was the concept that at the smallest levels of nature, such as with electrons in an atom, neither the positions nor motions of particles could be defined exactly. Rather, these properties were “smeared out” in a way that left the particles with a defined uncertainty. This led, within two years, to Heisenberg’s famous Uncertainty Principle, which declared that certain pairs of properties of a particle in any system could not be simultaneously known with perfect precision, but only within a region of uncertainty. One formulation of this principle is, as I have used before:

x × s h / (2π × m)

which states that the product of the uncertainty of a particle’s position (x) and its speed (s) is always less than or equal to Planck’s (h) constant divided by 2π times the object’s mass (m). Now, there is something I must say upfront. It is critical to understand that this uncertainty is not due to deficiencies in our measuring instruments, but is built directly into nature, at a fundamental level. When I say fundamental I mean just that. One could say that, if God or Mother Nature really exists, even He Himself (or Herself, or Itself) does not and cannot know these properties with zero uncertainty. They simply do not have a certainty to reveal to any observer, not even to a supernatural one, should such an observer exist.
Yes, this is what I am saying. Yes, nature is this strange.


The Uncertainty Principle and Schrödinger’s Breakthrough

Another, more precise way of putting this idea is that you can specify the exact position of an object at a certain time, but then you can say nothing about its speed (or direction of motion); or the reverse, that speed / direction can be perfectly specified but then the position is a complete unknown. A critical point here is that the reason we do not notice this bizarre behavior in our ordinary lives – and so, never suspected it until the 20’th century – is that the product of these two uncertainties is inversely proportional to the object’s mass (that is, proportional to 1/m) as well as directly proportional to the tiny size of Planck’s constant h. The result of this is that large objects, such as grains of sand, are simply much too massive to make this infinitetesimally small uncertainty product measurable by any known or even imaginable technique.

Whew, I know. And just what does all this talk about uncertainty have to do with waves? Mainly it is that trigonometric wave functions, like sine and cosine, are closely related to probability functions, such as the well-known Gaussian, or bell-shaped, curve. Let’s start with the latter. This function starts off near (but never at) zero at very large negative x, rises to a maximum y = f(x) value at a certain point, say x = 0, and then, as though reflected through a mirror, trails off again at large positive x. A simple example should help make it clear. Take a large group of people. It could be the entire planet’s human’s population, though in practice that would make this exercise difficult. Record the heights of all these people, rounding the numbers off to a convenient unit, say, centimeters or cm. Now make sub-groups of these people, each sub-group consisting of all individuals of a certain height in cm. If you make a plot of the number of people within each sub-group, or the y value, versus the height of that sub-group, the x value, you will get a graph looking rather (but not exactly) like this:


Here, the y or f(x) value is called dnorm(x). Value x = 0 represents the average height of the population, and each x point (which have been connected together in a continuous line) the greater or lesser height on either side of x = 0. You see the bell shape of this curve, hence its common name.

What about those trigonometric functions? As another example, a sine function, which is the typical shape of a wave, looks like this:


The resemblances, I assume, are obvious; this function looks a lot like a bunch of bell shaped curves (both upright and upside-down), all strung together. In fact the relationship is so significant that a probability curve such as the Gaussian can be modeled using a series of sine (and cosine) curves in what mathematicians call a Fourier transformation. So obvious that Erwin Schrödinger, following up de Broglie’s work, in 1926 produced what is now known as the Schrödinger wave equation, or equations rather, which described the various properties of physical systems via one or more differential equations (if you know any calculus, these are equations with relate a function to one or more of its derivatives; if you don’t, don’t worry about it), whose solutions were a series of complex wave functions (a complex function or number is one that includes the imaginary number i, or square root of negative one), given the formal symbolic designation ψ. In addition to his work with Heisenberg, Max Born almost immediately followed Schrödinger‘s discovery with the description of the so-called complex square of ψ, or ψ* ψ , being the probability distribution of the object, in this case, the electron in the atom.

It is possible to set up Schrödinger’s equation for any physical system, including any atom. Alas, for all atoms except hydrogen, the equation is unsolvable due to a stone wall in mathematical physics known as the three-body problem; any system with more than two interacting components, say the two electrons plus nucleus of helium, simply cannot be solved by any closed algorithm. Fortunately, for hydrogen, where there is only a single proton and a single electron, the proper form of the equation can be devised and then solved, albeit with some horrendous looking mathematics, to yield a set of ψ, or wave functions. The complex squares of these functions as described above, or solutions I should say as there are an infinite number of them, describe the probability distributions and other properties of the hydrogen atom’s electron.
The nut had at last been (almost) cracked.

Solving Other Atoms

So all of this brilliance and sweat and blood, from Planck to Born, came down to the bottom line of, find the set of wave functions, or ψs, that solve the Schrödinger equation for hydrogen and you have solved the riddle of how electrons behave in atoms.

Scientists, thanks to Robert Mullikan in 1932, even went so far as to propose a name for the squared functions, or probability distribution functions, a term I dislike because it still invokes the image of electrons orbiting the nucleus: the atomic orbital.

Despite what I just said, actually, we haven’t completely solved the riddle. As I said, the Schrödinger equation cannot be directly solved for any other atom besides hydrogen. But nature can be kind sometimes as well as capricious, and thus allows us to find side door entrances into her secret realms. In the case of orbitals, it turns out that their basic pattern holds for almost all the atoms, with a little tweaking here, and some further (often computer intensive) calculations there. For our purposes here, it is the basic pattern that matters in cooking up atoms.

Orbitals. Despite the name, again, the electrons do not circle the nucleus (although most of them do have what is called angular momentum, which is the physicists’ fancy term for moving in a curved path). I’ve thought and thought about this, and decided that the only way to begin describing them is to present the general solution (a wave function, remember) to the Schrödinger equation for the hydrogen atom in all its brain-overloading detail:

Don’t panic: we are not going to muddle through all the symbols and mathematics involved here. What I want you to do is focus on three especially interesting symbols in the equation: n, , and m. Each appears in the ψ function in one or more places (search carefully), and their numeric values determine the exact form of the ψ we are referring to. Excuse me, I mean the exact form of the ψ* ψ, or squared wave function, or orbital, that is.

The importance of n, , and m lies in the fact that they are not free to take on any values, and that the values they can have are interrelated. Collectively, they are called quantum numbers, and since n is dubbed the principle quantum number, we will start with it. It is also the easiest to understand: its potential values are all the positive integers (whole numbers), from one on up. Historically, it roughly corresponds to the orbit numbers in Bohr’s 1913 orbiting model of the hydrogen atom. Note that one is its lowest possible value; it cannot be zero, meaning that the electron cannot collapse into the nucleus. Also sprach Zarathustra!

The next entry in the quantum number menagerie is , the angular momentum quantum number. As with n it is also restricted to integer values, but with the additional caveat that for every n it can only have values from zero to n-one. So, for example, if n is one, then can only equal one value, that of zero, while if n is two, then can be either zero or one, and so on. Another way of thinking about is that it describes the kind of orbital we are dealing with: a value of zero refers to what is called an s orbital, while a value of one means a so-called p orbital.

What about m, the magnetic moment quantum number? This can range in value from – to , and represents the number of orbitals of a given type, as designated by . Again, for an n of one, has just the one value of zero; furthermore, for equals zero m can only be zero (so there is only one s orbital), while for equals one m can be one of three integers: minus one, zero, and one. Seems complicated? Play around with this system for a while and you will get the hang of it. See? College chemistry isn’t so bad after all.

* * *

Let’s summarize before moving on. I have mentioned two kinds of orbitals, or electron probability distribution functions, so far: s and p. When equals zero we are dealing only with an s orbital, while for equals one the orbital is type p. Furthermore, when equals one m can be either minus one, zero, or one, meaning that at each level (as determined by n) there are always three p orbitals, and only one s orbital.

What about when n equals two? Following our scheme, for this value of n there are three orbital types, as can go from zero to one to two. The orbital designation when equals two is d; and as m can now vary from minus two to plus two (-2, -1, 0, 1, 2), there are five of these d type orbitals. I could press onward to ever increasing ns and their orbital types (f, g, etc.), but once again nature is cooperative, and for all known elements we rarely get past f orbitals, at least at the ground energy level (even though n reaches seven in the most massive atoms, as we shall see).

Tuesday, January 15, 2013

Dinosaurs Are Not Ancient!

Dinosaurs are often regarded as ancient, even early Earth life forms, but the following graph should dispel this notion once and for all:
 
 
You can see that the dinosaurs (excluding birds) only existed from 230 million (five percent of Earth's full age) and last only a about three percent of that age.  Humans appear a mere 65 million years later.  Even the first animal life 700-800 million years ago, or about eighteen percent of that age.  The first life starts around 3500-4000 million years, when out planet was already close to a billion years old (longer itself than the span of animal life!).  This often comes as a surprise even to people who are scientifically educated.
 
One consequence of this is that dinosaurs were probably as fully modern as today's mammals and birds; they were not "primitive" at all, and weren't driven into exaction by the latter.  A large asteroid impact is now the main theory behind the disappearance of non-avian dinosaurs, perhaps combine the mass volcanic eruptions in India.  Still, it is puzzling why at least some of the smaller, bird-like dinosaurs didn't sneak through; perhaps a few did (just as a few mammals and birds did) but the quicker evolution of the latter drove them into fossil grounds we simply haven't yet.
 
More on non-avian dinosaurs (most have feather, like "Velociraptor" (which wasn't) on Jurrasic Park.



Monday, January 14, 2013

Why do Woman ... Well, you'll see.

It's often been asked, evolutionarily speaking (it's a harder question for a creationist, though) why do male mammals, including ourselves of course, have nipples?  No functional purpose can be assigned to them so you think natural selection would "prefer" males who don't.  I think there's an even better question however:  why do female mammals have a clitoris?

The answer is clearly not for pleasure.  First, nature doesn't give a hoot about pleasure in making its choices.  Second, outside of humans and some other mammals, females don't enjoy sex at all (just watch two cats at it; she's clearly in pain and drives him off as quickly as they have intercourse).  She's driven by hormonal changes and attracts males to mate to her.  So why do they have an organ of pleasure if they don't use or need it?

I think the late, famous paleontologist Stephen Jay Gould would have the answer to this.  It isn't known exactly when (pre?) mammalian genitalia evolved (maybe as much as 200-250 million years ago, or much more recently), but they probably evolved from their reptilian ancestors who used a "primitive" cloaca system (everything comes out one tube) -- a system still basically in use by most modern reptiles and birds.  One of Gould's basic themes in his life is the natural selection is not all-powerful; it can't sculpt living this to exact specifications or proportions.  In a sense this is obvious (despite Richard Dawkin's ill-deserved reputation for "claiming" otherwise); natural selection can only work on gene selection, and most genes don't do just one thing -- we have about 20-25,000 genes and these interact in the body of the embryo/fetus/child and the physical and chemical environment of the womb to form all the millions of individual features we possess.

Here's the trick with we mammals.  As very young embryos we are all females; the basic genitalia and internal sex organs all develop within the abdomen.  No doubt the nerves that lead to sexual arousal and please largely develop then too, and have been since the beginning.  Why?  We'll probably never know because soft tissues are rarely fossilize -- we can make intelligent guesses about it (same about why not in reptiles and birds), but that's about all.

There is a gene, dubbed SRY, on the Y chromosome (which, recall, only males have; females are XX) which at several weeks into gestation, becomes active and causes the release of testosterone in the male body.  This causes a number of physical and chemical changes.  One of these changes is the decent of the proto-penis and testicles downward, into their position when he is born.  Prior to this however, the progenitor of the penis exists in both sexes; in females it descends too.  In other words, the penis and the clitoris start off as the same structure, already equipped with sexual nerves.  There probably aren't any available mutations that would eliminate the clitoris or its sexual nerves (genes to many things, remember) so natural selection cannot achieve this.  The net result as that as least some female mammals (and potentially perhaps all of them) get to enjoy this accidental benefit.  But accident is just what it is.

Eradication of suffering

From Wikipedia, the free encyclopedia https://en.wikipedi...