Home
Tobin's Lab Notebook [entries|archive|friends|userinfo]
Tobin Fricke's Lab Notebook

[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

rocket science [Jun. 28th, 2009|03:01 am]
[Tags|, , ]

ICFP programming contest 2009

This year's ICFP programming contest involves planning an optimal sequence of rocket burns to cause an orbiting spacecraft to visit a collection of other orbiting spacecraft. It's a cool problem—orbital mechanics is quite unfamiliar!

Fortunately, the contest contains three warm-up problems. The simplest is to just move from one circular orbit to another, which can be accomplished via the Hofmann transfer orbit (as suggested by the contest specification). The next requires that you meet up with another orbiting spacecraft in circular orbit. I've solved those two. The final warm-up problem is to leave one elliptical orbit to rendezvous with a spacecraft in another elliptical orbit.

The final problem that these warm-up problems lead to is to find an optimal procedure for visiting a collection of other spacecraft in various orbits—here's where the clever searching and optimization will come in.

As an added twist, the individual problems come packaged as binaries for a virtual machine that you have to implement. Unlike prior years, this virtual machine is quite simple. In fact, it has no branching instructions whatsoever, so it's hard to even call it a virtual machine. You could translate it directly into C, for example.

I think my approach is quite slick: I implemented the virtual machine in C, but then wrote a Matlab (.mex) interface to it, so I can implement the rest of my solutions in Matlab, employing all of Matlab's mathematics and visualization and interactiveness while still coupled to this physics engine implemented in the virtual machine.

However, I think it's time for one-man team "tensor" to get some sleep. (-:

EDIT: 24 hours into the contest, they added a moon!
Link1 comment|Leave a comment

C library manpages [Jun. 27th, 2009|03:49 am]
[Tags|, ]

My Ubuntu installation has annoyed me for a long time by not having manpages for the usual C library functions. Of course there's an easy fix:
sudo apt-get install manpages-dev
ahh, such a relief.
LinkLeave a comment

(no subject) [Jun. 25th, 2009|01:24 am]
Looking for the canonical geographical coordinates of the LIGO detectors (in order to correct the Wikipedia entry!), I happened across the document Provenance of Detector Geometry Values in LIGO Frame Files (LIGO document T060064-00).

(Here, "frame files" refers to the file format developed to store data from gravitational wave detectors. I'm not convinced this required a new file format, but that's another story.)

About the metadata stored in these files (at one time back in 2006), this document says:
These values are very wrong! ... The longitude and latitude values are swapped, and are expressed in degrees rather than radians, while the azimuth values are given as radians counter-clockwise from east rather than radians clockwise from north.
/me weeps openly

How much more wrong could you get?

Who let anyone describe latitude and longitude in radians?
LinkLeave a comment

ICFP Programming Contest [Jun. 22nd, 2009|11:31 pm]
[Tags|]

The 12th ICFP Programming Contest will take place next weekend, Friday 26 to Monday 29 June 2009.
LinkLeave a comment

integrated optics [Jun. 17th, 2009|01:49 pm]
[Tags|]

http://en.wikipedia.org/wiki/Photonic_integrated_circuit

Just like tiny electronic circuits (made of transistors, resistors, capacitors, etc) can be produced through photolithography, so can optical devices (presumably made of modulators, lenses, polarized beamsplitters, laser diodes, photodetectors, ... I'm not sure what can be made this way and what can't yet be made).
LinkLeave a comment

z transform [Jun. 3rd, 2009|06:33 pm]
Suppose

y(t) = (d/dt) x(t)

Then take the Laplace transform:

Y(s) = s X(s)

The z-transform is related to the Laplace transform via:

z = exp(T s)

Solve that for z:

s = (1/T) ln z

where |z| = 1.

Now, left to my own devices, I would try to expand this equation about z=0, hoping to get a power series in z^(-1), where, of course, z^(-1) is the delay operator... So we should get a finite-difference approximation to our original differential equation, right? But it fails immediately because the logarithm has a pole at zero.

Question: Can we use this scheme to get a finite-difference approximation to the derivative?

Trivia: Wikipedia tells me that the z-transform was invented in part by Lotfi Zadeh, whom I remember passing in the hallways of Soda hall at Berkeley!
Link3 comments|Leave a comment

to do: learn TikZ [Jun. 3rd, 2009|06:14 pm]
[Tags|]

To-do: Learn to use TikZ to produce beautiful diagrams.

via [info]evan_tech
LinkLeave a comment

requests? [May. 26th, 2009|03:12 pm]
What would you guys like to read about?
Link5 comments|Leave a comment

Installing EPICS and MEDM on Ubuntu linux [May. 20th, 2009|12:41 pm]
Like many physics projects, LIGO uses EPICS (which stands for "Experimental Physics and Industrial Control") for slow control of its real-time machines. What this means is that all of our control panels, with all their buttons and knobs, any many of our slow servos, are implemented through EPICS. While it sometimes shows its age, EPICS is delightfully unixy and provides a very nice separation between the realtime systems themselves and the user interfaces that are used to view and manipulate them. In particular, we can read and write values of process variables from the command line or from the GUI on any machine on the private control system subnet.

Anyway, I wanted to install EPICS and MEDM (the graphical interface) on my laptop.

How to install EPICS on Ubuntu linux )

voilà!

[Screen capture of the LIGO Length Sensing and Control (LSC) control panel]
One of many control screens.
LinkLeave a comment

electromagnetic polarization [May. 18th, 2009|01:53 pm]
[Tags|]

The photon has total spin 1, so the allowed projections of spin along its direction of propagation are -1, 0, and +1. Therefore, naïvely I would believe that the photon (and therefore electromagnetic waves?) would have three polarizations. But for some reason the masslessness of the photon excludes one of these polarizations.

Question: How does masslessness exclude the third polarization?
Link3 comments|Leave a comment

photon wavefunction? [May. 18th, 2009|01:43 pm]
[Tags|]

The Schrödinger equation describes the quantum mechanics of a single massive non-relativistic particle. The Dirac equation governs a single massive relativistic spin-½ particle. The photon is a massless, relativistic spin-1 particle.

Question: What is the equivalent equation giving the quantum mechanics of a single photon, and why don't we talk about it?
Link3 comments|Leave a comment

dyson numbers puzzle solution [May. 18th, 2009|01:37 am]
[Tags|, ]

What integer, expressed in decimal, has the property that, when you take its rightmost digit and move it to the front, it is exactly doubled in value?

We want to find a number X = d1d2d3N (where di are the digits of the number when written in decimal and N is the number of digits) such that

2 × ( d1d2d3⋯dN-1dN) = dNd1d2d3⋯dN-1

which can be written in a more conventional notation as:

2 X = (X - dN)/10 + dN 10N-1

in which the "move the rightmost digit to the front" operation has been expressed in simple arithmetic.

Multiply by 10 and subtract X from both sides to get:

19 X = (10N - 1)dN

Because X is an integer, this tells us that 19 divides (10N-1)dN. Because 19 is prime, this tells us that either (10N-1) or dN (or both) must be divisible by 19. But dN is a single digit, so 0 < dN <= 10, and therefore not divisible by 19, so it must be the (10N-1) part that's divisible by 19. In modular arithmetic we can write this as:

10N ≡ 1 (mod 19)

By Fermat's Little Theorem, we see that one solution to this is N = 18. So our number has eighteen digits.

We now have:
19 X = (1018 - 1) dN

Apparently we get a solution for each possible choice of the final digit dN.

For dN=0 we get the trivial result X=0. Boring.

Choosing dN = 1 we get X = (1019-1)/19 = 52631578947368421. Twice this number is 105263157894736842... It works, but... there's a secret leading zero!

With dN = 2, we get  X = 105263157894736842 and 2X = 210526315789473684, which works.

Apparently this puzzle got a bit of attention after its recent (off-hand) mention in the New York Times. Following that link you might find some easier/better solutions. This also (via co-worker Brian) clued me into the Tierney Lab column/blog ([info]tierneylab) which features puzzles on Mondays, and which just now coined the term "dyson number" for these sorts of numbers. It's a funny attribution since Mr. Dyson has nothing to do with the puzzle, but one must admit it sounds better than "parasitic number."
LinkLeave a comment

notes on polarization and the hairy ball theorem [May. 15th, 2009|10:54 pm]
Electromagnetic waves have two polarizations. The polarization describes the direction in which the electric field is oscillating. In order to describe polarization, we first choose a (possibly time dependent) basis that spans the possible directions in which the electric field vector can point, and then we describe the electric field direction in terms of this basis. The size of this basis gives the number of polarizations. One choice of a polarization basis to describe electromagnetic waves coming from a particular direction is simply {"vertical" and "horizontal"}.

How do we extend this basis to describe electromagnetic waves coming from other directions?

The choice of a polarization basis describing waves coming from one particular direction does not completely determine the bases for waves coming from other directions. We need a mapping from the unit sphere (describing possible directions of propagation) to polarization bases. We can imagine taking a basis from one point on this sphere and parallel transporting it around the sphere. Because parallel transport is path-dependent, this does not determine our mapping.

Even if the natural choice (parallel transport) doesn't work, perhaps we could still arbitrarily choose some vector field over the sphere with which to generate our polarization bases. (At any point, the vector from this field, crossed with the radial vector, gives the second vector in the polarization basis.) Ideally we would really like this vector field to be continuous.

Immediately we run into the hairy ball theorem which says that no such vector field exists.

Instead we can do something like choose our basis to be in the coordinate directions, i.e. our polarization basis for waves coming in from any given direction can be the theta and phi unit vectors at that point on the sphere. This works everywhere except at the poles of the unit sphere, where these unit vectors become undefined.

It seems there is no global basis for polarization which can be used to describe the polarization states of electromagnetic waves coming from different directions. We can only compare polarizations of waves coming from similar directions (a patch of the sphere).

Question: Is this right? The result is highly counter-intuitive. One fact we have not used is that the EM polarization vectors are invariant under rotations of 180° around the propagation vector. Could this equivalence allow us to defeat the hairy ball theorem?
LinkLeave a comment

programming languages [May. 8th, 2009|03:59 pm]
A Brief, Incomplete, and Mostly Wrong History of Programming Languages
1983 - Bjarne Stroustrup bolts everything he's ever heard of onto C to create C++. The resulting language is so complex that programs must be sent to the future to be compiled by the Skynet artificial intelligence. Build times suffer. Skynet's motives for performing the service remain unclear but spokespeople from the future say "there is nothing to be concerned about, baby," in an Austrian accented monotones. There is some speculation that Skynet is nothing more than a pretentious buffer overrun.
via [info]jcreed
LinkLeave a comment

book: the Road to Reality [May. 5th, 2009|12:42 am]
Despite its incredibly pompous title, Roger Penrose's book The Road to Reality: A Complete Guide to the Laws of the Universe turns out to provide a wonderful birds-eye view of a vast swath of physics, with just enough math to keep things concrete. Delightful.
Link1 comment|Leave a comment

gauge potentials [Apr. 26th, 2009|09:01 pm]
[Tags|, , ]

A "gauge theory" is a theory in which our coordinates for the system somehow over-specify the state of the system. In these systems we can do a "gauge transformation", in which we perform a change of coordinates entirely within the realm of this redundancy, such that the new coordinates represent the same system.

Perhaps the simplest example is the gravitational potential. If Φ is the gravitational potential, then the acceleration of a test particle due to gravity is given by its gradient:

g = - grad Φ

This system is invariant under the gauge transformation that adds any constant value to Φ; that constant disappears in the gradient.

The electric and magnetic fields E and B may be computed from the scalar and vector potentials φ and A:

E = - grad φ - (d/dt)A
B = curl A

These equations are invariant under the gauge transform

A goes to A + grad ψ
φ goes to φ - (d/dt) ψ

where ψ(x,t) is any (sufficiently differentiable) scalar field.

The wikipedia article says that the existence of this gauge freedom up to any function ψ(x,t) means that the gauge freedom of electromagnetism is U(1), i.e. the group of the complex numbers of absolute value 1.

Question: I don't see the connection [no pun intended!]. How does choice of ψ(x,t) imply U(1)? What does the group describing the gauge freedom really mean?
Link7 comments|Leave a comment

puzzle [Apr. 26th, 2009|07:23 pm]
[Tags|, ]

via [info]mathematics:
What integer, expressed in decimal, has the property that, when you take its rightmost digit and move it to the front, it is exactly doubled in value?
Corollary puzzles: tripled in value, quadrupled, etc...
Link3 comments|Leave a comment

article: Swimming in Spacetime [Apr. 26th, 2009|05:22 pm]
[Tags|, , , , , ]

Jack Wisdom, "Swimming in Spacetime: Motion by Cyclic Changes in Body Shape," Science 299, 5614 (21 March 2003); Also AIM-2002-017.

Floating in the vacuum of an entirely empty space, one can flail around as much as one likes, but there's no way to move from one place to another without flinging mass away from you (such as with a rocket engine). Nonetheless, you can change your orientation. By flailing in just the right way, you can turn yourself from one orientation to another, juts as a cat falling upside-down is able to right itself and land on its feet, rotating 180° while in freefall. It turns out that in a curved space, a similar trick exists, allowing one to "swim" from place to place even without having anything to push against. A two-dimensional insect living on the surface of a frictionless sphere would be able to swim around, as would a galactopus living in a region of highly curved spacetime, such as near a black hole.

Shapere and Wilczek (Eds.), Geometric Phases in Physics (1989).

The mathematics behind the geometric swimming effect is quite elegant. The swimming effect is "geometric" in the sense that it is velocity-independent; the translation due to a certain swimming stroke ("cyclic change in body shape") is entirely determined by the sequence of shapes assumed. It is related to the area enclosed by the path through shape-space describing the swimming stroke! The formalism for this geometric swimming is described by Shapere and Wilczek in "Gauge Kinematics of Deformable Bodies" (Am. J. Phys. 56, 6 (1989)).

Interestingly, the same formalism may also be applied to organisms swimming in viscous fluids, as described by Shapere and Wilczek in "Geometry of self-propulsion at low Reynolds number" (J Fluid Mech 198 (1989) 557-585). Here the equations are much more complicated, as the effect arises from hydrodynamics rather than simple conservation of angular momentum. Purcell's talk, "Life at low Reynolds number" is an entertaining introduction to this regime.

What other subject brings together black holes, micro-organisms, and magnetic monopoles?
Link2 comments|Leave a comment

logarithmic derivative [Apr. 15th, 2009|01:49 pm]
[Tags|]

The logarithmic derivative is kind of a cool trick: it turns out that the operation that maps a function to that function's derivative divided by the function itself

logarithmic derivative: f ↦ (Df)/f

obeys the same product, quotient, and power rules as the logarithm. This can be used to take derivatives more esily (i.e. with smaller expressions) since the product rule is simpler. I probably learned this trick in high school, but had long since forgotten it.

One cute application (which is where I just re-encountered the trick) is in matching two pieces of a wave function at a boundary. Suppose that on the left of a boundary you have a wavefunction C1ψ1(x) and on the right you have C2ψ2(x), where C1 and C2 are normalization constants not yet determined. The boundary conditions are that the value of the wavefunctions and their first derivatives must match at the boundary:

C1ψ1(0) = C2ψ2(0)
C1ψ1'(0) = C2ψ2'(0)


However, since we don't care about the actual values of the normalization constants at this time (we'll normalize the whole thing later), we can condense these two requirements into one: simply match the logarithmic derivatives of the two pieces of wavefunction at the boundary. The constants C1 and C2 cancel out.
Link2 comments|Leave a comment

article: synchronized chaos [Apr. 14th, 2009|09:04 pm]
[Tags|, , , , ]

Pecora and Carroll (1990). "Synchronization in Chaotic Systems," Phys Rev Lett 64, 821

Cuomo and Oppenheim (1993). "Circuit Implementation of Synchronized Chaos with Applications to Communications," Phys Rev Lett 71, 65.

as cited in Nonlinear dynamics and Chaos by Steven Strogatz (p 335-41).

as used in the Caltech course CDS 104 Introductory Concepts for Dynamical Systems.

The Lorenz attractor is a system of three coupled non-linear differential equations that exhibits an extreme sensitivity to initial conditions yet remains bounded within a butterfly-shaped region of phase space, the 'strange attractor'; it was one of the first discovered chaotic systems.

Pecora and Carroll discovered that one can feed part of the state of one Lorenz system into a second Lorenz system, and the second Lorenz system will exponentially converge to the same state as the first system, even if the synchronizing signal is corrupted with noise(!). It's like some kind of psueodrandom, chaotic "phase locked loop"—very exciting.

Cuomo and Oppenheim implement the Lorenz differential equations in analog electronics using a simple Op-amp based circuit, and then use it as a pseudorandom noise source to corrupt an analog message (i.e. a voice signal); they then build a second electronic Lorenz system, synchronize it to the first, and subtract the resulting psuedorandom signal from the corrupted signal to recover the original message.

Excellent fodder for some rainy day Matlab fun...
LinkLeave a comment

navigation
[ viewing | most recent entries ]
[ go | earlier ]

Advertisement