Showing posts with label math. Show all posts
Showing posts with label math. Show all posts

Wednesday, January 23, 2013

Bouncing X-rays

One of the most interesting parts of my job is a measurement I do everyday called X-ray diffraction (XRD). It's a powerful tool that I can use to tell me about how the materials I work with crystallize. The batteries that I work with work best if the atoms are all lined up in the right direction so it's important to know how they are lined up. There are several ways to change how the atoms are arranged, so we can tune our materials so that they line up properly so that lithium can pass through them correctly.

XRD is mostly useful for crystals. What makes a material a crystal? A material is a crystal if the atoms/molecules are arranged in a periodic pattern. The dots below make a square pattern, so if they were atoms, they would be a crystal.


Or you could arrange the atoms in a different pattern. They would still be a crystal as long as there is a clear pattern to their arrangement. The following is a hexagonal arrangement.


In a complex crystal structure, there may be multiple ways of measuring the distance between atoms. In the picture below, you could measure distances between atoms along the blue line, along the orange line, along the green line, or along the pink line. You can see that the distances are the same for the blue and pink lines, but the distance for the green line is longer, and the distances for the orange line are even longer.


If you know all these different measurements of atomic spacings, then you have a unique way of describing this particular crystal arrangement. For this square arrangement, the atomic spacings are 1, 2.2, 1.4, and 1 for the blue, orange, green and pink "planes" respectively. If you drew similar planes on the hexagonal arrangement, you would see that the atomic spacings are 1, 1.8, 1.1, and 2. So these numbers are unique ways to describe the crystals. So if you had a crystal and you wanted to know what its crystal structure was, all you'd need to do is figure out all the different atomic spacings, look up that set of spacings in a database, and you'd know what the crystal structure was.

The central thing that XRD tells you is what the distance is between atoms, so it provides the way to determine a crystal structure. So how does XRD measure atomic distances? By diffraction. Diffraction is when a wave bounces off a periodic structure. The wave will bounce off the periodic structure and will reflect in a direction that depends on the spacing of the pattern. In XRD, the wave that is used is an X-ray. An x-ray is just light with a very short wavelength. The x-rays I use have a wavelength of 1.5 Angstroms (1.5 x 10^-10 m). Diffraction only works if the distance between atoms is close to the wavelength of the wave. Conveniently, atoms are usually spaced a few angstroms from one another.

If you shoot an x-ray at a crystal, it looks something like this:

One x-ray bounces of one atom and another x-ray bounces off another atom. You can see that the two x-rays travel different distances. The top one travels a shorter distance (2dSin(θ) shorter than the lower one). The difference in paths cause a phase difference between the two x-rays. When they head towards the crystal, they wiggle up and down at the same time. But after travelling different distances, they may or may not be wiggling up and down simultaneously. In the above picture, the difference in paths is just right so that the two waves are wiggling together after reflecting. Waves add together, so you can add the two waves together and see that you get a nice big wave twice the size of the original ones. This is called constructive interference. This means that you would see a bright spot if these waves ran into a piece of photo paper.

But if the difference in the paths was not just perfect, the waves could have ended up deconstructively interfering, which means you would see a dark spot on a piece of photo paper. One way you could get this is by changing the angle that the x-rays come in at.


In this case, you can see that the x-rays are wiggling together on the left, but after they reflect, they are wiggling opposite of one another. If you add those together, you get a flat line, which would result in a dark spot. What this show us is that for a certain crystal structure, x-rays only reflect off at certain unique angles.

The other way that you can change the paths between the two x-rays is by changing the atomic spacings.


In this case, I moved the two planes away from each other, so when the x-rays bounce back up, they deconstructively interfere. What this shows us is that x-rays bounce off at certain angles dependent on the atomic spacing. This is the key to x-ray diffraction. It means that if you see an x-ray bouncing off a crystal at a certain angle, you know exactly what the spacing is between the two atoms it bounced off. Going back to what I said before, if you know all the unique atomic spacings between different atoms in a crystal, you know what kind of crystal structure it is.

When you actually take an XRD measurement, you end up with a graph that looks like this:

Each peak in this graph tells you what angle the x-rays are reflecting at. If you know the angle they reflect at, you can figure out what the atomic spacing is by Bragg's law:


For the first peak in the graph, n=1, the wavelength λ=1.5418, and the angle θ=18.8/2=9.4 degrees. If you solve that equation, you get that the atomic spacing for the (003) plane is d=4.72 angstroms. The (003) plane is analogous to the colored lines that we drew up above. For instance, the blue line would show the atomic spacings for the (10) plane, the red line would  show atomic spacings for the (12) plane, etc. So that is how XRD uses diffraction to determine crystal structure.

Tuesday, August 16, 2011

How to Ride Your Bike to Work Faster

When I ride my bike to work I really don't think very much. I just turn on the NPR Jazz radio station and try to enjoy the ride. I'll occasionally think about my pace and try to get a good average speed. I was trying to think about how high speeds and low speeds affect my average speed. It was messing with my mind and I couldn't really wrap my mind around exactly how it worked. Back when the Tour de France was happening I was thinking about this too. Nobody is ever very interested in flat stages because the important attacks always happen in the mountains. Why was that? What is it about steep hills that makes the difference in the race?

Finally, I sat down a few days ago and calculated it. I took a nice triangular hill.

The rider goes up the hill at 5mph and down the hill at 30mph. At first glance, it would be tempting to say that the average speed at the end of this 10 mile ride is 17.5mph. 


Well that is correct in one sense but absolutely wrong in the sense that anybody cares about. 17.5mph is the correct average if you are taking a "distance average" Measuring the speed at every position along the way, you would get half the data points saying 5mph and half saying 30mph.


The distance-averaged speed is 17.5mph in this case. Unfortunately, I can't think of a single application for this kind of average. Nobody cares what the distance-average speed is. Everybody cares about what the "time-averaged" speed is. That's the one that tells you how fast you get to the finish line. That is the one that is 


Here we go. The time it takes to go the first half is t1=d1/v1 and the time it takes to go the second half is t2=d2/v2.


That's much more complicated than the distance average. So that means that if you went up the hill at 5mph and down the hill at 30mph, then your average speed would be 8.57mph, which is just a bit more than the uphill speed. I think that this is really annoying. I'd much rather have my average speed be faster than that. So what's the best way to improve your average speed on a hill like this? This graph might help. The colors (from purple to white) represent the average speed at the end of the ride. Purple is the lowest average speed and white is the maximum average speed. 

I've put a point that corresponds to an uphill speed of 5mph and a downhill speed of 30mph like we've been talking about. In order to increase your average speed, you could increase your downhill speed by 4mph or increase your uphill speed by 4mph. I've represented these two choices by the arrows that go out from the point. If you increase your uphill speed by 4mph (vertical arrow), then you cross over lots of contour lines and your average speed is significantly better than before--13.85mph. If you take the other choice and increase your downhill speed by 4mph (horizontal arrow), then you barely improve your average speed at all. The arrow doesn't even make it to the next contour line. This choice would give you a very slight improvement in average speed--8.72mph. Remember the original average speed was 8.57mph!

Hopefully this all makes sense. It basically shows that your uphill speed more important than your downhill speed. You can make a significant difference by making a small change in uphill speed. So now it makes sense why the mountain stages of the Tour are the most important. If you can just make a slight improvement in speed over the rest of the field, it will pay off significantly and if somebody has a less than average day on the mountains, it will hurt them horribly. 

This should also prove to you that if you are running late to work on your bike, you should push really hard on the uphills and take it super easy on the downhills. The downhills will make very little difference in the time it takes you to get to work.

Tuesday, March 29, 2011

How to do Calculus: The Derivative

Not everyone knows calculus and it's too bad because it's good stuff (as far as math goes). This is my attempt to explain one of the main concepts of calculus in one blog post. Watch this video...it's really boring but only takes a few seconds.

The point makes a bunch of random movements. It moves up, slows down, turns around, slows down, turns around, slows down turns around, et cetera and then it stops at its original position. The graph moving to the left describes the point's position as time changes. Here it is sitting still:

The position increases, flattens out, decreases, flattens out, increases, flattens out, decreases, goes negative, comes back positive, et cetera. It changes just like the point in the video. Let's say that the position is in miles and time is in hours. So in the first two hours the point goes one mile.

Hopefully everything above here makes sense. So far we haven't done any calculus.

The first interesting concept you learn in calculus is the derivative. If you take the derivative of a graph like the one I plotted above, you measure the slope of the graph. In the following video, you would be measuring the steepness of the maroon line as time changes. Notice that the maroon line is always tangent to the position graph.


When you measure the slope you measure how much the line rises divided by how much the line moves forward. You would be dividing vertical distance by time, so the units of the derivative would be miles per hour. So taking the derivative of a position vs. time graph gives you the speed (mph) at all times. You could plot the derivative as a function of time and get this:
If you compare the speed graph with the position graph, you can see that when the position graph is steep upwards the speed graph is high. When the position graph is flat, the speed graph is at zero. When the position graph is steeply sloped downward, the speed graph is very negative.

To convince you that the derivative is speed, here's a video of the position graph with a speedometer!


When the point speeds up, the speedometer needle goes up just like you would hope. When the point goes backward, the speedometer needle goes past 0mph.

Hopefully now you understand what a derivative is and that one application of the derivative is to measure the speed of something.

Friday, September 3, 2010

Shadow


Yesterday I was waiting for the bus in Golden and it was 9:30PM. It was dark and cars were passing every minute or so. The bus was supposed to get there by 9:19, so I was starting to get impatient and started pacing. I'm not much of a pacer, but that was the best thing I could think of doing at the moment. I noticed the shadow of the bus stop sign moving whenever a car would pass. The headlights were shining on the sign and the shadow would move along the bench. In my pacing I started walking along the shadow and wondered, if I know the speed of the shadow, can I calculated how fast the car is moving? Nope. Can't do it.

I was so disappointed, but i realized why I couldn't do the calculation. The shadow is just a projection from a moving light source, past the sign, onto the bench. The shadow doesn't contain every piece of information that the light source and object contains. There's always a loss of information for a projection. Like if you saw two shadows of people with identical head shapes, but different noses, you'd never be able to figure out who had the bigger nose. It's sad, I know. And even if you had an infinite number of shadows, you'd know who had the bigger nose, but wouldn't know if either person had eyeballs, unless they had particularly bulgy eye balls. So projections are cool, but they always have a loss of information.

Thecool thing is that the more projections you have, the more information you have. That's why 2 eyes are better than one. Two different perspectives or projections allow you to have depth perception. And if we had 2 more eyeballs on our hands, then we'd have even better depth perception. We only have depth perception for things that are moderately close, because when you're looking at Russia from Palin's backyard, the picture in one eyeball is about the same as the picture in the other eyeball. The eyeball separation is so close compared to the long distance that it doesn't really make a difference. It's basically two copies of the same picture.

In calculus, a derivative is a loss of information (like a projection) and an integral is an increase of information (like an antiprojection (whatever that is)). So it goes to show that an integral is way cooler than a derivative for this reason:
  • A derivative is an old fashioned overhead projector that your high school literature teacher used to tell you that The Great Gatsby is the best book ever.
  • An integral is the hologram that your high school physics teacher used to set-in-stone that physics is so much cooler than any other subject.
'nough said.

So now you know that I like physics and math, but don't really like The Great Gatsby...One of the things that I passionately dislike. Sorry for the extremely nerdy post.