Wednesday, July 14, 2010

variational forms (for the non-mathematical)

In the last post, I mentioned that certain theologies of creation reminded me of variational forms, a mathematical idea in the realm of differential equations. Allow me to present a brief crash course on the math behind the ideas.

Scientists and engineers are interested in partial differential equations (PDEs). They model basically all physical phenomena, from biology to physics to everything in between - most computer simulations involve solving PDEs (like car crash testing, or airplane modeling). They might look like


So the double derivative of u w.r.t. x is equal to some function "f(x,y)". There are many examples, all on Wikipedia (heat equation, wave equation, Navier Stokes equations, etc etc) and all with physical meaning, but for now, we'll focus on the math.

In formal mathematics, before ever solving this, it's necessary to prove a solution even exists. Additionally, most of the time we solve these problems on computers using approximations...and the reason that existence of solutions is important is precisely because of these approximation methods. Approximation methods, on an abstract level, search a "space" of functions for a function that is close to the solution of the PDE. However, unless a solution exists, it's pointless to try to approximate it. Let me illustrate.

I'm sure most of you have played the game where you have 3 or 4 hole shapes, and a set of blocks. The goal is to put all the blocks through the correct hole (triangle goes in triangle hole, circle goes in circle hole, etc etc).



I'm going to use the following analogy for the rest of the post. Imagine a game where you have such a set of blocks, and just one hole. That set of blocks is like the "space" of functions that we search for a solution, and the hole is like the PDE - it tells us what the solution should do (i.e. fit in the hole, or in the PDE sense, satisfy the equation).


Now, imagine that instead of our set of blocks, we get something akin to Legos - we may not have the block that fits in the hole, but if we get make our collection of Legos more and more diverse, we may be able to build something that fits in the hole. This is basically what PDE solvers are doing - they try to build a solution/block that fits in the hole/PDE. However, pretend the hole is fake or doesn't go through all the way. This is akin to the problem not having a solution - you can search all you want in the Legos, but you will never be able to force anything through that hole.

So far, it's been pretty straightforward, right? Build a block that fits into the hole. Get more pieces if it doesn't and keep trying. However, if you think about it, we may not actually want the "solution" block that we build to fit through the hole itself. Imagine, for example, the edged corners of legos. Pretend our hole is a circle.



You could get a good approximation to a circle from squares, but the edges of the squares would prevent the approximation from fitting in the hole (unless you cut them off, like in the above pic). If you did actually get the approximation to fit, it would probably look smaller than the circle that would actually fit in the hole.

Hence, we get to the idea of "relaxing constraints", which is a large part of what variational forms do. Basically, we change the rules of our game - we're no longer looking to build something that fits in the hole, we're now trying to build something that looks like something that would fit in the hole. In other words, we're relaxing the constraints on our solution, changing it from "needs to fit into hole" to "needs to look like something that fits into the hole".

How does this look mathematically? Take our old equation


and pretend we multiply it by some random differentiable function "v(x)" for no reason, and then integrate it from 0 to 1. If v = 0 when evaluated at both x = 1 and x = 0, then we can integrate it by parts. What this reduces to is a so-called "variational form" of the equation.


The subtle difference is in the derivatives - notice that in the old equation, we took the derivative of our solution "u" twice, which meant it had to be differentiable twice. However, in the new case, we only have to take the derivative of "u" once. Mathematically, we took constraints off of the equation, and believe it or not, this makes a huge difference in solving for solutions, especially for more complex equations. There is additional advantage in using variational forms (powerful theorems concerning solutions and accuracy) but that's much more mathematically complex.

The other key part to notice concerning variational forms is the function "v" we multiplied by, which is formally called a "test function". Notice we move a derivative from "u" over to "v". In some sense, we're splitting the differential equation between functions "u" and "v". This is the reason some say that variational forms capture the "action" of a differential equation on test functions, and this, in my opinion, is the more interesting way to look at variational forms. You don't look at just the differential equation and its solution anymore; you look at what the differential equation looks like to the test functions that "see" the equation, and you look at the way the solution is "seen" by the test functions as well.

The reason I find this so interesting (besides the fact that I'm a huge nerd) is because of the analogy I tend to see between this and faith. Take, for example, debates on Scriptural interpretation. I've always grown up with the sense that I had to take things literally and in the most conservative fashion because it was the safest way to go. I would worry that more liberal interpretations were 1) not grounded in anything, and 2) were slippery slopes to more and more liberal interpretations until we were basically just making stuff up.


What I find so fascinating about N.T. Wright's view is that he seems to do for theology just what relaxed variational forms do for PDEs. More on this in the next post :P this one's long and mathematical enough already.



6 comments:

Jose A. said...

I'm not smart enough to comment on this subject. The end.

Wayne said...

mm the different gifts we are given.. wow lol

thought i must admit it is fun to make connections between different (although not always so different) things you've learned/heard :P

DavidsDiary said...

I read this and just think "The same point could have been made if he just posted that comic up."

jchan985 said...

@David true. I think I more nerded out and wanted to explain what I was working on.

Yuekai said...

This is a post full of good analogies.

jchan985 said...

Thanks Yuekai; glad a mathematician approves.