Archive for April, 2007

The death of Purgatory Limbo

Friday, April 27th, 2007

I was just speaking with the other ACM students today about this: the Pope has declared that there is no longer a purgatory. I guess now that the Church isn’t using it as a way to embezzle money out of people, Purgatory no longer serves a purpose.

I was just speaking with the other ACM students today about this: the Pope has declared that there is no longer a limbo. Highlights from the original article:

The Roman Catholic Church has effectively buried the concept of limbo, the place where centuries of tradition and teaching held that babies who die without baptism went.

Limbo, which comes from the Latin word meaning “border” or “edge”, was considered by medieval theologians to be a state or place reserved for the unbaptized dead, including good people who lived before the coming of Christ.

In writings before his election as Pope in 2005, the then Cardinal Joseph Ratzinger made it clear he believed the concept of limbo should be abandoned because it was “only a theological hypothesis” and “never a defined truth of faith”.

So limbo is not purgatory, as a commenter pointed out.

I’ll try to be more careful in the future.

Today’s reading schedule

Wednesday, April 25th, 2007
  • Biology by Neil Campbell and Jane Reece. Because it’s good to know that stuff.
  • Introduction to Stochastic Integration by Hui-Hsiung Kuo. Because I need to know this stuff for my stochastics control course, and this seems to be on just the right level for me. I’d started this book a while back, but now I bought it, so hopefully I’ll finish it, or at least get through Girsanov’s theorem.
  • A Multigrid Tutorial, by Biggs, Henson, and McCormick. Because this book, and multigrid, are great! I read 3 chapters yesterday, so I’m going to see if I can get a couple more today.

My approach to finite difference coding in Matlab

Monday, April 23rd, 2007

As part of an assignment, I had to write Matlab code to solve Poisson’s equation in a trapezoidal domain, by transforming the equation and the BCs to the unit square. The transformed PDEs were ugly, and figuring out the structure of the associated system matrix didn’t seem like fun, so I wrote up some pretty neat SICP-inspired utility code that makes coding finite differences (on a uniform grid in a square domain) pretty darn easy.

The idea behind it is that the real devil in writing fd code is that you have transform a grid function (say you’re solving for u on a square domain) into a vector so you can use linear algebra to solve for it; your neighbor relations go all wacky when you do this, so it’s hard to write out the system matrix that arises. The best way, IMHO, to defeat this devil is to delegate responsibility for coordinate management– write everything in terms of the original grid coordinates and let the computer handle the translation to vector coordinates (I’ve heard they’re good at those sort of brainless tasks).

At the heart of the system are two functions:

  • indices = gridtovect(X, Y, N)– which given vectors of grid x-coordinates X = [x1, x2, ...] and grid y-coordinates Y= [y1, y2, ...] and a gridsize N returns the linear indices of the points (x1, y1), (x2, y2), ... (using the transformation (i,j) \mapsto j + (i-1)N).
  • indices = tensorind(X, Y, N)– which given vectors of system matrix coordinates X = [x1, x2, ...] and Y= [y1, y2, ...] and a gridsize N, returns the linear indices of the system matrix coordinates (x1, y1), (x2, y2), ... (recall in Matlab you can treat a matrix of arbitrary dimension as a linear vector; the index transformations are done with ind2sub and sub2ind)

For convenience these functions will assume if you pass in a constant in place of a vector, that you mean a constant vector of appropriate size. Using these, I constructed functions which modify the system matrix, adding a system of equations that all of the indicated points of the grid must satisfy, e.g.:
[code]
% given a system matrix A, and x,y pairs in column vectors X,Y, modifies
% the entries in A to add a 2nd order accurate centered finite difference
% term to approximate the x-deriv, centered at each x,y pair; accepts a
% vector field c to multiply each FD by, and the step size dx
function A = centerFDd1x(A, X, Y, dx, c, N)
self = gridtovect(X, Y, N);
lft = gridtovect(X-1, Y, N);
rt = gridtovect(X+1, Y, N);

A( tensorind(self, lft, N) ) = …
A( tensorind(self, lft, N) ) + c * -1/(2*dx);
A( tensorind(self, rt, N) ) = …
A( tensorind(self, rt, N) ) + c * 1/(2*dx);
end
[/code]

Using my problem as an example, the pde that had to be satisfied by the points on the interior of the square was

u_{xx} \frac{4 (h^2 + a^2 x^2)}{(b+2 a y)^2} - u_{xy} \frac{4 a x}{b + 2 a y} + u_x \frac{8a^2 x}{(b+ 2 a y)^2} + u_{yy} = -h^2

Here’s how I added the entries for the interior nodes to the system matrix (the names of x and y were changed to xi and eta to protect the innocent to serve as a reminder that this is in a transformed domain):
[code]
%% setup the interior PDE
%% u_{xi, xi} c1(xi, eta) + u_{xi, eta} c2(xi, eta)
%% + u_{xi} c3(xi,eta) + u_{eta, eta} = -h^2
xi = dxi:dxi:1-dxi;
for grideta = 2:N-1
eta = (grideta -1)*dxi;
c1 = 4*(h^2 + a^2*xi.^2) / (b + 2*a*eta)^2;
c2 = -(4*a*xi) / (b + 2*a*eta);
c3 = 8*a^2*xi / (b + 2*a*eta)^2;

% u_{xi, xi} c1(xi, eta)
A = centerFDd2x(A, 2:N-1, grideta, dxi, c1, N);
% u_{xi, eta} c2(xi, eta)
A = asymFDdxy(A, 2:N-1, grideta, dxi, c2, N);
% u_{xi} c3(xi, eta)
A = centerFDd1x(A, 2:N-1, grideta, dxi, c3, N);
% u_{eta, eta}
A = centerFDd2y(A, 2:N-1, grideta, dxi, 1, N);

self = gridtovect(2:N-1, grideta, N);
f(self) = -h^2;
end
[/code]

Check out the code if you’re interested (the top stuff was for my particular problem, the reusable code’s at the bottom).

Jumper is being made into a movie!

Monday, April 23rd, 2007

I freaking loved Jumper. At some point in middle school, I think (maybe high school), I sat down at a bookstore in the mall and read it from cover to cover, in one sitting– I suppose that at that time coming of age stories really spoke to my (pre?)teen existential angst. I don’t remember much more about it than the blurb on Amazon offers, except I recall thinking this was the first author I’d seen take the peril of teleporting into solid objects seriously. If I recall correctly, the kid ended up teleporting while enclosed in a phone booth for protection. Not as cheesy as it sounds.

Now the book’s being made into a movie, which I’m going to go see, despite the fact that it has Samuel L. Jackson in it, and despite the fact that the originality of the book will probably be lost in translation. Apparently they’re going to make it into a trilogy. I didn’t fancy LOTR, but I appreciate the impact it’s had on Hollywood– Jumper is not the type of book I’d have expected to be made into a movie, much less a trilogy.

Just found out there’s a sequel to Jumper, Reflex, so I’ll have to check that out too. Also, while looking up info on Jumper the movie, I came across this interesting examination of coming-of-age stories and gender stereotypes. He has a good point about Buffy and Xena: they do subvert gender stereotypes somewhat awfully. As he says, Buffy’s boyfriends were more like appendages than lovers– well, once she got past Angel–; for instance, Riley was just a big sex toy that she used and discarded; that’s definitely more in line with a male hero who gets a different gal every show (e.g. Captain Kirk, James Bond, etc. ad nauseum), except she went through them slower. Didn’t like that aspect of the show too much– I prefer my heroes to be monogamous, whether male or female. And Xena was definitely more concerned with ethics than finding a place to fit in– the whole theme of a guilty conscience leading you to fight the good side seems very masculine. I suppose the same kind of analyses apply to La Femme Nikita and Alias. Assuming that these vague arguments hold any water, maybe it was these subversions that made me love these shows so much.

“The trouble with Islam”

Sunday, April 22nd, 2007

Learning more about Islam has been in the back of mind for a while now– since that debaucle with the irreverent cartoon depictions of Mohammed– but I hadn’t found any books that promised to hold my attention. Apologetics don’t count: by nature such books would be dismissive of any serioous arguments against Islam. And I’m looking for the dirt, after all– religions are boringly consistent in proclaiming that they have the truth– that’s my measure of a religion: the degrees and kinds of inanity it promotes. Compared to Christianity, it has been surprisingly difficult to get ahold of serious commentaries on Islam (not that I have done an exhaustive search). It is simply not enough to spout out what the Quran says: I could read it myself if I cared to. Instead, I’m looking for information on the social and political impact of the Quran. My litmus test so far has been, if the book doesn’t at least mention the fact that under Sharia, rape victims have been lashed and stoned for adultery, it’s not worth looking at.

Today I found two candidates: Infidel and The Trouble with Islam. It was a tough decision, but I settled on the second, mainly because it was written by a lesbian Muslim. Given that women and homosexuals are the most oppressed persons in the Islamic world, it should be an interesting read. There’s the obvious question of how she reconciles being a lesbian with Islam. It’s shocking to me when Christians manage that, and I’ve always viewed Christianity as a more plastic religion than Islam.

Katiya is now a world famous artiste

Saturday, April 21st, 2007

Katiya Pavlova, one of my fellow first year grads in the ACM, is now famous. Just kidding. But it’s nice that she’s being acknowledged.

An idea for future implementation

Friday, April 20th, 2007

I’m going to start a collection of links like the other Alex’s, because I come across so much good material that isn’t on his list. At this point I could easily double the material in the probability and applied math sections. I’d have a spot for people to email me suggestions, too– although I troll the web looking for reading material, knowing I won’t have time to read it all, I’m sure there’s some good stuff I’ve missed. Since I have no other use for it currently, I’d probably post the site on my school site, rather than here.

Separation of variables, or how I’m learning to ignore the math, and just take the Fourier expansion

Tuesday, April 17th, 2007

So I was just talking to the new French exchange student about math. He does harmonic analysis — Littlewood-Paley theory– and other comparatively stratospheric stuff. Meanwhile I’m stuck trying to solve the following basic PDE using separation of variables:

 u_t = k u_{xx} + Q(x,t); u(x,0)=f(x); u(0,t)=A(t); u_{x}(L,t)=0

I’d rather be doing the stratospheric stuff, but I suppose one must start with the basics (must one?)

I like how my poison of choice (i.e. my reference book to supplement what’s covered– or, more often, not– in class ) explains the use of eigenfunction expansions in the method of separation of variables:

In our case, the generalized superposition principle implies that the formal expression [solution as Fourier expansion] is a natural candidate for a generalized solution of [the heat equation]. By a ‘formal solution’, we mean that if we ignore questions concerning convergence, continuity, and smoothness, and carry out term-by-term differentiations and substitutions …

Nice, huh? Now I have to figure out how to use separation of variables to solve that problem above. Funny how most examples of separation of variables are done on problems with no source terms and homogeneous BCs. Well, not really that funny.

Update
By the grace of Kevorkian, I finally got a straight answer on how to solve nonhomogeneous PDEs (or at least the heat equation) with source terms, using separation of variables. In the case above, there’s an obvious (in hindsight) trick, but there’s a change of variables technique behind the trick that works in less obvious situations. I’ll post about it later. Got to go finish this problem (I’ve been working on it for about 5 hours now). Damn I feel stupid.

The smell report

Tuesday, April 17th, 2007

The smell report. Read it. The conclusion is: fresh sweat smells good, stale sweat smells stink. So you should go take a bath. And I should be working on my quiz.