by hcarvalhoalves · 5y ago · 0 comments
I feel I need to mention "Structure and Interpretation of Classical Mechanics" by Wisdom and Sussman, and the accompanying "scmutils" library, which first implemented in Scheme many of the same features, although this Julia library seems to be more complete.
There's also a great one-to-one port to Clojure by Colin Smith [2] in case you want to use it on a more production-friendly environment. The Strange Loop talk [3] is a good showcase of the power and simplicity of these kind of systems.
[1] https://groups.csail.mit.edu/mac/users/gjs/6946/
[2] https://github.com/sicmutils/sicmutils
[3] https://www.youtube.com/watch?v=7PoajCqNKpg&ab_channel=Cloju...
One beautiful thing about a Clojure computer algebra system is that it can run completely in the browser. This includes automatic differentiation, numerical integration, all of the hardcore Lagrangian and Hamiltonian mechanics work, differential geometry... it is startling stuff.
For example, here's a(n interactive!) derivation of Kepler's Third Law in the browser (thanks to Nextjournal's lovely integration), if anyone wants to play: https://nextjournal.com/try/sicm/ex-1-11
Many more exercises live here: https://nextjournal.com/sicm/
https://computationalthinking.mit.edu/Spring21/newton_method...
Thanks for the ideas!
https://discourse.julialang.org/t/ann-symbolicutils-jl-groun...
He took Sussman's course and became interested in the field from that! Great work.
[0] https://kloimhardt.github.io/cljtiles.html?page=pendulumfina...
I'm hoping to introduce Clojure's "spec" or "schema" libraries so that the types at play can at least be inspectable inside the system. In a fully typed language, I'd implement the extensible generics as typeclasses.
I suspect it would make it quite a bit tougher (at least in the approach I'm imagining) for folks to write new generic functions, due to many type constructors...
On the other hand, the complexity is there, even if you don't write it down!
It would be a big project, and a worthy effort, to write down types for everything in SICM.
Render (pt_BR): https://github.com/hcarvalhoalves/math-fin-training/blob/mas... Source: https://raw.githubusercontent.com/hcarvalhoalves/math-fin-tr...
I would love to see how you're using org-mode for that if possible :)
I come across this book every so often and find it really tough to read due to the complete lack of "types" in any of the code. Math, especially physics, relies heavily on units and function signatures to be understood.