Since I started my PhD I’ve spent a lot of effort setting myself goals each week to make sure I actually get something done. Sadly, because this is the real world and my brain doesn’t take real world things into account, my attempts at meeting these goals have been an omnishambles. Consider the goal I set myself the week before last; get my particular algorithm working. Does it work?
Well, of course it doesn’t!
What a silly rhetorical question.
Or at least, it didn’t until just now! In a bid to be able to show my supervisor that I have actually done some work in the past month, I have spent eight hours today trying to find out why the hell my algorithm worked on the nice easy “test case” but not on the real-world “difficult” problem. I tracked down the root of the problem, but didn’t know how to solve it. Here’s a picture that sums it up;
The black lines and the blue lines should be going the same way. They aren’t. The black lines are what my program does, the blue lines are what it SHOULD do – I only know where the blue lines are because I calculated them by hand. The thing is that until just now I had no freaking idea why it was doing this. Because I’d spent an entire day doing maths and it wasn’t working. Because 8 hours sitting staring at a computer screen saying “what’s wrong?” over and over and over and over again sends you just a LITTLE BIT crazy. I may have come out with the following at one point;
I’ve got a Real Array called ‘Problems’ and it’s 99 elements long! #NerdJayZ
The problem was sending me up the wall (and it was 10pm by this point), so I went back to basics and redid some of my maths. What did I get wrong? A big thing? Did I miss a term out of the equation? Did I integrate instead of differentiating? Did I start out by writing down the wrong function?
Oh, I just put a 1 in somewhere there should have been a 0. That’s innocuous enough, right? I mean – what difference could just a 1 possibly make?? Well, when I removed the 1 it did this;
Sometimes I hate Mathematics with a real passion.