No, this is what I’m trying to shed light on, not numerical issues. As I said in my original question, the DifferentialEquations.jl FAQ mentions that Hill functions (which are smooth) can cause negativity even if the derivatives vanish at zero. I am hoping to get clarification on this phenomenon, and a concrete example.
Somebody here is misunderstanding something.
The “basic form” you posted upthread is smooth.
Smooth (or more generally, locally lipschitz) differential equations cannot exhibit the phenomenon that initially nonzero solutions can hit zero in finite time even if the derivatives vanish at zero.
This is a consequence of the picard lindeloef theorem, which is typically the starting point of any treatment of ODEs: If two solutions are different at t=t_0, then they are still different at t = t_1 > t_0.
There was some discussion about the square-root RHS. That is not smooth / locally Lipschitz.
Indeed, for e.g. \dot x = - \sqrt{|x|}, solutions that start positive will reach x=0 after some finite time, will then stay zero for some time, and may then spontaneously become negative at some undetermined later time.
This is not ideal, from a modeling perspective! You’d prefer if knowing x at t=t_0 would always, uniquely and continuously determine x(t) for all t>t_0; losing “always” is kinda OK, e.g. finite-time blow-up; losing “continuously” means that your topology is wrong, and losing “uniquely” puts you into a quite different world of “effects without cause”.
There are other sensible sources of uniqueness than locally-Lipschitz. For example, you can have \langle u-v, f(u)-f(v)\rangle \le C |u-v|^2. This applies for most friction models, and e.g. f(x)=\mathrm{sgn} x \sqrt{|x|}, but does not apply for f(x)=-\sqrt{|x|}.
And my answer still stands: The friction model \dot x \in -x/|x| is quite instructive for the phenomenon you’re looking for, and you can make experiments by sliding a cell-phone shaped block around on your desk. Forward-time well-posed, but backwards-time non-unique (well, duh! I slide a block on my desk, and it stops somewhere. But staring at a block lying still on my desk, there are obviously many possible pasts of its trajectory).
This is a quite different branch of differential equations. Somewhat outside my wheel-house, though. And you will absolutely need special solvers for these things.
The crux here is the following quote from the SciML documentation:
What class of behavior is this referring to, and what approaches/workarounds might such models demand? I think that’s what @homegnome0 is trying to get to the bottom of since their system includes Hill functions.
I think the friction model can be solved with the standard SciML solvers using the event-handling functionality. Add a continuous callback that a) forces the integrator to hit x = 0 exactly rather than step across it, and b) terminates integration (or if there are other forces involved, flips the sign of the friction force and only terminates if the resulting net force has the same sign as the friction). That is to say, you need to inject some extra knowledge through event handling (similar to, e.g., bouncing ball models), but between each event you can keep using the solvers you’re used to.
What are the parameter values? Are they fixed or e.g. optimized over?
This is an illustration of the Hill function from Wikipedia:
By D Wells - Own work, CC BY-SA 4.0, Link
For coefficients between 0 and 1 it does have the same problematic properties as the square root examples mentioned earlier (essentially an ill-defined derivative at some point, here at 0) that creates ambiguities in the (backward-time) solution and causes more issues further down the line (like negative concentrations).
So my guess is it all comes down to the value of the Hill coefficient n in your equations.
PS: I just wanted to drop this philosophical physics problem here, since I only recently learned about that. It asks what implications these mathematical properties have for Newtonian physics: Norton’s Dome
This seems like the answer to my question. My parameter values are being sampled in MCMC, so they vary, but luckily the Hill coefficient is held at n=4. So it seems that my solutions shouldn’t have any analytical ambiguities. Amusingly, I learned about Norton’s Dome quite recently and did not expect it to be relevant to my work so immediately!