I have a piece of code that calculates and plots solutions of a set of 4 differential equations - coordinates of an object moving in a Kerr spacetime to be exact - with customizable initial parameters. After loading NDSolve[] with all needed components:
NDSolve[{ku == -as,
t[0.] == 0., r[0.] == r0, \[Theta][0.] == Pi/2, \[CurlyPhi][0.] == 0.,
t'[0.] == vt_0, r'[0.] == vr_0, \[Theta]'[0.] == 0., \[CurlyPhi]'[0.] == vphi_0}
/. e -> e_c /. l -> l_c /. M -> 1 /. a -> 0.5, Rs, {s, 0., 1000000.}];
I generate a plot of each coordinate $(t[s], r[s], \vartheta[s], \varphi[s])$ and a polar plot of $(r[s], \varphi[s])$ representing the trajectory. For clarification, $ku=-as$ is the set of those 2nd order differential equations and initial velocity parameters are described by functions dependent on more general parameters: $r0, e, l, M, a$.
The problem is that at some point the notebook suddenly freezes for 2-3s and shuts down without any sign of system overload. Generally it can happen at almost any time, but it most often happens when the polar plot shows up on my screen. It might also happen seconds after generating the polar plot but sometimes it even crashes while I'm just scrolling through the code.
I work on Mathematica 12.0 on Windows 10 with a ccgrg package. It started happening soon after installing a new SSD in my laptop, as the previous drive (HDD) broke. The HDD was visibly slowing down by the day and caused Windows to freeze completely multiple times when the CPU/RAM ran at 100%/almost 100% usage with any heavier load for a longer period (e.g. playing a YouTube video on Chrome with at least 10 cards open). One day, it finally died.
Up to the HDD failure, the code was working fine and the math behind it is correct, so I don't think it's a code issue. Additionally, I only work on trajectories that do not cross the black hole's event horizon - and even if they do, calculations simply stop at that point and nothing should break.
Mathematica reinstall didn't help, testing on a new Windows user didn't help either and the code runs fine on my friends' computers, therefore I believe it might be a hardware or a system issue. I have a theory that the dying HDD was the reason for the mismanagement of the available resources - hence the high CPU/RAM usage - what ultimately led to some hardware fault. A memory leak might also be the cause, but looking at the Task Manager, when the freeze happens, there is no visible change in the usage of any of the components. This is also a very specific behaviour, as I only encounter it while working on this code.
What might be the reason for this issue? Should I simply reinstall Windows?
I tried to include any relevant info but please inform me whether I should add anything else.
code runs fine on my friends' computersmeans it is not related to Mathematica. $\endgroup$