Alas, I apologize, sincerely, truly. My brain must be scrambled or something. I would have sworn one of those subscripts were off last night. And I was a jerk.
:O(
Your matrix calculation looks right.
Uh, alas, I don't have time right now to mess much with your code. Can you wait a few days? (Perhaps someone else will pick it up before then.)
Don't worry about it we all make mistakes which is precisely the reason im in this forum.
Hopefully somebody will spot the error I sure as hell cant. The data outputted is so random like a sharp sinusoid up n down etc... I can only think that it may be that every iteration, the matrices dont initialize to their original values for some reason and so making it very random :S ..