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
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -2163,7 +2163,7 @@ \section{System objects}
2163
2163
plot_results(census, un, results, 'Constant growth model')
2164
2164
\end{python}
2165
2165
2166
-
The results are the same as Figure~\ref{chap03-fig02}.
2166
+
The results are the same as Figure~\ref{chap05-fig02}.
2167
2167
2168
2168
It might not be obvious that using functions and \py{System} objects is a big improvement, and for a simple model that we run only once, maybe it's not. But as we work with more complex models, and when we run many simulations with different parameters, we'll see that the organization of the code makes a big difference.
2169
2169
@@ -2261,7 +2261,7 @@ \section{Factoring out the update function}
2261
2261
2262
2262
Passing a function as an argument is the same as passing any other value. The argument, which is \py{update_func1} in this example, gets assigned to the parameter, which is called \py{update_func}. Inside \py{run_simulation}, we can run \py{update_func} just like any other function.
2263
2263
2264
-
The loop in \py{run_simulation} calls \py{update_func1} once for each year between \py{t_0} and \py{t_end-1}. The result is the same as Figure~\ref{chap03-fig03}.
2264
+
The loop in \py{run_simulation} calls \py{update_func1} once for each year between \py{t_0} and \py{t_end-1}. The result is the same as Figure~\ref{chap06-fig01}.
2265
2265
2266
2266
2267
2267
\section{Combining birth and death}
@@ -2288,7 +2288,7 @@ \section{Combining birth and death}
2288
2288
results = run_simulation(system, update_func2)
2289
2289
\end{python}
2290
2290
2291
-
Again, the result is the same as Figure~\ref{chap03-fig03}.
2291
+
Again, the result is the same as Figure~\ref{chap06-fig01}.
2292
2292
2293
2293
Before you go on, you might want to read the notebook for this chapter, \py{chap06.ipynb}, and work on the exercises. For instructions on downloading and running the code, see Section~\ref{code}.
We have already seen the results in Figure~\ref{chap03-fig04}. Now, to generate a projection, the only thing we have to change is \py{t_end}:
2585
+
We have already seen the results in Figure~\ref{chap07-fig01}. Now, to generate a projection, the only thing we have to change is \py{t_end}:
2586
2586
2587
2587
\begin{python}
2588
2588
system.t_end = 2250
@@ -2832,7 +2832,7 @@ \section{Analysis and simulation}
2832
2832
2833
2833
\begin{itemize}
2834
2834
2835
-
\item With analysis we can sometimes compute, exactly and efficiently, a value that we could only approximate, less efficiently, with simulation. For example, in Figure~\ref{chap03-fig05}, we can see that net growth goes to zero near 14 billion, and we could estimate carrying capacity using a numerical search algorithm (more about that later). But with the analysis in Section~\ref{equilibrium}, we get the general result that $K=-\alpha/\beta$.
2835
+
\item With analysis we can sometimes compute, exactly and efficiently, a value that we could only approximate, less efficiently, with simulation. For example, in Figure~\ref{chap07-fig02}, we can see that net growth goes to zero near 14 billion, and we could estimate carrying capacity using a numerical search algorithm (more about that later). But with the analysis in Section~\ref{equilibrium}, we get the general result that $K=-\alpha/\beta$.
2836
2836
2837
2837
\item Analysis often provides ``computational shortcuts", that is, the ability to jump forward in time to compute the state of a system many time steps in the future without computing the intervening states.
2838
2838
@@ -3857,6 +3857,12 @@ \section{Immunization}
3857
3857
3858
3858
Without immunization, almost 47\% of the population gets infected at some point. With 10\% immunization, only 31\% gets infected. That's pretty good.
\caption{Fraction of the population infected as a function of immunization rate.}
3863
+
\label{chap12-fig02}
3864
+
\end{figure}
3865
+
3860
3866
Now let's see what happens if we administer more vaccines. This following function sweeps a range of immunization rates:
3861
3867
3862
3868
\index{sweep}
@@ -3883,17 +3889,11 @@ \section{Immunization}
3883
3889
3884
3890
As the immunization rate increases, the number of infections drops steeply. If 40\% of the students are immunized, fewer than 4\% get sick. That's because immunization has two effects: it protects the people who get immunized (of course) but it also protects the rest of the population.
\caption{Fraction of the population infected as a function of immunization rate.}
3889
-
\label{chap12-fig02}
3890
-
\end{figure}
3891
-
3892
3892
Reducing the number of ``susceptibles" and increasing the number of ``resistants" makes it harder for the disease to spread, because some fraction of contacts are wasted on people who cannot be infected. This phenomenon is called {\bf herd immunity}, and it is an important element of public health (see \url{http://modsimpy.com/herd}).
3893
3893
3894
3894
\index{herd immunity}
3895
3895
3896
-
The steepness of the curve in Figure~\ref{chap05-fig03} is a blessing and a curse. It's a blessing because it means we don't have to immunize everyone, and vaccines can protect the ``herd" even if they are not 100\% effective.
3896
+
The steepness of the curve in Figure~\ref{chap12-fig02} is a blessing and a curse. It's a blessing because it means we don't have to immunize everyone, and vaccines can protect the ``herd" even if they are not 100\% effective.
3897
3897
3898
3898
But it's a curse because a small decrease in immunization can cause a big increase in infections. In this example, if we drop from 80\% immunization to 60\%, that might not be too bad. But if we drop from 40\% to 20\%, that would trigger a major outbreak, affecting more than 15\% of the population. For a serious disease like measles, just to name one, that would be a public health catastrophe.
3899
3899
@@ -4169,7 +4169,7 @@ \section{Sweeping gamma}
4169
4169
\label{chap13-fig02}
4170
4170
\end{figure}
4171
4171
4172
-
Figure~\ref{chap06-fig13} shows the results. When \py{gamma} is low, the recovery rate is low, which means people are infectious longer. In that case, even a low contact rate (\py{beta}) results in an epidemic.
4172
+
Figure~\ref{chap13-fig02} shows the results. When \py{gamma} is low, the recovery rate is low, which means people are infectious longer. In that case, even a low contact rate (\py{beta}) results in an epidemic.
4173
4173
4174
4174
When \py{gamma} is high, \py{beta} has to be even higher to get things going.
0 commit comments