
Structure and Interpretation of Classical Mechanics - dennybritz
https://mitpress.mit.edu/sites/default/files/titles/content/sicm_edition_2/book.html
======
formalsystem
This is a great book but a bit dense first. At a high level it goes through
physics with an optimization viewpoint, as in find the actions that minimize a
system's energy to figure out how a system will evolve.

I would strongly suggest you learn Lagrangian and Hamiltonian Mechanics from
this book first [1] since it comes with many more illustrations and simple
arguments that'll make reading SICM much easier. If you don't have time to
read a whole book and want to get the main idea I've written a blog post about
Lagragian mechanics myself [2] which has made it to the front page of Hacker
News before. The great thing about SICM is that it's a physics textbook where
the formulas are replaced by code [3] which you means you can play around with
your assumptions to gain intuition for how everything works.

IMO I believe in introductory physics we overemphasize formalism over
intuition and playing around with simulators is a truer way to explore physics
since most physical laws were derived via experimentation not derivation.
Another book that really drives this point home is [4]

[1] [https://www.amazon.com/Jakob-
Schwichtenberg/dp/1096195380/re...](https://www.amazon.com/Jakob-
Schwichtenberg/dp/1096195380/ref=tmm_pap_swatch_0?_encoding=UTF8&qid=&sr=)

[2] [https://blog.usejournal.com/how-to-turn-physics-into-an-
opti...](https://blog.usejournal.com/how-to-turn-physics-into-an-optimization-
problem-11b3fbf83062?gi=b6b2beb291f5)

[3] [https://github.com/hnarayanan/sicm](https://github.com/hnarayanan/sicm)

[4] [https://natureofcode.com/](https://natureofcode.com/)

~~~
petermcneeley
"find the actions that minimize a system's energy" That sounds incorrect.

The path taken by the system between times t1 and t2 and configurations q1 and
q2 is the one for which the action is stationary (no change) to first order.
[https://en.wikipedia.org/wiki/Principle_of_least_action](https://en.wikipedia.org/wiki/Principle_of_least_action)

The reason for this is quantum mechanics
[https://en.wikipedia.org/wiki/Path_integral_formulation](https://en.wikipedia.org/wiki/Path_integral_formulation)

~~~
formalsystem
Yes you're correct, I'm just giving the intuition that I found helpful to
understand the Principle of Least Action.

------
tgvaughan
I love what I've read of this book, but found reading the HTML version on the
MIT website a bit of a chore. Here's my attempt at applying Andres Raba's
wonderful SICP layout
([https://sarabander.github.io/sicp](https://sarabander.github.io/sicp)) to
SICM: [https://tgvaughan.github.io/sicm](https://tgvaughan.github.io/sicm)

~~~
selfishgene
Thanks ... that looks great! I always preferred Sara Bander's HTML version of
SICP to the PDF version that is available for free download at everyone's
favorite online bookstore.

If someone is looking for the PDF format of SICM, that's available now too for
the second edition.

~~~
Ambroisie
Where would that be?

------
kragen
SICM has been on my list of things to study for years, but I haven't made it
much past the delightful preface:

> _When we started we expected that using this approach to formulate mechanics
> would be easy. We quickly learned that many things we thought we understood
> we did not in fact understand. Our requirement that our mathematical
> notations be explicit and precise enough that they can be interpreted
> automatically, as by a computer, is very effective in uncovering puns and
> flaws in reasoning. The resulting struggle to make the mathematics precise,
> yet clear and computationally effective, lasted far longer than we
> anticipated. We learned a great deal about both mechanics and computation by
> this process. We hope others, especially our competitors, will adopt these
> methods, which enhance understanding while slowing research._

This second edition is from 2015, following the 2001 first edition.

Unfortunately, unlike SICP, it does not seem to be under a free license, so it
is not legal to translate it into Spanish or produce a reformatted digital
version that incorporates an actual Scheme interpreter.

~~~
tgvaughan
The second edition is CC-BY-NC-SA. (This is indicated inside the cover of the
print edition.)

[Edited to add NC.]

~~~
kragen
Oh interesting! Do you have the print edition? The copy on Library Genesis
does indeed seem to contain that license, but someone could have added that
when they uploaded it to libgen:
[https://libgen.lc/ads.php?md5=968F60C358A99A61A2A0FD7502F476...](https://libgen.lc/ads.php?md5=968F60C358A99A61A2A0FD7502F476D8)

~~~
zerocrates
The Google Books copy that MIT Press links to as the "Preview" includes the CC
license:

[https://mitpress.mit.edu/books/structure-and-
interpretation-...](https://mitpress.mit.edu/books/structure-and-
interpretation-classical-mechanics-second-edition)

[https://books.google.com/books?id=a4-pBgAAQBAJ&lpg=PP1&pg=PP...](https://books.google.com/books?id=a4-pBgAAQBAJ&lpg=PP1&pg=PP1#v=onepage&q&f=false)

~~~
kragen
So it does! Thank you very much!

------
thatcherc
There's a ton to learn from this book, especially if both Scheme (or
functional programming in general) and the Lagrangian and Hamiltonian
formulations of mechanics are new to you as they were to me when I first came
across the text online. I ended up taking the class in person and seriously
enjoyed it. It was a big reason I switched my major from CS to physics, which
I mean in the best way possible! I think the authors were right in their
assessment that Lisps are really well suited to mathematics, and especially
the type of math you see in working with Lagrangians: function composition and
partial application. Plus there's the cool benefit of being able to write code
that looks at other code and writes its derivative as a new program!

The two small warnings I would share with someone starting this book are

1) they introduce some of their own notation to clarify, i.e., what various
derivatives mean, but this notation is different than what is found in other
texts

2) it ramps up pretty quickly from solving a double pendulum to much higher-
level stuff like Lie transforms and perturbation theory - it's a lot to keep
in your head all at once. Don't get discouraged if you hit a wall and need to
come a couple days or weeks or months later - I definitely did, and it is
still fun to try to go back and make it through the harder parts. Highly
recommend!

------
montalbano
Some additional interesting discussion about this book on previous HN threads:

[https://news.ycombinator.com/item?id=19765019](https://news.ycombinator.com/item?id=19765019)

[https://news.ycombinator.com/item?id=6947257](https://news.ycombinator.com/item?id=6947257)

[https://news.ycombinator.com/item?id=23153778](https://news.ycombinator.com/item?id=23153778)

[https://news.ycombinator.com/item?id=1581696](https://news.ycombinator.com/item?id=1581696)

[https://news.ycombinator.com/item?id=9560567](https://news.ycombinator.com/item?id=9560567)

------
Myrmornis
This book's amazing. I've only tried to understand the first few chapters so
far but I found the basic idea -- reformulating the Euler-Lagrange equations
in lisp, and using Spivak's alternative notation for differential calculus --
to be extremely illuminating and even inspiring when going back and trying to
really make sense of (advanced) undergrad calculus.

OK, so here's my question: the scheme is great and all, but wouldn't this
really benefit from a statically typed language with a rich type system? I
think it would be really interesting to try to make the computations at the
type level correct as well as at the runtime level. Obvious candidates I guess
are Haskell/OCaml etc, or one of the theorem-proving languages (out of my
depth here, but Lean/Coq etc).

I have said this before...another HN thread on SICM:
[https://news.ycombinator.com/item?id=21460106](https://news.ycombinator.com/item?id=21460106)

~~~
lrc
I have been interested in doing this for a long time, and have thought about
doing it in Haskell. It would be a lot of work, and some of the type decisions
that would be needed would probably complicate the UX of the software (the
automatic differentiation of functions of various shapes would make typing the
D operator interesting; I think it would force all real-valued functions of a
real variable to look like they were working in a vector space of dimension 1,
or the inconsistency would be maddening). SICM's software also does a lot of
"lowering" of types, so 0 (zero) is kind of a universal additive identity, but
in a strongly typed system you'd need zeros of many different kinds and it
might be that once all this was finished there was too much "wrapping" left
visible and the scientific investigations in the SICM spirit would lose some
of their charm. I guess that's a long-winded way of saying that there are lots
of type puns in mathematical notation that are useful affordances even if they
are slightly abusive.

~~~
Myrmornis
Thanks that was very interesting to hear your thoughts. If you do ever decide
to work on this again, I'd be interested to know and probably in helping.
Others in these threads have expressed interest too. But yes, it does sound
like rather a lot of work for a slightly esoteric cause. My contact details
are in my profile.

------
enriquto
If you are more mathematically inclined, there's also "Functional Differential
Geometry" by the same authors, and in the same spirit, but much shorter. The
goal of the book is essentially to write the Euler-Lagrange equations in lisp,
which is a breathtakingly beautiful thing.

~~~
mseri
Which is also especially beautiful, and open access as well:
[https://mitpress.mit.edu/books/functional-differential-
geome...](https://mitpress.mit.edu/books/functional-differential-geometry)

------
dennybritz
I posted this because it was recommended to me several times in [0], together
with several other "computational approaches to Physics" books, and thought it
would be interesting to HN users. If you're looking for more books like this,
the whole Twitter thread is worth a read. It's full of good recommendations.

[0]
[https://twitter.com/dennybritz/status/1260137814982787073](https://twitter.com/dennybritz/status/1260137814982787073)

------
Cleonis
I have a hard copy of the first edition. The dedication says: "dedicated to
the principle of least action"

I have an educational resource for introduction to Hamilton's stationary
action. The title is "Least action visualized".

[http://www.cleonis.nl/physics/phys256/least_action.php](http://www.cleonis.nl/physics/phys256/least_action.php)

The diagrams on the page have a slider for active exploration. Moving the
slider sweeps out a range of trial trajectories. As you change the trial
trajectory the diagram shows how the graphs of the energies come out
accordingly.

In this resource Hamilton's stationary action is introduced in a two-stage
process.

First stage: We have the Work-Energy theorem, which we can apply with equal
validity in infinitisimal form. The true trajectory has the following obvious
property: at every instant in time the rate of change of potential energy
matches the rate of change of kinetic energy. Demanding this match as a
condition we identify the true trajectory among the range of trial
trajectories. That is, this initial stage is already variational approach, but
it doesn't yet use the concept of action.

Second stage: Demonstration of moving in a single step from the first stage to
Hamilton's stationary action.

The demonstration is for the simplest case: a uniform force, hence a linear
potential. The reasoning generalizes to all cases.

------
djaque
I did a read through last year and thought it was great. Having to actually
tell a computer how to do Langrangian and Hamiltonian mechanics makes you
learn it really well. Pointed out some of the interesting reasons behind why
we choose or Langarangians/Hamiltonians the way we do that I didn't appreciate
during undergrad.

------
billfruit
One of the good things I felt about the book, though I have read only a few
chapters is that, the use the Scheme-based system, has made the notation more
concrete and lucid. No vague and confusing notations like the traditional
treatment.

------
enitihas
Amazingly, this book has the same author as SICP, i.e , Structure and
Interpretation of Computer Programs.

~~~
gumby
One of the three SCIP authors you mean.

Not so incredible; Gerry has always loved physics and in the 80s built a
digital orrery in scheme shortly after SCIP was written. I believe this book
had its earliest inklings in that work.

~~~
xdavidliu
Around March 2019, I walked up to Gerry at the end of a class he taught (I was
sitting in) and he mentioned that he was actually a physics major at MIT when
he was an undergrad (in addition to math) but was one course short. The course
he was missing? Junior lab (now 8.13 / 8.14)

