Modeling and Simulation in Python teaches readers how to analyze real-world scenarios using the Python programming language, requiring no more than a background in high school math.
Modeling and Simulation in Python is a thorough but easy-to-follow introduction to physical modeling—that is, the art of describing and simulating real-world systems. Readers are guided through modeling things like world population growth, infectious disease, bungee jumping, baseball flight trajectories, celestial mechanics, and more while simultaneously developing a strong understanding of fundamental programming concepts like loops, vectors, and functions.
Clear and concise, with a focus on learning by doing, the author spares the reader abstract, theoretical complexities and gets right to hands-on examples that show how to produce useful models and simulations.
Allen Downey is a Professor Emeritus at Olin College and the author of a series of freetextbooks related to software and data science, including Think Python, Think Bayes, and Think Complexity, which are also published by O’Reilly Media. His blog, Probably Overthinking It, features articles on Bayesian probability and statistics. He holds a Ph.D. in computer science from U.C. Berkeley, and M.S. and B.S. degrees from MIT.
This book introduces the main concepts of modeling and simulation in a practical, hands-on, case study-based fashion using Jupyter notebooks. The author keeps the mathematics to the bare minimum (it only requires a superficial knowledge of derivatives) while having the applications area as broad as possible. It covers first-order differential equations (growth), simple systems (the SIR model and an insulin model) and several second-order systems based on Newton's second law (rolling toilet paper and throwing a baseball). Most examples are solved using custom ModSim software that uses a finite-step method. The author also introduces other tools, such as solving differential equations in Sympy and root-finding methods for optimization and parameter finding.
I found this book while researching how to develop a more practical version of the modeling course I teach (that now only covers ODEs). This book is very introductory and likely won't appeal to those who have advanced mathematics courses at some point. However, for those who did not, it is a very accessible introduction to modeling that can immediately be used for a wide range of systems. The author also has a lot of notebooks online for the exercises.
Modeling and Simulation in Python is a book by Allen B. Downey about making mathematical models using the Python Programming Language. Along the way, we learn what to include in a physical model and what to ignore. Downey shows how to incorporate differential equations in your models.
One excellent example comes in the first problem presented by the book. If you dropped a coin at the top of the Empire State Building and it hit someone at sidewalk level, would that person die? At first blush, the coin's speed would be 86 meters per second, which would hurt. However, the book notes that we didn't factor in the wind resistance. With the air friction slowing it, our coin would only reach a speed of 29 meters per second.
Another model the book presents is a bike-sharing system between two college campuses. The author discusses methods to deal with bugs and errors in the model. Downey introduces Incremental Development to achieve this. First, begin with code that you know works. Next, make a small change to that code. Finally, if it breaks, you can easily find the issue.
Downey introduces differential equations with the classic cooling coffee model. I hadn't heard of it before, but Scientific American published it in 1977.
I enjoyed the book. Thanks for reading my review, and see you next time.
Since I had a coupon for No Starch Press, and my day job involves both Python and simulation, this seemed like an interesting book to pick-up to review. To that end, the author does a good job of outlining what to expect in the title: this is an introduction for scientists and engineers. You are not going to become proficient at Python by the end of this book, nor will become proficient at modelling an simulation.
With that being said, this book is well structured for someone that knows Python and is looking to get a handle on how modelling and simulation is done, with a level of writing and challenge that is roughly what you would expect from a second or third year undergraduate course. So the reader is expected to have been exposed to calculus, but all of the deviations are done for you along with the more advanced mathematics. Effectively, the book's objective seems to be putting forth why people in modelling and simulation like to repeat, "All models are wrong, some are useful."
Unfortunately, for practitioners of modelling and simulation, you are unlikely to get much out of this book unless you are examining it as a possible teaching aid. To that end, there are certainty some good ideas here for how to approach introduction these topics to new audiences.
You can get the book for free directly from the GitHub Account of the author at https://allendowney.github.io/ModSimPy/ . The interactive notebooks are a great help to follow along and experiment with the concepts yourself.
I found the book itself too shallow and the explanations of the concept not good enough to understand them. With the notebooks a lot of that could be mitigated.