I am attempting to solve a pde, but after executing for a long period of time, I don't get a solution. It seems Mathematica crashes as all variables in the notebook are rendered void of values. [I am running on MacBook Pro, v. 10.15.7, 16GB RAM, Mathematica version 184.108.40.206]. Thanks a lot for any help.
Tested on 220.127.116.11. I aborted it after consumption of 80GBytes of memory.
FWIW When I encounter or anticipate this sort of issue in production code, I usually wrap the operation in a VerificationTest, with constraints on time and/or memory as required. That way I don't lose the whole kernel when the function runs away, and any messages are caught and available for debugging.
Thank you, Kirk. I am new to using Mathematica so still learning. I hope to get some guidance on how we can solve the problem. Do you think it is running out of memory in which chase I could consider running it on a larger machine? Thanks so much.
Yes, you are running out of memory. I monitored the kernel memory consumption to confirm. When you feel you lost control of the kernel, you want to check your kernel process size: that's often the cause. Of course there may be other challenges, that's just the first layer of the onion...
I would try a few things to get your code under control (These are generic, but I've found they are often useful)
1. Wrap it w/ VerificationTest w/ limited memory, so you don't lose the kernel
2. Check for singularities, branches, etc and remove any you can: Those will force Mathematica to explore each possibility, and each of those explorations costs memory and time.
3. Add Assumptions for any types and domains, again to help control the branching
4. You can add an evaluation monitor to watch what's happening, you might be able to find where the issue is that way
5. Try rewriting your math, sometimes a seemingly trivial change will cause Mathematicas algorithms to more easily find the solution. Simplify and FullSimplify are good places to start.
6. You've used rationals for all numeric values, which can cause Mathmatica to use (very expensive) exact arithmetic where (much faster) approximate calculations would work fine. You could start with "machine precision", by simply using e.g. 1.0 instead of 1. You can get fancier with N, SetPrecision, PrecisionGoal,AccuracyGoal, etc.
7. Get it working on a smaller region, work your way up to the full scale problem.
8. There are numerous options to control step size, recursions/subdivisions etc that you may need to use.
I hope this helps!
Thank you very much. I will work through these suggestions over the next few days.