Learn Physics by Programming in Haskell [pdf]
1–10 of 56 posts
Re: Learn Physics by Programming in Haskell [pdf]
#2There's an older course that's a bit of a sequel to Structure and Interpretation of Computer Programs (SICP) called Structure and Interpretation of Classical Mechanics (SICM). I've never done it but always thought it looked like fun. (If you're into Scheme or Lisp)
course: http://ocw.mit.edu/courses/earth-atmospheric-and-planetary-s...
book: http://mitpress.mit.edu/sites/default/files/titles/content/s...
Re: Learn Physics by Programming in Haskell [pdf]
#3If you're into physics I'd recommend solving some problems using whatever language, but especially functional languages (i.e. Lisps, Haskell, etc.) because you have some big "A-ha!" moments as to what the math really means. Like when you program an integral from scratch for a mechanics problem and you go "Oh that's why we use an integral here!" There are also many problems (i.e. n-body orbital dynamics) where brute-f…
Re: Learn Physics by Programming in Haskell [pdf]
#4The aspect of this that interests me most is related to a classic observation that, for most people learning physics, it's hard to separate difficulties with the physical content and difficulties with the mathematical content. The distinction between these is vague, but the separations like "set up the differential equation" vs. "solve the differential equation" that this functional style suggests seem like a good approximation to "physics" vs. "math."
Re: Learn Physics by Programming in Haskell [pdf]
#5Re: Learn Physics by Programming in Haskell [pdf]
#6Link instead to the abstract:
Re: Learn Physics by Programming in Haskell [pdf]
#7I am intrigued by this approach (I have Structure and Interpretation of Classical Mechanics on my lengthy to-read pile) but I do wonder whether expecting ~sophomores to be trying to pick up Haskell and the physics at the same time is a bit much. The aspect of this that interests me most is related to a classic observation that, for most people learning physics, it's hard to separate difficulties with the physical con…
For something like this, where you're probably just loading some pure functions into GHCi? No harder than Mathematica or something like it really.
Re: Learn Physics by Programming in Haskell [pdf]
#8...This is not trivial to do with Haskell’s type system because one wants multiplication to “multiply the units” as well as the numbers."
F# supports units: https://msdn.microsoft.com/en-us/library/dd233243.aspx
Re: Learn Physics by Programming in Haskell [pdf]
#9For example, I made a little rollercoaster simulation to demonstrate the power of Lagrangian mechanics and generalized coordinates to myself. On the electrodynamics course I programmed a solver for Poisson's equation using the finite difference method to see a little more than the few simple geometries we calculated by hand. That kind of voluntary activities have greatly motivated me and helped me to understand various concepts.
On some courses we already have some simulation work and numerics in homework problems. Maybe deeper integration of programming into teaching requires time and, more importantly, a driving force and resources behind it. Then, of course, not everyone would be happy to see that kind of integration – I'm sure some would feel like they're forced to learn to program. And, as it has been seen on our entry level numerical physics course, learning programming, numerics and physics the same time is really quite hard.
Given those shortcomings, I still feel this is the way to go for future physics education. A gentle introduction and slowly teaching programming alongside physics would be the key, I think.
Re: Learn Physics by Programming in Haskell [pdf]
#10Fields in Physics are like Curried Functions or Physics for Functional Programmers: http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.49.1...