You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/book.tex
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -13,7 +13,7 @@
13
13
\newcommand{\thetitle}{Modeling and Simulation in Python}
14
14
\newcommand{\thesubtitle}{}
15
15
\newcommand{\theauthors}{Allen B. Downey}
16
-
\newcommand{\theversion}{0.7.2}
16
+
\newcommand{\theversion}{0.9.2}
17
17
18
18
19
19
%%%% Both LATEX and PLASTEX
@@ -4478,7 +4478,7 @@ \section{With air resistance}
4478
4478
%
4479
4479
\[ C_d = \frac{2~m g}{\rho~v_{term}^2~A} \]
4480
4480
%
4481
-
According to Mythbusters, the terminal velocity of a penny is between 35 and 65 mph (see \url{https://en.wikipedia.org/wiki/MythBusters_(2003_season)}. Using the low end of their range, 40 mph or about \SI{18}{\meter\per\second}, the estimated value of $C_d$ is 0.44, which is close to the drag coefficient of a smooth sphere.
4481
+
According to Mythbusters, the terminal velocity of a penny is between 35 and 65 mph (see \url{https://en.wikipedia.org/wiki/MythBusters_(2003_season)}). Using the low end of their range, 40 mph or about \SI{18}{\meter\per\second}, the estimated value of $C_d$ is 0.44, which is close to the drag coefficient of a smooth sphere.
4482
4482
4483
4483
Now we are ready to add air resistance to the model.
4484
4484
@@ -4602,7 +4602,9 @@ \section{Dropping quarters}
4602
4602
run_odeint(system, slope_func)
4603
4603
\end{python}
4604
4604
4605
-
With \py{C_d=0.4}, the height of the quarter after \SI{19.1}{\second} is \SI{-11}{\meter}. That means the quarter is moving a bit too fast, which means our estimate for the drag coefficient is too low. We could improve the estimate by trial and error, or we could get \py{fsolve} to do it for us. As usual, we'll need an error function:
4605
+
With \py{C_d=0.4}, the height of the quarter after \SI{19.1}{\second} is \SI{-11}{\meter}. That means the quarter is moving a bit too fast, which means our estimate for the drag coefficient is too low. We could improve the estimate by trial and error, or we could get \py{fsolve} to do it for us.
4606
+
4607
+
To use \py{fsolve}, we need an error function, which we can define by encapsulating the previous lines of code:
4606
4608
4607
4609
\begin{python}
4608
4610
def height_func(C_d, condition):
@@ -4627,6 +4629,8 @@ \section{Dropping quarters}
4627
4629
4628
4630
Nevertheless, the methods we developed for estimating \py{C_d}, based on terminal velocity or flight time, are valid, subject to the precision of the measurements.
4629
4631
4632
+
These methods demonstrate two ways to use models to solve problems, sometimes called {\bf forward} and {\bf inverse} problems. In a forward problem, you are given the parameters of the system and asked to predict how it will behave. In an inverse problem, you are given the behavior of the system and asked to infer the parameters. See \url{https://en.wikipedia.org/wiki/Inverse_problem}.
0 commit comments