Monday 22 June 2015

Singularity

My code is blowing up into a singularity, and I don't know why. To explain a little, and invoke the mathematics portion of the Quirky Muffin's subtitle, I'm using a process called 'continuation' to try to solve a tricky problem. What's 'continuation'? Well, imagine you have a mathematical problem that is being solved by a computer, but is very difficult for large values of some important number. Let's call that number A. With continuation you would solve it for a small value of A, for which we assume the problem is easy, and then progressively increase the size of A, using what we've learnt from the previous calculation to make it easier for the computer.

Is that understandable? I hope so, because it's mostly been accurate so far.

Sometimes, continuation can fall apart, and in my case the cause of the collapse is unknown. At some critical value of BN, BN taking the place of A in my calculation, the whole thing falls over and I can not work out why. Changing the size of the time step when the crash occurs doesn't make any difference, as it always falls over into singular matrix horror at that point no matter what. It's a mystery, and it's probably a programming bug. Programming bugs are the worst things, as they are many many times harder to spot than a typo in proofreading. Typos stands out plainly from the page, whereas bugs are usually conceptual problems. Bugs are subtle and abstract.

One reason for my continued computational incompetence is that, when faced with a bug, I tend to do the stupid thing and run the program a few more times to see if anything changes, and then change things haphazardly while running it even more times. Sometimes, annoyingly it does! However, such dawns always prove false and you're back in the land of the serious problem. How do you proceed? To begin, you display as much information as you can each step to see if there's anything strange going on. Then, you start reading through the code on the screen for obvious problems. After that, you consider mathematical problems in the theory of whatever you're trying to do, and then finally you print out the whole thing and pore over it like a demented data miner seeking espionage gold. Programming is nightmarishly difficult once you have to start incorporating tensor algebra into the mix. It would be better to program strawberries.

Tensors? Let's not talk about tensors, for they are both disgustingly difficult in practice and simple in theory. How will this problem be resolved? Is it even a problem at all, or is it the mathematics talking? How do we find out the answer to that question? What does it all mean? Oh, infamy! Infamy! They've all got it in for me!

O.

No comments:

Post a Comment