Thursday, July 23, 2015

Week 7: Kinks

That title is totally click-bait. But I swear it's relevant!

I finally hit a massive obstacle in my project earlier this week. One of the plots I generated had a pretty nasty kink in it where it shouldn't have had one. This lead to a number of days spent under the hood of my code debugging, re-writing subroutines, checking types, and making sure I didn't exceed the 132 character/line limit (thanks for nothing, Fortran 90).

Today, I finally had a break through. The plot I was generating featured points whose y-values came from an integrand. The integrand is chock full of... interesting quantities that are computational expensive to calculate. The two most complex are the external potential and the structure factor, both of which come from a program that, for all intents and purposes, is a black box to me.

None of my other plots had any issues, so from the outset I was suspicious that the issue was in my code. Still, I started from the top of my integration routine and worked all the way down until it had to be something in my integrand itself that was misbehaving. I checked the fermi-dirac function I was using, the physical parameters that gave the integral correct units, the fineness of my grid, and even how many digits of pi my code was using. Finally I came to the potential and the structure factor. It had to be one or the other. Removing each separately showed that there was an unusual jump in the potential where my kink was. Victory.

The win is hollow though. I still have no idea why the potential is misbehaving and although it looks like that's the issue, I can't really be sure. I just hope that whatever the issue is, it won't have affected the rest of our results.

I can't believe that it's already the end of week 7. Before I know it, I'll be back at sea level and won't need a cryptocard to check my email.

No comments:

Post a Comment