mentat-collective / emmy

The Emmy Computer Algebra System.
https://emmy.mentat.org
GNU General Public License v3.0
402 stars 23 forks source link

Port sections.scm and poincare map visualization #10

Open sritchie opened 2 years ago

sritchie commented 2 years ago

This will be a mathbox + clerk heavy fun one!

Some code from the namespace:

(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)))))
sritchie commented 2 years ago

Here's the sections code: https://gist.github.com/sritchie/8f0a749734e2db196d58652517a2e438