|
Tobin Fricke's Lab Notebook
|
|
|
| rocket science |
[Jun. 28th, 2009|03:01 am] |

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! |
|
|
| article: Swimming in Spacetime |
[Apr. 26th, 2009|05:22 pm] |
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? |
|
|
| free particles and pendula |
[May. 10th, 2008|11:24 pm] |
Consider an (otherwise) free particle; what's the transfer function from an external force to the position of the particle? Start with the basics:
F = ma
where F is the force, m is the mass of the particle, and a is its acceleration.
What this really means is:
F(t) = m (d/dt)^2 x(t)
Take the Laplace transform. The second derivative turns into s^2.
F(s) = m s^2 x(s)
The transfer function is the ratio of "output" over "input":
H(s) = x(s)/F(s) = (1/m) (1/s^2)
The transfer function consists of two poles at zero, and a gain given by the inverse of the particle's mass.
Now consider a simple harmonic oscillator. We have:
F = ma + kx
where k is the spring constant. The Laplace transform is:
F(s) = (m s^2 + k) x(s)
so the transfer function is:
H(s) = (1/m) 1/(s^2 + k/m)
This transfer function has two poles, at +/- i Sqrt(k/m).
Note that when |s^2| > |k/m|, i.e. above the resonant frequency of the oscillator, the mass behaves like a free particle. |
|
|
| Numerical integration |
[Sep. 26th, 2006|01:07 pm] |
Maybe this is obvious. I was having trouble with my numerical integration of the geodesics of the Poincaré metric. Momenta that were supposed to be conserved weren't, and neither was the Hamiltonian. My integration was very simple; using some small timestep I advanced the state of the system:
![\left\{ \begin{array}{l} t' \leftarrow t + dt\\ q' \leftarrow q + \dot{q} dt\\ \dot{q}' \leftarrow \dot{q} + \ddot{q} dt \end{array} \right.]()
The integration became vastly more accurate with this little freshman-physics change:
![\left\{\begin{array}{l}t' \leftarrow t + dt\\q' \leftarrow q + \dot{q} dt + \frac{1}{2} \ddot{q} (dt)^2\\\dot{q}' \leftarrow \dot{q} + \ddot{q} dt\end{array}\right.]() |
|
|
| SICM 1.7: Evolution of dynamical state |
[Sep. 14th, 2006|04:49 pm] |
(Readings: SICM 1.7: Evolution of dynamical state)
The state of a mechanical system can be specified by a tuple containing the time (which is only needed if some parameter is time-varying), the coordinates of the machine's configuration at that time, and some number of higher derivatives of those coordinates. For many systems, only the first derivative (generalized velocity) is needed. The state of simple system (such as a pendulum) with one degree of freedom may be specified by giving the time, the coordinate, and the derivative of the coordinate: {t, q(t), Dq(t)}. This is called the state tuple.
Given a Lagrangian for the system, we can solve the Euler-Lagrange equations to get the next higher derivative. We can then write a function (called the "system derivative") that takes a state tuple and returns the derivative of the state tuple. Given this derivative, we can numerically integrate the state tuple to see how the system evolves in time from a given initial state.
I implemented this in Mathematica.
( code )
We find that the derivative of the state of a simple pendulum is (1, qdot, -(g/l)Sin[q]) where the current state is given by (t, q, qdot). We can integrate this numerically to see the evolution of the state of the system given an initial condition:
( code )
It works very nicely, but we see that, because of errors in the numerical integration, the orbits are not closed. I suppose I need to dig up a numerical integration technique better than f(t+dt)=f(t)+f'(t)dt. |
|
|
| navigation |
| [ |
viewing |
| |
most recent entries |
] |
| |
|
|