Like all of us, I am trying to solve a differential equation. I get errors that say the model is unstable:
Warning: dt(1.88079096131566001274997845956e-37) <= dtmin(1.88079096131566001274997845956e-37) at t=0.0297491697264944438670720878254, and step error estimate = nan. Aborting. There is either an error in your model specification or the true solution is unstable.
There is probably a good reason for that, but I am having a hard time to find the instability.
I guess it is related to the following. My equations of motion depend on two functions that are defined only in a certain range. When my solution gets close to the boundary of the range, the problem appears.
To deal with the finite range, I have extended the functions to be defined outside the region, such that they return the value on the boundary.
Another issue is that these functions are actually ratios of two expressions that go to zero near the boundary, but their ratio is finite. That is why I suspect the instability appears. In fact, on the boundary, these functions are ill-defined, but I have calculated their limit on the boundary, and set the code to return the proper limit there. (The limit indeed matches the numerical values as they approach the boundary). Due to these instability issues, I am trying to use
ArbFloat to have better precision.
Another issue that is probably related is that these boundaries (and the functions themselves) are changing with time. It seems that the solver has an issue with that.
So I guess my question is: Are there any ways to deal with these complications properly? I have tried to debug for a long time, but I suspect I got to a dead end.