Academic excellence

One of the two classes that I’m currently taking, this last semester before graduation, is on “computer procedures”, but a more accurate term is “numerical analysis”. We’ve spent most of the term working on implementing matrices and performing various algorithms like Gaussian reduction and Jacobian iteration in C++. My professor, who is a few years away from retirement, spent most of his career writing C code for aero and thermodynamic implementations, doing finite difference approximations of differential linear equations.

One of the problems with the course is that there are no supplementary materials for the class. It’s all lecture. I spend a good deal of time in class asking qualifying questions, and trying to figure out what he’s doing — and why — from Wikipedia articles. He’s wondered aloud about the number of people that drop the course each semester, and I’ve told him that it probably has something to do with the lack of supporting materials for the class.

It is no doubt one of the hardest courses I’ve taken, as it builds on years of calculus, linear algebra, and several programming courses. Not for the faint of heart. The math for this particular section is hard enough, and the professor just skips over much of the background of where the equations that we’re being given. He goes straight to the provisioning of the stencils that we need to build the matrixes. This follows the model that he’s been used to, where a scientist will give him some boundary equation problems and just ask him to solve them.

For me though, I demand more of a total understanding as to what’s going on, and have been driven slightly insane trying to understand the relationship between these first and second order differentials and these matrices that we’re coming up with. Another problem that I’ve had is that his code demonstrations in class are very dirty; just one long procedural main() function that is hard to read and even harder to understand what’s going on.

To deal with this latter problem, I was able to get him to upload his code functions to a public directory, and I’ve been refactoring it, pulling out functions here and there to make it more concise. I also implemented unit tests to validate my work and make it easier to refactor. But I ran into a real big problem trying to make up work for a few days that I was out, related to LU decomposition of a matrix. Trying to find public sources to figure out exactly what form he wanted us to use turned into a bit of a nightmare.

My refactoring eventually ran up to the limits of my understanding and ability to use C++. Our professor, old pro that he is, demonstrated all of his algorithms using naked C-style double-pointer arrays, which is not for the faint of heart. I took a crack at making these naked arrays into class members, but then ran into initialization and memory errors. So, I looked elsewhere, for other libraries that could shed some light on what I was trying to do. Unfortunately, the ones that I found either relied on FORTRAN to do the dirty work, or used arcane template methods with keywords that I had never seen and did not understand.

So, I turned to the most authoritative source I could, and picked up a copy of Bjarne Stroustrup’s The C++ Programming Language, and started on page one of this nearly 1400-page tome by the creator of the language. I spent many sleepless hours pouring over this work last month, finally taking a break because of a deadline in another course.

We’ve spent the last few sessions in a review of sorts, preparing for a midterm that awaits us following Spring Break next week. I’ve been attempting to nail down our professor about what we should expect on the exam, and he’s been very forthcoming. Still, it’s one thing to nod my head at what he does in class and convince myself that I understand, but a recent example on partial differentials showed me that I was ill prepared.

Now I’m not sure why exactly I decided to pick up a copy of Donald Knuth’s Art of Computer Programming. Self-punishment, I supposed. Knuth’s volumes are widely considered one of the most important tomes in modern computer science, and also as one of the most difficult and demanding works in the field. I spent several hours over the last weekend reading, or more accurately, skimming through its first chapters, trying to get a handle on the basics.

During his introduction, he noted how his LaTeX typesetting language had enabled the work to advance. Having source code up where multiple contributors could add to it, tweaking the formulas and figures in a way that had not been possible when the work was first released. It must have lodged in my brain, cause I was woken up in the middle of the night by one of the kids, and as I lay there in the space between waking and sleeping. I remembered this article by someone who does their class notes in LaTex. When I woke up, it was clear what I had to do.

So I spent most of the day copying down my class notes into Overleaf, an online LaTeX editor, going back and forth with various Wikipedia pages, trying to translate my notes and various Wikipedia articles into LaTeX. I’m really looking forward to going over it with the Professor on Wednesday. I’m hoping to put the source code up on our University’s GitLab server and setup a pipeline to compile the .tex files into PDF.

Leave a Reply

Your email address will not be published.