Archive for April, 2005

A cool proof of what exactly?

Friday, April 29th, 2005

Today, we had a review in preparation for our test on Monday on differential forms, and I saw the first concrete example of the power they give you. Now I’m even more enamored of them. Here’s the example:

Let \displaystyle \eta = \frac{x dy - y dx}{x^2 + y^2} in \R^2\backslash\{\vec{0}\}.

  1. prove: d \eta = 0
  2. Let \gamma : [0, 2\pi] \rightarrow S^2 be defined by  t \mapsto (r\cos t, r \sin t). Compute \int_\gamma \eta .
  3. Let \Gamma be any C^{\prime\prime} curve in \R^2\backslash\{\vec{0}\} from [0,2\pi] with \Gamma(0) = \Gamma(2\pi) such that for all t \in [0,2\pi], the interval [\gamma(t), \Gamma(t)] does not contain \vec{0}. Prove \int_{\Gamma} \eta = \int_{\gamma} \eta.
  4. Awesome application: \displaystyle \int_0^{2\pi} \frac{ab}{a^2\cos^2 t + b^2 \sin^2 t} dt = 2 \pi.

All except for the second to last are pretty easy. Once you see how to prove the second to last, it’s not only easy, but enlightening. So here’s the proof:

Define a 2-surface \Phi : [0, 2\pi] \times [0,1] \rightarrow \R^2\backslash\{\vec{0}\} by (u,v) \rightarrow (1-u)\Gamma(t) + u \gamma(t). Notice by the special condition, the image of \Phi does not contain \vec{0}. \partial \Phi consists of 4 pieces:

  1. \Gamma : [0, 2\pi] \ni t \mapsto \Gamma(t).
  2. \Theta: [0,1] \ni u \mapsto (1-u)\Gamma(2\pi) + u \gamma(2\pi).
  3. \gamma: [0, 2\pi] \ni t \mapsto \gamma(t) .
  4. \Theta: [0,1] \ni u \mapsto (1-u)\Gamma(0) + u \gamma(0) = \Gamma(2\pi) + u \gamma(2\pi).

Applying Stokes’ Theorem:  0 = \displaystyle \int_\Phi d\eta = \int_{\partial \Phi} \eta = \left( \int_\Gamma + \int_\Theta - \int_\gamma - \int_\Theta ) \eta \Rightarrow \int_\Gamma \eta = \int_\gamma \eta.

Looking at this now, it seems like something similar to this holds for any 1-form \eta with d\eta = 0. … And now after thinking about it some more, that looks like a conservative vector field– or whatever it is that gravity is.

Topology

Thursday, April 28th, 2005

School has been very busy lately– I had a test on Monday, and two on Tuesday, and a lab due today– but I’m seeing the light at the end of the tunnel: summer. If I knew for certain that the offer to do math research this summer with a prof here at UH still stands, then I’d be set.

Despite the best efforts of my professors to deprive me of an increments of free time with duration of more than 5 minutes, I’ve been able to continue trying to gain the background necessary to understand differential forms in their natural setting of manifolds. I’m still reading Vector Analysis by Kanich, but at a snail’s pace, and skipping a few ideas; my entire goal with that book is to just get the gist of the stuff before differential forms so I can study that section, and then stop. I’m not ashamed to admit that book is way over my head– I wonder if it has to do with the fact that it was written for students studying under a German curriculum? A friend who’s also trying to learn differential forms pointed out to me a Cal. I book used in Germany that covers everything we’re doing in Real Analysis, an American senior level course (at UH, the hardest, hands down)!

More productively, I’m reading ‘Introduction to Topological Manifolds’ by Lee, and am finding it smooth going. Weird, considering that Vector Analysis is in the Springer undergraduate series, and Lee’s book is in the graduate series. Lee seems to expect less of his readers, and spends more time on the basics. I now have a firm grasp of what a manifold is: a second countable, Hausdorff, locally Euclidean topological space, and even more importantly, why it is defined that way. Even the exercises are interesting. Unfortunately, Lee’s book doesn’t cover differential forms (maybe those can’t be defined on topological manifolds without extra properties?), but it is interesting in itself, and will probably make it a lot easier to read about differential forms in the future. An unexpected side-effect of my reading is a new found interest in topology itself, which before I couldn’t really get into, except to see that the definition of a topology is pretty cool. With the examples Lee gave, I finally saw the connection between deformation of surfaces— you know, how people explain topology by talking about how it shows certain things are equivalent in special ways, like a donut and a coffee cup, as if that really explains anything in a useful way—, topology, and that weird term, homeomorphism.

Add to that, I just got “How the Universe Got Its Spots” by Janna Levin yesterday, who seems to be a cosmologist concerned with the topology of the universe, as well as an engaging writer, and it seems that I may be distracted from my primary goal of differential forms, and go off on a tangent into topology. Oh well, that always seems to happen.

Geodesics and Metrics

Friday, April 22nd, 2005

Today Dr. Bao gave the math department’s weekly ‘Graduate Student’ Seminar, which it seems like graduate students never give. He spoke about the relation between geodesics and metrics– a different perspective on constructing metrics, the problem of determining the geodesics of a given metric, and the inverse problem of determining a metric given the geodesics.

In relation to the last problem, he showed that the problem of geodesics to metrics is naturally suited to Banach spaces rather than Hilbert spaces, since not all geodesics give rise to a true norm, much less one that is induced by an inner product.

He used only three examples to illustrate his point. The first, he used to show that it can be fruitful and interesting to consider a metric defined in time instead of speed. Specifically, if c is a strictly positive function on the domain being considered and v \cdot v is the standard inner product in your space, then
 \|v\| = \frac{\sqrt{v \cdot v}}{c} is a norm with properties that depend upon where the vector is anchored. The first example was
 \|v\|_x = \frac{\sqrt{x\cdot x}}{1 - \frac{\|x\|^2}{4}} , where \|x\| is the standard norm, and the space being considered is the open ball around the origin of radius 2.
In this universe, it takes a really long time to visit your neighbors if you and they live on the outside of the ball. The geodesics in this space are radial straight lines and arcs on the surface of balls centered outside of the universe that intersect it at right angles. On the other hand, in his second example,
 \|v\|_x = \frac{\sqrt{x\cdot x}}{1 - \frac{\|x\|^2}{4}} ,
the farther from the origin you and your neighbor live, the quicker you can reach each other. I’m going to try to reason out the geodesics in this space.

The final example, on ‘Zermelo Navigation’, disagreed with my intuition, so I’m still puzzling it out. Basically, it is concerned with the fastest paths taken by a person at the center of a rotating disc attempting to reach a fixed point on the perimeter, and attempting to reach the center of the disc from a fixed point on the perimeter. The geodesics in this example are spirals, both ways. (What are the geodesics between points in the interior of the disc? :)) What I don’t get is why, as he stated, it takes less time to go out than to come back in. Also, this is a case of the norm not being induced by any inner product.

Matplotlib

Wednesday, April 20th, 2005

Yet another reason to learn Python is matplotlib, a matlab like system for creating plots, graphs, and charts. It seems a lot more of the style of system that one would want to use on the Web than say IllustRender :), at least for plots, graphs, and charts. Probably IllustRender would be a better system for general diagrams. I’m also planning to get that up and working here, so I can mess around with graphs. It’s already installed on the server, just needs a LaTeXRender-like frontend.

jsMath

Wednesday, April 20th, 2005

I can’t believe I’ve never heard of this before, but it seems like a viable alternative to LaTeXRender, for those people who either want their site to be pure (no images), faster loading, is worried about the security issues inherent in using a CGI system like LaTeXRender, or don’t have access to TeTeX:

jsMath is a JavaScript implementation of the TeX mathematics rendering engine— so you can enter TeX code n the way you are accustomed! And it looks incredibly comprehensive; better than any other system I’ve seen that uses character level manipulation to typeset math. You can see it for yourself by following the examples link from the homepage.

When I first visited the site, I didn’t have the TeX fonts installed, and the examples looked comparable in quality to one of those sites where the math images seem to have been scanned in: i.e., not too bad, but a little pixelated. If I hadn’t known what was up, I would have assumed they were poorly scanned images. So the system definitely has reasonable results even if you don’t have the special fonts installed. If the fonts are installed (I downloaded them and revisited the examples pages), the quality is incredibly good.

It would be cool if LaTeXRender supported jsMath in the same way it supported MimeTeX; then people who can’t install TeX would have another (maybe better) alternative. I intend to hack up the LaTeXRender system I’ve installed at some point, to support switching between using actual LaTeX and jsMath for rendering– I intend to hack it anyhow, because it’s pointless to keep using div tags to simulate display environments when that could easily be added into LaTeXRender directly.

Differential forms

Sunday, April 17th, 2005

My latest mathematical struggle: differential forms. As an aside, it seems like once we hit Chapter 8 in “Principles of Mathematical Analysis”, the material is dimensions harder than it was before. I’m having trouble visualizing everything, and for me math is usually a very visual process. A lot of this higher analysis stuff (which I define as that which starts in Chapter 8 of Rudin :) ) is based on topological concepts/linear algebraic concepts— pull backs, rank of mappings, etc— that I’m just not comfortable with, yet. And all of it seems to have a more ‘natural’ home on manifolds.

Differential forms are, to me, abstractions of the change of variables formula which makes it possible to define integration over abitrary surfaces. I remember when we had to do volume or line integrals in my static EM class, we did a lot of hand-waving and suspicious sign fiddling— differential forms give a rigorous form to this whole process. It took me a while to get this, due to the new terminology, the use of the wedge product, and the hype surrounding it in general (e.g. generalized Stokes Theorem), plus the fact that the ‘natural’ setting for them arose in tensor calculus on manifolds, blah blah …

But they really aren’t that bad. Rudin has a weird definition though; if I were writing a book, I would try to come up with something a little less off-putting. Maybe that was his intent though, to get the reader paying close attention. I don’t think I would have paid much attention if he had explicitly pointed out the connection to the change of variables theorem.

Perfect Reconstruction, but not really

Friday, April 15th, 2005

Interesting seminar today, given by Bernhard, one of the guys in the Functional Analysis group here at UH: it was about the \Sigma \Delta method of sampling used in the SACD (super accurate CD ?) encoding method.

What was most interesting was what he mentioned about the perfect reconstruction guaranteed by the Sampling Theorem. Recall that the Sampling Theorem says if you sample a signal f at twice the maximum frequency present in the signal, then you can reconstruct the function (well, a function which differs from the original function over a set of measure 0 at most) using the formula

\displaystyle f(t) = \sum_{n=-\infty}^\infty f\left(\frac{n\pi}{\omega}\right)  \frac{\sin \omega( t - \frac{n \pi}{\omega})}{\omega( t - \frac{n \pi}{\omega})},

where \omega is the maximum frequency present in the signal.

In practical (i.e. engineering) uses, the function values f_n \equiv f\left(\frac{n\pi}{\omega}\right) are quantized to values p_n so that |f_n - p_n| \leq \epsilon for some error \epsilon which can be decreased by increasing the number of bits used for the quantization. Using PCM (pulse code modulation), the current technique for rounding used on CDs, one rounds the value of f_n to the nearest quantization value. The idea is that if this holds true, then as the number of samples increases (since we calculate the sum in the above formula over a finite range -N to N), the approximation obtained for f becomes more accurate. This idea is actually wrong, in general!

The error in reconstruction is

\displaystyle \left| \sum_{n=-N}^N (f_n - p_n)  \frac{\sin \omega( t - \frac{n \pi}{\omega})}{\omega( t - \frac{n \pi}{\omega})} \right|,

so if it happens that using PCM f_n - p_n = (-1)^{N-n} \epsilon , the error terms add up (since the sign switching of the \sin term is canceled), and it becomes


\displaystyle \left| \sum_{n=-N}^N (f_n - p_n)  \frac{\sin \omega( t - \frac{n \pi}{\omega})}{\omega( t - \frac{n \pi}{\omega})} \right| = \epsilon (2N+1) \sin(wt)\sum_{n=-N}^N \left|\frac{1}{\omega t - n \pi}\right|,

which clearly increases as N increases. So instead of decreasing as the number of samples increases, the error increases!

In the remainder of the seminar, he talked about two things: a smarter way to quantize, \Sigma \Delta, and a way to choose a better reconstruction function s_\Omega (used in construction with oversampling above the ratio of 2) with better properties, which guarantees that the error can’t blow up in such a manner.

I believe somewhere I got his arguments mixed up, because looking at what I have here, I don’t see how \Sigma \Delta would help avoid the problem of blowing up errors, but it was clear from his presentation. There are probably a few other errors too :) (for instance, his error term turned out to be asymptotic to \ln, but mine is to \cot if anything).
But the message is there.

The problem of finding an optimal s_\Omega is interesting in it’s own right. Here are the required properties: \int_\R |s_\Omega^\prime(x)| \, dx should be as small as possible, and \hat{s}_\Omega should be 1 on the interval [-\Omega, \Omega, be at least C^0, and have as small support as possible.

Downloading images

Friday, April 15th, 2005

Every once in a while, I come across a site with loads of stuff that I’d like to download to my own computer, without the hassle of using a browser to do so manually. Here’s a combo wget and perl solution to the problem; since I rewrite essentially the same thing everytime I run into this situation, I figured I might as well make a solution once and for all. Basically, the perl script rips all the urls from a file (like a bookmark file exported by Opera in HTML format), and the wget script downloads the files to a directory, in a manner friendly to the other webserver (i.e., not demanding a lot of bandwidth). The perl script assumes that you have at most one url, possibly surrounded by other text, per line in the input file.

[perl]
while(<>) {
m/href=”(.*)?”/;
print “$1\n”;
}
[/perl]

Call the perl script like this : perl extract_urls.pl input.html > get.lst . Then invoke wget like this: wget -w1 --random-wait -nH -nc -r -k -i get.lst. It will get all the files into the current directory, and convert the links to local, so you probably will want to run this process in an appropriately named subdirectory.

Wordform!

Thursday, April 14th, 2005

So, looks like there’s competition for mindshare with Wordpress: Wordform is another blogging software based on Wordpress that seems to have inherited all the good features of Wordpress and extended it in some ways. I haven’t been able to extract much information from the website by cursorily glancing at the loads of posts, but from the screenshots, especially of the WYSIWYG interface for editing, its worth considering.