X Tutup
Skip to content

Commit d9d09a6

Browse files
committed
Working on Chapter 9
1 parent db3f485 commit d9d09a6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

book/book.tex

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
\newcommand{\thetitle}{Modeling and Simulation in Python}
1414
\newcommand{\thesubtitle}{}
1515
\newcommand{\theauthors}{Allen B. Downey}
16-
\newcommand{\theversion}{0.7.2}
16+
\newcommand{\theversion}{0.9.2}
1717

1818

1919
%%%% Both LATEX and PLASTEX
@@ -4478,7 +4478,7 @@ \section{With air resistance}
44784478
%
44794479
\[ C_d = \frac{2~m g}{\rho~v_{term}^2~A} \]
44804480
%
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.
44824482

44834483
Now we are ready to add air resistance to the model.
44844484

@@ -4602,7 +4602,9 @@ \section{Dropping quarters}
46024602
run_odeint(system, slope_func)
46034603
\end{python}
46044604

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:
46064608

46074609
\begin{python}
46084610
def height_func(C_d, condition):
@@ -4627,6 +4629,8 @@ \section{Dropping quarters}
46274629

46284630
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.
46294631

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}.
4633+
46304634

46314635
\chapter{Baseball}
46324636

0 commit comments

Comments
 (0)
X Tutup