Category: DIY


beesknees

Figure A: The knee of a bee

I recently bought a 80-800x USB microscope. It has really good quality for less than $40, and I’ve been using it to get up close and personal with crystals, dead bugs, and gross parts of my anatomy. Feast your eyes!

A wasp, with a bizarre, insectile tongue

A wasp, with a bizarre, insectile tonguemouththing. Proboscis. Weird.

mole

One of my moles. Maybe it’s time I get it looked at, hm?

I wasn't too thrilled to find out that I had warts, but they grow on you.

I wasn’t too thrilled to find out that I had warts, but they grow on you.

thermite bead

Iridescence in a bead of thermite residue.

cuso4

Copper sulfate blocks

cuacet8-4

Feathers of copper acetate

cuacet8-3

Copper acetate closeup

I hope to get some polarizing filters and videotape the growth of chiral crystals, like sugar or vitamin C. Stay tuned…

Today in LabLulz, I’m going to walk through a recent preparation I did in my chemistry lab: increasing and measuring the concentration of hydrogen peroxide.

WARNING: This procedure involves heat and the end product is a powerful oxidizer. Don’t get burned and don’t get it on yourself – wear gloves, splash-resistant goggles, and an apron. I had a spill of ~15%, all over everything, including myself. It was okay, but only because I followed safety protocols. I didn’t have the apron though, and I had to get pantsless.

Hydrogen peroxide is an interesting substance; it’s formula is H2O2, meaning that it is composed of two hydrogen atoms bonded to two oxygen atoms.

sdfsfasdf

Figure 1. Behold, the hydrogen peroxide molecule!

It is a powerful oxidizer, decaying into water and free oxygen. This is because the bond between the two oxygen atoms, called the peroxide bond, is unstable. Some substances which contain the peroxide bond are even explosive, like triacetonetriperoxide. Because it’s an explosive precursor, and somewhat dangerous on its own, concentrated hydrogen peroxide can be difficult to come by. The weak 3% solution found in drugstores is all that is available to DIYers, hobbyists, and other scientists outside of the mainstream chemical supply chain.

Fortunately, it is relatively trivial to increase the concentration from 3% to around 30%. There are several tutorials on the subject at YouTube (TheChemLife; zhmapper, nerdalert226) so I’m going to focus on measuring the concentration of the end product, a procedure which the videos tend to treat very qualitatively. I hope this tutorial will be informative and useful, even outside of punklabs; the process is easily generalized and density is important in many fields, including medicine and winemaking.

The concentrating procedure is pretty simple: pour about 500 mL of the 3% solution into a beaker and heat it, forcing the excess water to evaporate until there is a tenth as much liquid left (peroxide boils at 150 C, compared to 100 C for water.) There are only a couple of tricky points: the liquid must NOT boil, only steam – if it starts boiling, the peroxide will decay. Bits of dust and dirt will also cause disintegration, so the equipment must be kept very clean and free from scratches.

Okay, so after a few hours, I have about 50 mL of liquid. I drop a bit into a solution of corn starch and potassium iodide, and the mixture turns black, a positive test for oxidizers. I add a squirt to some sulfuric acid and copper wire, and the metal wire begins bubbling and the solution begins to turn blue with copper sulfate*. This reaction is faster and more vigorous than when I try it with the 3% solution, so I’ve clearly succeeded in increasing the concentration, but to what level? To answer that question, I’m going to measure the density of the solution.

The Setup

Figure 2. The Densitometry Setup. Note the safety equipment. Note also the lab notebook, which is essential. Other sights include a bit of iron oxalate, tongs, and a desiccator.

Here’s my setup. I don’t have a nice buret with a stopcock, so instead I have repurposed a graduated medical pipette (I picked up a huge box of these at the Scrap Exchange). This is controlled with a valve and a syringe plunger. It’s a little drippy and derpy, not great for dispensing a planned volume, but it works fine to measure the amount that has been dispensed, which is sufficient for our purposes. The milligram scale was lent to me by a friend after armed thugs stole my old one (thanks, B!) The brown glass vial is good for containing peroxide, since light speeds up its decomposition.**

Once the room and the beaker are at the same temperature (20 deg C), I draw about 8 mL of my peroxide up into the pipette, and start adding peroxide a bit at a time. By the time I had figured out the fluidics system, I’d added about 3.0 mL, so that’s where the data start. I then would squirt a bit of peroxide into the vial, note the volume and the mass, and repeat. I took 8 different measurements this way.

Then, after I put everything away and cleaned up, I sat down with a cup of coffee for a bit of data entry.

sdfasdf

Figure 3. Data, in analog and digital form. This is a page from my lab notebook, and the spreadsheet in gnumeric (inset).

I usually store my data in spreadsheets, and my processing and analysis with Python. Once the spreadsheet file is ready, I get started and load up my data.

$ ipython –pylab

In [1]: import xlrd
In [2]: phial = xlrd.open_workbook('densityData.xls')
In [3]: data = phial.sheet_by_index(0)
In [4]: raw_volume = data.col_values(1)[5:]
In [5]: raw_mass = data.col_values(3)[5:]

Next, I take a quick peek at the data just to make sure that everything is as expected.

In [6]: plot(raw_volume, raw_mass, 'bo')
test

Figure 4 Plotting the raw data.

Looking good; the data are nice and linear, meaning that the slope (and therefor the density) is well defined. But this is the raw data, which include the mass of the bottle. I also didn’t start at zero on my pipette, just wrote down the volume the liquid was at when I took each mass measurement. It doesn’t matter too much, but strictly speaking, we want to compare just the mass of the liquid in the bottle to the volume of liquid drained from the pipette. Let’s go ahead and calculate that (it’s a lot like calculating temperature anomaly.)

In [12]: volume = array(raw_volume) - 3.0*ones_like(raw_volume)
In [12]: mass = array(raw_mass) -9.988*ones_like(raw_mass) 

Much better. Now, to get some basic statistics on these data, let’s apply a linear regression.

In [13]: from scipy import stats
In [16]: (m, b, r, p, std) =stats.linregress(volume, mass)
In [17]: (m, b, r, r**2,  p, std)

Out[17]:
(1.1189534883720933,
0.067450581395348319,
0.99932418729044048,
0.99864883130369941,
7.7125664942037092e-10,
0.01680292147514929)

It’s mostly the slope, m = 1.12 g/mL, which we’re interested in.

In [16]: linFit = polyval([m,b], volume)
In [29]: plot(volume, linFit, 'r-')
In [30]: plot(volume, mass, 'bo')
In [31]: title('Mass vs. Volume for H2O2')
In [32]: xlabel('Volume (mL)')
In [33]: ylabel('Mass (g)')
In [36]: text(1.25, 4.5, 'M = %fg/mL*V + %fg'%(m,b))
final

Figure 4. The mass of peroxide is plotted as a function of its volume, and a linear regression applied.

Now that we have the density, we can use this graph from H2O2.com.  (It’s derived from Easton et al 1952. The paper actually reports on density measurements at 0, 10, 25, 50, and 96 degrees, so these are probably interpolated curves).  We’ll draw a horizontal line at the measured density (~1.12 g/mL) until we hit the curve corresponding to the temperature (20C). Then we draw a vertical line and read off the concentration where it crosses the horizontal axis. Result? The concentration is about 32%. (Figure 5)

asdfasdfasdfsd

Figure 5.

You may wonder why I went through so much trouble of taking multiple data points and calculating a trend line. If density is defined as mass per volume, then surely I can measure it in one go, by massing a single sample of known volume. Right? The problem is that any one such measurement might be a little wonky. Maybe one fewer drop than usual wiggled out, or a draft of air was pushing down a little on the scale. Look back at Figure 4; see the data point third from the end, visibly above the trend line? If I was only taking one measurement, I might get unlucky enough to get an outlier like that one.  By using a linear regression, I can aggregate the data, and hopefully all those small outside factors will tend to cancel out.

Another reason is that the linear regression allows us to calculate uncertainty in the slope of the line, and therefor in the density. There are good online explanations of this, so I’m just going to churn through the equations.

In [26]: N = len(volume)
In [27]: unc = std *sqrt(N/(N*sum(volume**2)-sum(volume)**2))
In [28]: unc
Out[28]: 0.005463100999105781

We can thus report the density as 1.119 +/- 0.005 g/mL. If we wanted, we could use the uncertainty in the density to calculate the uncertainty in concentration the same way we calculated the concentration estimate: plot lines at 1.119 + 0.005 g/mL for the upper bound, and 1.119 – 0.005 g/mL for the lower bound and work backwards to get a confidence interval of concentrations. In our case though, the uncertainty is so small that it’s about the width of the original line not really worth propagating.

I feel comfortable just calling this 32% peroxide. Success!

* An easier, quicker test is to add peroxide to a catalyst that causes it to decay, but I didn’t have any manganese dioxide or horseradish on hand. Also, everyone loves copper sulfate.

** This is really a moot point, since I am keeping this sample in the fridge, and there is not even a lightbulb to philosophize about. But it’s also why you buy peroxide in opaque bottles.

~~~

Easton, M., Mitchell, A., & Wynne-Jones, W. (1952). The behaviour of mixtures of hydrogen peroxide and water. Part 1.?Determination of the densities of mixtures of hydrogen peroxide and water Transactions of the Faraday Society, 48 DOI: 10.1039/TF9524800796

I’m revisiting some older research of mine, so that I can talk a little bit about some data visualization I did along the way. If you frequent TriZPUG or the SplatSpace, you might have seen my original presentation, but In Case You Missed It…

You might remember a while back I got interested in researching the statistical thermodynamics of poker tournaments. To briefly recap, I was treating the distribution of chips amongst players as a probability distribution, which meant that I could use the concept of entropy to describe the distribution. Entropy in thermodynamic systems is associated with how ‘spread out’ the energy is in that system: A hot cup of coffee in a cold room has low entropy while warm coffee in a warm room has high entropy. In a statistical system like a poker table, entropy measures how evenly distributed the chips are between the players. When the players start the tournament with equal amounts, the entropy is at a maximum. When one player wins all the chips, the entropy is at a minimum. Already things are interesting – entropy in this statistical system must decrease with time, in stark contrast with the second law of thermodynamics. And we haven’t even looked at what happens between those two points!

Poker entropy

Poker entropy

To better understand the behavior of tournaments, I needed a way to play them and replay them, to turn them into something other than tables of names and numbers. The first representation worked well at illustrating the distribution, but failed to capture the dynamics; except in catastrophic rearrangements, it was not always obvious how the chips moved around from hand to hand.

[link]

What’s going on is, I’ve whimsically renamed the players for anonymity, and then represented the size of their stack with a circle. Each hand is then represented by a transaction in which chips flow from one or more players to a single winner, with chip flow represented by black lines whose size is representative of the magnitude of flow. I find this hypnotic.

If you don’t care about coding, feel free to skip down….

How exactly did I put this together?

Zeroeth, we have to get our tools together.

import pickle, sys    #file IO utilities
import pygame    #pygame library
from pygame.locals import *    #more pygame stuff
from math import sin, cos, pi, sqrt    #math tools

First, there is a great deal of tedious regular expression slicing and dicing that you have to do to convert a tournament history file into usable data; I’ll be merciful and skip that. So I’ve finally bundled up the data in a couple of files.

vial = open('dat/cash_timeline.dat','r')
 cash = pickle.load(vial)
 vial.close()

vial = open('dat/flux_timeline.dat','r')
 flux = pickle.load(vial)
 vial.close()

Now, it’s time to start drawing. I’m using the PyGame module to do the drawing; there are other options like TkInter, of course.

pygame.init()#    start yer engines!
windowSurfObj = pygame.display.set_mode([700,700])# build a window
pygame.display.set_caption('Poker Face')# name it
fontObj = pygame.font.Font('freesansbold.ttf', 24)# get ready to write on it

Next, we have to build a table for the players to sit at. Let’s make it a circular table. Since the players’ stacks will be represented with circles, we’ll call the table a megacircle. It’s going to be invisible, but we need to build it anyway so that the players will have a place to sit.

centerx, centery = 300,300#    center of the megacircle
radius = 175#    size of the megacircle

Now, we have to give each player a seat at the table. We want them to be evenly spaced, so I used a trick I remembered from abstract algebra: the roots of unity of a polynomial of degree n form an n-sided polygon in the plane, and in particular have easily computed coordinates. I used this fact to arrange seats for the seven starting players (I also identify them with a color):

for i in range(0, len(allPlayers)):#    give each player a color and a location.
    color_dict[allPlayers[i]] = colors[i]# colors for everyone!
    place_dict[allPlayers[i]] = (centerx+int(radius*cos(2*pi*i/len(allPlayers))), centery+int(radius*sin(2*pi*i/len(allPlayers))))#   take your seats.

Now we’re ready to replay the tournament, looking at the stacks and fluxes between.

while hand < 675:#    for each hand...
    windowSurfObj.fill(white)#    erase everything
    win = winner()#who won this hand?
    for playa in allPlayers:#    for all of your players, consider each     individually.
        if flux[playa][hand] < 0.0:#    did they lose money this hand? if so....
            width = arr(abs(flux[playa][hand]))#then the width of the line connecting them to the winner is proportional to their loss.
            pygame.draw.line(windowSurfObj, black, place_dict[playa], place_dict[win], width)#    draw that line.

On top of that, we draw the circles representing players’ holdings. The pygame canvas is like a real life collage; when you add something, it covers up things that were already there. The circles will cover up the rough ends that are left from drawing those lines.

for playa in allPlayers:#circle round, everyone...
    rad = arr(cash[playa][hand])#radius of circle
    pygame.draw.circle(windowSurfObj, color_dict[playa], place_dict[playa], rad)#draw circles.

Let’s also give them nametags.

for playa in allPlayers:#    his name was robert paulson.
    msgSurfObj = fontObj.render(playa, False, graph)#    type the name in graphite letters.
    msgRectObj = msgSurfObj.get_rect()#    take the text as a whole....
    msgRectObj.topleft = place_dict[playa]#    .... and put it next to the  player's seat
    windowSurfObj.blit(msgSurfObj, msgRectObj)#    this basically just glues everything together.

…and then there’s a bit of mostly vestigial keybindings, not interesting enough to really talk about. Next we update the display, which sort of finalizes what we’re going to see on the screen:

pygame.display.update()

And then I save each frame as a single image, like a slide in a slideshow.

pygame.image.save(windowSurfObj, 'frm/frame%d.jpeg'%(hand))

Finally, the moment we’ve all been waiting for: We’ve drawn the slide, and it’s time to move on to the next:

hand += 1

Now, once we run this script, we’ll see the animation. We’ll also get each frame of the animation individually, bundled as a file. This way, we can just zip it together with a handy command-line program called ffmpeg:


>ffmpeg -fimage2 -i frame%d.jpeg -r 12 HxW demo.avi

Add some titles and background music using openshot, and you have a data visualization as open sourced as it is heart-pounding.

Note that this is a flyby, not a walkthrough, of pygame and python. For the full, original code, derps and all: http://pastebin.com/Anqe3eGS

… to here.

Part of the reason I wanted this bird’s eye view is to take a closer look at the dynamics of the game. Entropic processes often lead to what are called dissipative structures. The second law of thermodynamics insists that entropy must increase; dissipative structures are the routes and means by which this happens. The large-scale currents between the warm equator and cold poles are examples of dissipative structures; on a smaller scale, so are eddies and dust devils. Living organisms are dissipative structures which convert free energy (food) into heat.

I have already discussed Dr. Arto Annila’s paper, Economies Evolve by Energy Dispersal (Annila & Salthe 2009) which frames ecosystems and economies as dissipative structures. They explain, “Eventually, when no further and faster means to consume free energy and no additional sources are found, the economy reaches a steady-state, just as an ecosystem attains a climax, the mature state with maximal gross transduction.” I think that you can see this in the figure and the visualization. After each player loss, the system is placed out of equilibrium and has to readjust to a new steady-state.

Dr. Annila has also used thermodynamics to frame game theory, pointing to its physical science origins. (Anttila & Annila 2011). This paper explores the general concept of ‘utility’ which gaming strategies aim to maximize, proposing that the payoff for a strategy is actually the rate of entropy increase which it entails. Game theory can apply to chemistry, poker players, or ecosystems; in each case, it’s thermodynamics that motivate molecules, individuals, and populations. “…the behavior of many systems, including decision-making processes, could be described as natural processes so that entropy is the universal payoff function … The quest to consume free energy in least time is ubiquitous and independent of mechanisms.”

One observation that I think gets highlighted is the  ‘ringing’ after a major transition like the loss of a player. The loss of cyan around hand #5 in figure 1 seems to trigger a bit of it – look at the oscillations in entropy as the sudden influx of free energy disperses throughout the table. Dr. Annila was kind enough to send some thoughts on this project, and it seems that such ringing might have theoretical basis as well:  “At these occasions the path-dependent process display discontinuity … One could even expect to see some damping oscillations.” Watching the video animation, it is clearer exactly how that dispersal takes place, and how the network of interactions allows nonlocal connections between players, a characteristic of dissipative structures.

The good news on this front is that I’ve met a friend who is excited about sharing their collection of tournament histories. Stay tuned for updates as the numbers get crunched…

~~~

Annila, A., & Salthe, S. (2009). Economies Evolve by Energy Dispersal Entropy, 11 (4), 606-633 DOI: 10.3390/e11040606

Anttila, J., & Annila, A. (2011). Natural games Physics Letters A, 375 (43), 3755-3761 DOI: 10.1016/j.physleta.2011.08.056
 

There is a companion article exploring the issue from the perspective of environmental monitoring over at ArkFab.

Human influence on the environment has increased dramatically over the last 10,000 years, to the point that some geologists have argued that human reworking of the earth defines a new geologic age, The Anthropocene. (Zalasiewicz et al, 2008) Much of the focus has been on relatively robust, tangible changes in biogeochemistry. Examples include:

  • megafaunal extinction, accelerated erosion (Zalasiewicz et al, 2008) and nitrogen fixation resulting from the spread of intensive subsistence patterns
  • the loss of stratospheric ozone resulting from the release of novel chlorofluorocarbons

However, fleeting and less tangible effects are also important. Two examples are:

  • the light pollution resulting from urbanization and transportation infrastructure
  • changes in the acoustic environment resulting from direct addition of sonic energy and memes, as well as indirect sources.

A year-long composite view of the earth at night, showing human light generation. White lights are cities; blue lights are fishing boats; green lights are natural gas flares, and red lights are ‘ephemeral light sources’, interpreted as fires. Image from  NOAA National Geophysical Data Center – click for source + discussion.

Light pollution, the scourge of urban astronomers, is a well-accepted phenomenon with serious consequences. A 2004 review begins:

In the past century, the extent and intensity of artificial night lighting has increased such that it has substantial effects on the biology and ecology of species in the wild. We distinguish “astronomical light pollution”, which obscures the view of the night sky, from “ecological light pollution”, which alters natural light regimes in terrestrial and aquatic ecosystems. Some of the catastrophic consequences of light for certain taxonomic groups are well known, such as the deaths of migratory birds around tall lighted structures, and those of hatchling sea turtles disoriented by lights on their natal beaches. The more subtle influences of artificial night lighting on the behavior and community ecology of species are less well recognized, and constitute a new focus for research in ecology and a pressing conservation challenge. (Longcore & Rich 2004)

The amount of sonic energy released by human activity is recognized as an urban nuisance as well as an occupational safety concern. It also has recognized ecological effects: urban European robins have begun singing at night, when they have less acoustic competition. (Fuller et al 2007) Frogs have begun changing the pitch of their croaks in order to talk over traffic noise (Paris et al 2009)  In addition to sonic energy, human activity has released sonic memes into the environment. A meme is a self-replicating information pattern; jokes and computer viruses are two examples of memes. A person or computer acquires a meme and then spreads it, through retelling or infected emails. Sonic memes, such as ambulance sirens and cellphone ringtones, have been picked and repeated by songbirds. (Stover 2009) This is very interesting: human memes, the basis of Richard Dawkins’ ‘extended phenotype’ concept, have organically extended into other animals’ extended phenotype. (Recent reports of dolphins mimicking human speech are also very interesting in this context. The reverse flow also occurs, as animal communications are repackaged as ringtones or ambient music.)

View full article »

dont forget the crystals

Magnesium sulfate crystals, clingin’ to a petri dish. Chillin’.

Another quick lab snap. These are some nice crystals I grew. I was washing an earlier, less photogenic crystal garden with alcohol, and catching the runoff in a petri dish. I let it evaporate and was greeted with this happy little accident! The crystals are magnesium sulfate, available as Epsom salt at most pharmacies.

haxor hijinx: a DIY hotplate

I have, once again, found myself at the helm of a DIY lab, this one with a chemical wetlab focus. I’m sure this will provide lots of material in the future; right now, I want to share a protip I came up with the other night. I have been using soda can alcohol stoves for heat, but this isn’t always appropriate. You can’t heat flammable mixtures, and they leave soot on my glassware. But I don’t have a hotplate yet! What’s a gutterpunk labnerd to do?

Don’t forget the boiling chips!

It’s won’t spin a stir bar, but a clothes iron will do fine as a hotplate! You can see that I’ve secured this one to the lab bench with wood and a clamp for extra stability.

 

 

Thermodynamics and Poker

There is a companion article which discusses this project’s role in decentralized community and citizen science at ArkFab.

You can find the current paper at Scribd here or download it here.

A while back, I got the idea to investigate how the entropy of a poker tournament evolves with time. In thermodynamics, entropy is a measure of how ‘spread out’ energy is amongst the states available to it. When the energy in a system is concentrated in one place (like a hot cup of coffee in a cold room), the entropy of the system is low. When the energy is spread out (a few hours later, both the room and the coffee are the same temperature) the entropy of the system is high.  Although originally defined for distributions of physical energy, entropy can be defined more generally to study arbitrary distributions – for example the distribution of capital, in the form of chips, between players in a poker tournament.

Just by looking at the formal structure of the game, you can tell some things about how entropy behaves. For example, it is formally required that entropy falls to zero with time. On the one hand, this is a fancy way of saying, ‘one person will eventually win the tournament’; on the other hand, it is interesting to consider that this is the exact opposite of what happens in the physical, thermodynamic world. The entropy of a closed thermodynamic system necessarily increases with time: hot coffee in a cold room will cool down, but warm coffee in a warm room will never heat up. However, the entropy of a closed poker table necessarily decreases. It has a second law of thermodynamics that runs in the opposite direction from ours.

Beyond a bottom-up analytical approach, I wanted to see how real-life tournaments behave. Although online gaming has generated a wealth of data, accessing the data is difficult, and I could find only one other paper which investigated the phenomenon. This was ‘Universal statistical properties of poker tournaments’ by Clement Sire (Sire 2007). The author notes that most of the game-theoretic work on poker has been on largely restricted to optimal betting strategies in head-to-head tournaments. Sire builds a relatively simple model of player behavior: a player bets according to a simple evaluation of their hand and the table, and goes all-in if their hand is evaluated to be above a certain quality. This model predicts that tournaments will have certain statistical properties; this prediction is born out in real-life tournaments.

I was only able to get two suitable datasets, so it’s hard to draw solid conclusions about what is going on. However,  there are interesting observations to be made. Here’s a visualisation of one tournament:

Tournament fortunes and entropy for one set of data. The top graph shows the holdings of each player; the bottom graph shows the entropy of the tournament as a function of time (green). The red lines are the upper and lower bounds for the tournament; this is a function of the number of players, which is in turn a function of time.

For one thing, the entropy remains close to its theoretical maximum value, generally ~90% of the absolute maximum. In the tournament pictured, entropy appears to increase to a maximum, and then slowly decline, before the loss of a player abruptly changes the distribution of chips (the sudden changes in the stair-step of the max/min entropy.)  Furthermore, when the tournament entropy is normalized by its maximum entropy, there is a significant upwards trend (p = 0.012). Over the course of the tournament, the entropy increases towards its theoretical maximum. Additionally, it is interesting to me that, in between the losses of players, entropy appears to increase, reach a maximum, and then decrease again before collapsing. (It’s more clear in this image) I interpret this as the redistribution of the winnings of the leaving player (eg, of cyan to black and then to the rest of the table in hands 1-25) followed by a concentration of chips which eventually pushes a player out (yellow vs. the rest, hands 25-40).

However, none of these observations held in the second tournament. One possibility is that, because the second tournament was faster paced, players were eliminated much faster, and these frequent perturbations are obscuring the pattern. On the other hand, it’s entirely possible that the first tournament was a fluke. The only way to resolve this question is with more data!

One reason I am interested in this question has to do with a series of papers written by Arto Annilla from the University of Helsinki. He’s shown that protein folding, genomics, abiogenesis, ecological succession – pretty much every aspect of nature – is not merely constrained by the second law of thermodynamics, but a direct consequence of it. Most relevant to this project, I think, is his analysis of economies and ecosystems. The ultimate goal of each, he argues, is not only to increase entropy to a maximum, but to do so as fast as possible. To the extent that poker tournaments can be thought of as a toy model of an economy, they may provide empirical insights into thermoeconomics. Of course, we’ve already seen that tournament entropy is formally constrained to decrease with time, though it would be interesting to see the behavior of a tournament which is not driven by a rising minimum bet, as these are. The first tournament may show an upward trend after perturbation from quasiequilibrium conditions, and the relative entropy may show a tournament-scale increase. (Or, it may not. Argh! Why oh why must n=2?!) View full article »

DIY Spectro II

There is a more philosophically focussed companion article over at ArkFab.

At long last, second generation DIY spectro has arrived!

The spectrophotometer. Yes, that is an invisibility cloak. You can't see the stuff that's under it can you? Then that stuff is invisible!

If you recall, when last we left our humble spectrophotometer, it was a shambling mess of stone-age technology. Now, its a shambling mess of information-age technology!

Let’s take a closer look… View full article »

A Detective Story

About to run the Final Qualifying Round for some second generation DIY Spectro, I placed the first blank into the cuvette holder, and pressed start (or rather ran python tryna.py; I’m tryna measure a spectrum, gosh!). The machine hummed into action, now that the motor control wire was plugged into slot 9, which the computer was communicating with rather than slot 2, which the computer was not.

A few minutes later I got the results: Nothing. The machine was not seeing any light. At all.

See, normally when I scan a blank sample, the detector (which has different sensitivities at different colors) shows a characteristic hill shape:

Some typical blank sample runs. Horizontal axis is motor position in degrees (0-180) and vertical axis is detector response. Black is the mean of the time series coming from the detector at a given motor position (1 sec data per degree); green is the standard deviation of the time series, and red denotes the maxima/minima. Time series were preprocessed to remove annoying serial communications glitches.

But when I ran this blank: View full article »

DIY Spectro FAQ

Apparently a lot of people were interested in my spectrophotometry project! It was picked up by several websites including BoingBoing and HackADay. An update is long 0verdue [ed: HERE], but first some answers to questions I got. A few things I should have mentioned (the -photometer actually uses a transmission diffraction grating, which is what you see in those glasses that put rainbows on everything, [eg, these.] They work slightly differently but the principle is the same.) I also left a lot of detail out because I didn’t think people would be interested. Here’s the dirt:

What about the width of the light source? [BB#3; TO comment from James]

As it happens, the shape of the light source is one of the factors effecting the resolution of the device. When a beam of light hits the diffraction grating, ‘copies’ of it get reflected at different angles, and thus get projected to different locations. If the beam is thick, then the red copy of the beam will also be thick, and will overlap significantly with the orange copies. If the beam is very wide, there will be so much overlap that all colors overlap in the middle of the spectrum, and you get a white blur edged with red and blue.

The width of the light source limits the resolution of the device; a thinner light source gives a higher resolution, because there is less overlap between the 'projections' of each color. In extreme cases, there will be significant overlap of most of the spectrum, and the colors will recombine to form 'white' light everywhere except the red and violet edges. Of course, the smaller the slit, the less light gets through...

You reduce this overlap by making the beam thinner. I do in fact do this; it is unpictured but there is a beam-narrowing slit in front of the spectrophotometer, similar to the one in the spectroscope. The ideal setup is an infinitely bright light behind an infinitely thin slit, but this is difficult to accomplish on a DIY scale, though two razor blades can be a good approximation. I used double-layered electrical tape with a ~1.5mm slit cut in it, further narrowed with bits of aluminum. Also, although a smaller slit means higher resolution, it also lets less light through, which can lead to detector sensitivity issues.

You need to remove baseline detector response! [BB#5]

I did ;D What Anon is saying is that it doesn’t make sense to claim that these data are an absorption spectrum: View full article »

Follow

Get every new post delivered to your Inbox.