This book assumes no Python knowledge, introducing some basic syntax as required. Much of the code uses a wrapper around various libraries including SciPy, NumPy, Matplotlib and pandas (and more besides), so that you don’t need to install lots of libraries. The introduction lists assumed physics/mathematics knowledge. The author says familiarity with Newton’s laws of motion and the relationship between distance, velocity and acceleration is assumed. He also says knowing integrals and derivatives, even if you can’t remember how or why is useful. I do know calculus, so I suspect you would need to just take his word for it if you don’t know where he gets some of the equations from. That might be fair enough, and he does say working with the models might help build an intuition.
Each chapter is remarkably short, some only four or five pages. This felt unusual initially, but made it easy to read. The break every few pages gave me the opportunity to either stop and think, or plough on.
The publisher’s webpage, https://nostarch.com/modeling-and-simulation-python, lists the table of contents. They are grouped into three parts; discrete systems, including some population models, first-order systems (think some calculus and some differential equations), including epidemiology (spread of diseases), and finally second-order systems (think more calculus and slightly harder differential equations, including modeling rolling toilet rolls onto tubes. You don’t need to solve the differential equations, since they are simply used to generate numbers.
In all models, you are encouraged to vary the parameters and see what happens. One of two models types were familiar, since I have read up on epidemiology and I did study physics for ‘A’ level. However, many of the models introduced were completely new to me. A mix of some hazy things I used to know with lots of new things was interesting and fun. The models start simple and gradually build up, sometimes adding extra ideas like drag to a simpler model built earlier. That makes the book easy to follow, while still covering lots.
If you want to learn Python, and know a little physics or maths, this book will give a gentle introduction. You would probably need to follow this up with further resources to thoroughly get the hang of Python, but it would be a starting point. If you have never built a model using a differential equation, or even a simpler population model, you will get something working if you follow the book. I suspect you would learn the basics of modeling on the way. Again, you would still have lots more to learn, but this book would be a good starting point.
It’s a lovely book that doesn’t take long to read, while managing to cover lots of different ideas. Getting your computer to do the tedious calculations for you and plot graphs is always a good idea. Definitely worth a read if you want to play around modeling some equations.
When I wrote this review, I had a hunt on the internet for the book and author and fell across a website the author has created (see https://greenteapress.com/wp/textbook-manifesto/), where he talks about the need for good books. Towards the end, he give advice for students: “If your textbook costs more than $50, don’t buy it. If it has more than 500 pages, don’t read it. There’s just no excuse for bad books.” This is sensible advice for anyone, not just students, and this book certainly fits the bill.