Modeling and Simulation in Python Cover

Modeling and Simulation in Python

Use Computation to Predict and Explain the World
by Allen B. Downey
April 2023, 272 pp.


Look Inside!

The Book of Dash pages 44-45The Book of Dash  pages 64-65The Book of Dash pages 138-139The Book of Dash pages 164-165

Use coupon code PREORDERMODELING to get 30% off!
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.

Author Bio 

Allen Downey is a Staff Scientist at DrivenData and Professor Emeritus at Olin College, where he taught Modeling and Simulation and other classes related to software and data science. He is the author of several textbooks, including Think PythonThink Bayes, and Elements of Data Science. Previously, he taught at Wellesley College and Colby College. He received his Ph.D. in computer science from the University of California, Berkeley in 1997. His undergraduate and master's degrees are from the Civil Engineering department at MIT. He is the author of Probably Overthinking It, a blog about data science and Bayesian statistics.

Table of contents 

Chapter 1: Introduction to Modeling
Chapter 2: Modeling a Bike Share System
Chapter 3: Iterative Modeling
Chapter 4: Parameters and Metrics
Chapter 5: Building a Population Model
Chapter 6: Iterating the Population Model
Chapter 7: Limits to Growth
Chapter 8: Projecting into the Future
Chapter 9: Analysis and Symbolic Computation
Chapter 10: Case Studies Part I
Chapter 11: Epidemiology and SIR Models
Chapter 12: Quantifying Interventions
Chapter 13: Sweeping Parameters
Chapter 14: Nondimensionalization
Chapter 15: Thermal Systems
Chapter 16: Solving the Coffee Problem
Chapter 17: Modeling Blood Sugar
Chapter 18: Implementing the Minimal Model
Chapter 19: Case Studies Part II
Chapter 20: The Falling Penny Revisited
Chapter 21: Drag
Chapter 22: Two-Dimensional Motion
Chapter 23: Optimization
Chapter 24: Rotation
Chapter 25: Torque
Chapter 26: Case Studies Part III
Appendix: Under the Hood


The chapters in red are included in this Early Access PDF.


"Modeling and Simulation in Python is an introduction to physical modeling using a computational approach . . . Taking a computational approach makes it possible to work with more realistic models than what you typically see in a first-year physics class, with the option to include features like friction and drag."
—Python Kitchen

“Allen Downey’s Modeling and Simulation in Python provides a wealth of instructive examples of all kinds of modeling. . . . this book can be valuable as a textbook for classes on scientific computation, or as a guide to exploration for interested amateurs.”
—Bradford Tuckfield, Author of Dive into Algorithms and Dive Into Data Science

“This book is designed for newcomers to both Python and computer modeling. If you’ve read Think Python, you know that Downey is an accomplished teacher, and here he uses a combination of Python, calculus, bespoke helper functions, and easily-accessible online materials to model a diverse and interesting set of simulation projects. In the process, he presents a practical and reusable framework for modeling dynamical systems with Python.”
—Lee Vaughan, Author of Python Tools for Scientists, Real-World Python, and Impractical Python Projects, and former Senior Principal Scientist for Geological Modeling at ExxonMobil