(defn refine-crossing
"This is used to zero in on crossings in autonomous systems, such as
Henon-Heiles."
[sec-eps advance state]
(loop [[_ [x] [xd]] state]
(let [zstate (advance state (- (/ x xd)))]
(if (< (Math/abs (get-in zstate [1 0])) sec-eps)
zstate
(recur zstate)))))
This will be a mathbox + clerk heavy fun one!
Some code from the namespace: