Learn Physics with Functional Programming

Learn Physics with Functional Programming

作者:Scott N. Walck

出版社:No Starch Press

出版年:2023-1

ISBN:9781718501669

所属分类:行业好书

书刊介绍

内容简介

This book teaches you to solve physics problems using the functional programming paradigm. Ideal for first-time programmers and science aficionados alike, it introduces the Haskell programming language and encourages the writing of beautiful code to match the elegant ideas of theoretical physics.

Early chapters cover the basics of coding in Haskell, which has a powerful system of types capable of encoding important mathematical structures in physics, like vectors, derivatives, integrals, scalar fields, vector fields, and differential equations. Later sections of the book explore Newtonian mechanics and electromagnetics—two central pillars of theoretical physics. In addition, you’ll get a deep look into source code, and discover why Haskell’s high-order functions and referential transparency serve physics so well. Along the way, you’ll learn:

•How to write beautiful code that expresses fundamental physical principles

•How to make graphs and animations of interesting situations

•How to program in a language that looks like mathematics

•How types, high order functions, and referential transparency serve physics well

作品目录

ACKNOWLEDGMENTS
INTRODUCTION
PART I A HASKELL PRIMER FOR PHYSICISTS
1 CALCULATING WITH HASKELL
2 WRITING BASIC FUNCTIONS
3 TYPES AND ENTITIES
4 DESCRIBING MOTION
5 WORKING WITH LISTS
6 HIGHER-ORDER FUNCTIONS
7 GRAPHING FUNCTIONS
8 TYPE CLASSES
9 TUPLES AND TYPE CONSTRUCTORS
10 DESCRIBING MOTION IN THREE DIMENSIONS
11 CREATING GRAPHS
12 CREATING STAND-ALONE PROGRAMS
13 CREATING 2D AND 3D ANIMATIONS
PART II EXPRESSING NEWTONIAN MECHANICS AND SOLVING PROBLEMS
14 NEWTON’S SECOND LAW AND DIFFERENTIAL EQUATIONS
15 MECHANICS IN ONE DIMENSION
16 MECHANICS IN THREE DIMENSIONS
17 SATELLITE, PROJECTILE, AND PROTON MOTION
18 A VERY SHORT PRIMER ON RELATIVITY
19 INTERACTING PARTICLES
20 SPRINGS, BILLIARD BALLS, AND A GUITAR STRING
PART III EXPRESSING ELECTROMAGNETIC THEORY AND SOLVING PROBLEMS
21 ELECTRICITY
22 COORDINATE SYSTEMS AND FIELDS
23 CURVES, SURFACES, AND VOLUMES
24 ELECTRIC CHARGE
25 ELECTRIC FIELD
26 ELECTRIC CURRENT
27 MAGNETIC FIELD
28 THE LORENTZ FORCE LAW
29 THE MAXWELL EQUATIONS
APPENDIX: INSTALLING HASKELL
BIBLIOGRAPHY
INDEX
· · · · · ·

作者简介

Scott N. Walck has a PhD in physics from Lehigh University. He has taught physics, including computational physics, to undergraduates (physics majors and non-majors) for 20 years at Lebanon Valley College, where he has been recognized with a Distinguished Teaching Award. Walck is a three-time NSF grant recipient for research in quantum information and is the author of more than...

(展开全部)

相关推荐

微信二维码