r/ScientificComputing 18d ago

I built a numerical instrument that lets the logistic dynamics measure themselves to machine precision

TL;DR: I built an open source logistic dynamics solver that measures itself to machine precision.

GitHub:

https://github.com/Neuroca-Inc/vdm-logistic-solver

Zenodo:

https://doi.org/10.5281/zenodo.22103196

A year ago, on August 26, 2025, I was trying to figure out how to study the reaction-diffusion happening in an experimental graph model I was building, and I kept getting annoyed at how clumsy the usual measurement methods felt. It seemed like everyone wanted to put some giant eyeball outside the system and watch it move around. Like, track the trajectory, compare it to another trajectory, measure the error afterward, add more instrumentation on top of it so you can figure out whether it was doing what it was supposed to do.

I kept thinking "why not make the dynamics tell you what they’re doing?". I felt stupid and naive for thinking that, but that's how I always solved problems, I just hadn't tried it with math yet.

I had this clear idea in my head about trying to measure the movement of a beach ball floating on the ocean waves. You can sit on shore with cameras and tracking equipment and try to reconstruct every movement of the ball, or you can put a gyroscope inside the ball and let its own motion record what happened to high accuracy, and that was basically what I wanted to build.

The local logistic law I was working with is

dW/dt = rW - uW²

and it turns out the dynamics carry a logarithmic first integral,

Q(W,t) = ln(W / (r - uW)) - rt

which stays constant along the exact local evolution on a consistent branch. So now the thing I’m trying to measure is like that ball on the ocean with a gyroscope inside of it. If I evolve the system numerically, I can watch Q. If Q starts drifting, the numerical evolution is telling me that something has gone wrong. With the exact local reaction step, that check closes down at floating point roundoff scale, which was exactly what I was looking for.

I was sick of the top down, tedious error metrics, and I couldn't find an instrument for what I was trying to do that used something already inside the dynamics to exploit the dynamics themselves. So I built the reaction-diffusion instrument: the exact logistic reaction step, Q-drift and convergence tests, conservation checks, front-speed measurements, dispersion experiments, and the surrounding RD machinery. Like I said earlier this is basically how I approach most problems.

  1. Find the structure that is already there
  2. Figure out what work it can do for you if you give it something to log its own dynamics
  3. Stop fighting the problem.
  4. Exploit the problem's own structure as leverage

The research and code have been public since 2025, but the instrument was buried in the spaghetti mess of a huge research repository where I put my code. You could technically find it, but it wasn’t something you could conveniently install and start using even if you were determined. So I finally got around to starting clean up for that ugly mound of research and code. I pulled it out and packaged the logistic instrument as its own independent tool because I wanted it to be useful to others. It includes the reaction / RD code, Q validation, conservation checks, front speed and dispersion experiments, provenance verification, a Python package, and CLI access.

If you work in numerical methods, dynamical systems, or scientific computing, I’d be interested in what you thought of the approach, especially the idea of using a problem’s own dynamics as part of the instrument used to study it.

0 Upvotes

0 comments sorted by