Jump to ratings and reviews
Rate this book

Modeling and Simulation in Python

Rate this book
The essential skills of modeling — abstraction, analysis, simulation, and vali-
dation — are central in engineering, natural sciences, social sciences, medicine,
and many other fields. Some students learn these skills implicitly, but in most
schools they are not taught explicitly, and students get little practice. That’s
the problem this book is meant to address.

At Olin College, we use this book in a class called Modeling and Simulation,
which all students take in their first semester. My colleagues, John Geddes
and Mark Somerville, and I developed this class and taught it for the first time
in 2009.

It is based on our belief that modeling should be taught explicitly, early, and
throughout the curriculum. It is also based on our conviction that computation
is an essential part of this process.

If students are limited to the mathematical analysis they can do by hand, they
are restricted to a small number of simple physical systems, like a projectile
moving in a vacuum or a block on a frictionless plane.

And they will only work with bad models; that is, models that are too simple
for their intended purpose. In nearly every mechanical system, air resistance
and friction are essential features; if we ignore them, our predictions will be
wrong and our designs won’t work.

In most freshman physics classes, students don’t make modeling decisions;
sometimes they are not even aware of the decisions that have been made for
them. Our goal is to teach the entire modeling process and give students a
chance to practice it.

255 pages, ebook

Published August 20, 2018

35 people are currently reading
84 people want to read

About the author

Allen B. Downey

37 books233 followers
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.

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
2 (11%)
4 stars
10 (58%)
3 stars
5 (29%)
2 stars
0 (0%)
1 star
0 (0%)
Displaying 1 - 5 of 5 reviews
Profile Image for Michiel.
383 reviews90 followers
October 8, 2023
(review of the 2023 version)

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.
Profile Image for William Schram.
2,340 reviews96 followers
January 15, 2024
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.
Profile Image for Rob.
36 reviews
September 23, 2023
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.
600 reviews11 followers
August 11, 2024
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.
Displaying 1 - 5 of 5 reviews

Can't find what you're looking for?

Get help and learn more about the design.