-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlinear.txt
More file actions
2047 lines (1074 loc) · 44.8 KB
/
linear.txt
File metadata and controls
2047 lines (1074 loc) · 44.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
UNIT 1: Linear population models
----------------------------------------------------------------------
SEC Example populations
----------------------------------------------------------------------
TSS Dandelions
BC
Start with one dandelion; it produces 100 seeds, of which only
4% survive to reproduce the next year.
How many dandelions after 3 years?
ANS 64?
ANS 125?
HREF https://bio3ss.github.io/linear.html See spreadsheet on resource page
The spreadsheet is an implementation of a dynamical model!
NC
SIDEFIG images/dandy_field.jpg
EC
----------------------------------------------------------------------
Dynamical models
Make rules about how things change on a small scale
Assumptions should be clear enough to allow you to calculate or simulate
population-level resuls
Challenging and clarifying assumptions is a key advantage of models
----------------------------------------------------------------------
TSS Gypsy moths
BC
A pest species that feeds on deciduous trees
Introduced to N. America from Europe ~ 150 years ago
Capable of wide-scale defoliation
NC
SIDEFIG images/gm_caterpillar.jpg
SIDEFIG images/gm_defoliation.jpg
EC
----------------------------------------------------------------------
Gypsy moth populations
DOUBLEPDF ts/gm10165.simple.Rout
----------------------------------------------------------------------
RSLIDE Moth calculation
Researchers studying a gypsy moth population make the following
estimates:
The average reproductive female lays 600 eggs
10% of eggs hatch into larvae
10% of larvae mature into pupae
50% of pupae mature into adults
50% of adults survive to reproduce
All adults die after reproduction
POLL free_text_polls/UXPcZzeu284rM7p What happens if we start with 10 moths?
ANS We end up with 15 moths
ANS On average
----------------------------------------------------------------------
Moth calculation
Researchers studying a gypsy moth population make the following
estimates:
The average reproductive female lays 600 eggs
CLASS ANS Assume half are female
10% of eggs hatch into larvae
10% of larvae mature into pupae
50% of pupae mature into adults
50% of adults survive to reproduce
All adults die after reproduction
What happens if we start with 10 moths?
ANS If 5 are female, we end up with an average of 7.5 moths
----------------------------------------------------------------------
Stochastic version
Obviously, we will not get \emph{exactly} 7.5 moths.
If we consider moths as individuals, we need a \textbf{stochastic}
model
What do we mean by stochastic?
ANS The model has randomness, to reflect details that we can't
measure in advance, or can't predict
----------------------------------------------------------------------
RSLIDE Stochastic model
FIG exponential/dandelion.Rout-0.pdf
----------------------------------------------------------------------
RSLIDE Stochastic model
FIG exponential/dandelion.Rout-1.pdf
----------------------------------------------------------------------
RSLIDE Stochastic model
FIG exponential/dandelion.Rout-2.pdf
----------------------------------------------------------------------
Stochastic model
ADD Switch sides for next year
BCC
A stochastic model has randomness in the model.
If we run it again with the same parameters and starting conditions, we get a different answer
NCC
WIDEFIG exponential/dandelion.Rout-2.pdf
EC
----------------------------------------------------------------------
TSS Bacteria
Imagine we have some bacteria growing in a big tank, constantly
dividing and dying:
They divide (forming two bacteria from one) at a rate
of $0.04/\hr$
They wash out of the tank at a rate of 0.02/\hr
They die at a rate of 0.01/\hr
Rates are \textbf{per capita} (i.e., per individual) and
\textbf{instaneous} (they describe what is happening at each moment
of time)
We start with 10 bacteria/ml
How many do we have after 1 hr?
What about after 1 day?
----------------------------------------------------------------------
RSLIDE Bacteria in a tank
FIG images/chemostats.png
----------------------------------------------------------------------
Bacteria, rescaled
Imagine we have some bacteria growing in a big tank:
They divide (forming two bacteria from one) at a rate of
0.96/day
They wash out of the tank at a rate of 0.48/day
They die at a rate of 0.24/day
If we start with 10 bacteria/ml, how many do we have after 1 day?
----------------------------------------------------------------------
Units
When we attach units to a quantity, the meaning is concrete
0.24/day \emph{must} mean exactly the same thing as 0.01/hr
The two questions above \emph{must} have the same answer
----------------------------------------------------------------------
RSLIDE Bacteriostasis
What if we add an agent to the tank that makes the birth and death
rates nearly zero?
Now the bacteria are merely washing out at the rate of 0.02/hr
If we start with 10 bacteria/ml, how many do we have after:
POLL free_text_polls/RGIksOrgB7BwtEm 1 hr?
POLL free_text_polls/WdKNKRCE7Q6hr3U 1 wk?
----------------------------------------------------------------------
TSEC Exponential growth
What is exponential growth?
Which of these is an example?
FIG exponential/exponential.Rout.four.pdf
----------------------------------------------------------------------
RSLIDE A
FIG exponential/exponential.Rout-0.pdf
----------------------------------------------------------------------
RSLIDE B
FIG exponential/exponential.Rout-1.pdf
----------------------------------------------------------------------
RSLIDE C
FIG exponential/exponential.Rout-2.pdf
----------------------------------------------------------------------
RSLIDE D
FIG exponential/exponential.Rout-3.pdf
----------------------------------------------------------------------
RSLIDE Exponential growth
POLL free_text_polls/oItfgStGB94yj9Z What is exponential growth?
POLL multiple_choice_polls/1rEH4rixsf0SNLZ Which of these is an example?
FIG exponential/exponential.Rout.four.pdf
----------------------------------------------------------------------
RSLIDE A
FIG exponential/exponential.Rout-0.pdf
----------------------------------------------------------------------
RSLIDE B
FIG exponential/exponential.Rout-1.pdf
----------------------------------------------------------------------
RSLIDE C
FIG exponential/exponential.Rout-2.pdf
----------------------------------------------------------------------
RSLIDE D
FIG exponential/exponential.Rout-3.pdf
----------------------------------------------------------------------
RSLIDE A
FIG exponential/exponential.Rout-0.pdf
----------------------------------------------------------------------
ASLIDE A on the log scale
FIG exponential/exponential.Rout-4.pdf
----------------------------------------------------------------------
RSLIDE C
FIG exponential/exponential.Rout-2.pdf
----------------------------------------------------------------------
ASLIDE C on the linear scale
FIG exponential/exponential.Rout-5.pdf
----------------------------------------------------------------------
Types of growth
arithmetic/linear:
ANS \emph{Add} a fixed amount in a given time interval
ANS Total growth rate is constant
geometric/exponential:
ANS \emph{Multiply} by a fixed amount in a given time interval
ANS Per-capita growth is constant
ANS Only C is exponential, mathematically speaking.
other:
Many possibilities, we may discuss some later
----------------------------------------------------------------------
Exponential decline?
POLL multiple_choice_polls/1rEH4rixsf0SNLZ What does exponential decline look like?
ANS Decline is proportional to size
ANS Declines more and more \emph{slowly} (on linear scale)
----------------------------------------------------------------------
ASLIDE Exponential decline
BC
WIDEFIG exponential/decline.Rout-6.pdf
NC
Decline is proportional to size
Declines more and more \emph{slowly} (on linear scale)
EC
----------------------------------------------------------------------
Terminology
Sometimes people distinguish
\textbf{arithmetic} from \textbf{linear} growth, or
\textbf{geometric} from \textbf{exponential} growth
Based on:
ANS \textbf{discrete} vs.\ \textbf{continuous} time
We won't worry much about this.
----------------------------------------------------------------------
SS Log and linear scales
----------------------------------------------------------------------
Scales of comparison
POLL free_text_polls/mSM205BkHzDKpkP 1 is to 10 as 10 is to what?
ANS If you said 100, you are thinking multiplicatively
ANS If you said 19, you are thinking additively
----------------------------------------------------------------------
RSLIDE Scales of display
FIG exponential/comparison.Rout-2.pdf
----------------------------------------------------------------------
RSLIDE Scales of display
FIG exponential/comparison.Rout-0.pdf
----------------------------------------------------------------------
RSLIDE Scales of display
FIG exponential/comparison.Rout-3.pdf
----------------------------------------------------------------------
RSLIDE Scales of display
FIG exponential/comparison.Rout-1.pdf
----------------------------------------------------------------------
Scales of display
DOUBLEPDF exponential/comparison.Rout
There is only one log scale; it doesn't matter which base you use!
----------------------------------------------------------------------
RSLIDE Canadian provinces
CHANGE CC: Add a poll What are the most unusual provinces in Canada
FIG exponential/canada.Rout-0.pdf
----------------------------------------------------------------------
Canadian provinces
FIG exponential/canada.Rout-1.pdf
----------------------------------------------------------------------
Canadian provinces
DOUBLEFIG exponential/canada.Rout-0.pdf exponential/canada.Rout-1.pdf
----------------------------------------------------------------------
RSLIDE Canadian provinces plus Canada?
DOUBLEFIG exponential/canada.Rout-0.pdf exponential/canada.Rout-0.pdf
----------------------------------------------------------------------
RSLIDE Canadian provinces plus Canada
DOUBLEFIG exponential/canada.Rout-0.pdf exponential/canada.Rout-2.pdf
----------------------------------------------------------------------
RSLIDE Canadian provinces plus Canada?
DOUBLEFIG exponential/canada.Rout-1.pdf exponential/canada.Rout-1.pdf
----------------------------------------------------------------------
RSLIDE Canadian provinces plus Canada
DOUBLEFIG exponential/canada.Rout-1.pdf exponential/canada.Rout-3.pdf
----------------------------------------------------------------------
ASLIDE Canadian provinces plus Canada
DOUBLEFIG exponential/canada.Rout-2.pdf exponential/canada.Rout-3.pdf
----------------------------------------------------------------------
RSLIDE Canada plus room 1105?
DOUBLEFIG exponential/canada.Rout-2.pdf exponential/canada.Rout-2.pdf
----------------------------------------------------------------------
RSLIDE Canada plus room 1105
DOUBLEFIG exponential/canada.Rout-2.pdf exponential/canada.Rout-4.pdf
----------------------------------------------------------------------
RSLIDE Canada plus room 1105?
DOUBLEFIG exponential/canada.Rout-3.pdf exponential/canada.Rout-3.pdf
----------------------------------------------------------------------
RSLIDE Canada plus room 1105
DOUBLEFIG exponential/canada.Rout-3.pdf exponential/canada.Rout-5.pdf
----------------------------------------------------------------------
ASLIDE Canada plus room 1105
DOUBLEFIG exponential/canada.Rout-4.pdf exponential/canada.Rout-5.pdf
----------------------------------------------------------------------
CLASS CSLIDE Predation comparison
CLASS FIG images/buffalo.jpg
----------------------------------------------------------------------
Predation comparison
BC
A 500 lb lion is attacking a 1000 lb buffalo!
POLL multiple_choice_polls/NCHfvX2CUGV2GoJ This is analogous to a 15 lb red fox attacking:|
A 30 lb beaver (twice as heavy)?
A 515 lb elk (500 lbs heavier)?
NC
CLASS HFIG 0.25 images/fox.jpg
CLASS HFIG 0.25 images/beaver.jpg
CLASS HFIG 0.25 images/elk.jpg
EC
----------------------------------------------------------------------
Different scales
The log scale and linear scale provide different ways of looking at
the same data
Equally valid
What are some advantages of each?
----------------------------------------------------------------------
Advantages of arithmetic view
ANS When there is no natural zero (or the natural zero is irrelevant)
ANS Often the case for time or geography
ANS When zeroes (or negative numbers) can occur
ANS When we are interested in adding things up
----------------------------------------------------------------------
Advantages of geometric view
ANS When comparing physical quantities, or quantities with natural
units
ANS When comparing proportionally
----------------------------------------------------------------------
Gypsy-moth example
DOUBLEPDF ts/gm10165.simple.Rout
----------------------------------------------------------------------
Scales in population biology
The linear scale looks at differences at the population scale
The log scale looks at differences at the individual scale (per
capita)
----------------------------------------------------------------------
SS Time scales
----------------------------------------------------------------------
CSLIDE Speeding in Taiwan
BC
A life experience
Some clarifications
I was reading the sign wrong
I didn't actually know how to say speed
The whole thing never happened
NC
SIDEFIG images/tai3.jpg
EC
----------------------------------------------------------------------
CSLIDE Speeding in Taiwan
Moral:
Units (km is \emph{not} a speed)
Exponential decay
Imagine now that I follow the signs exactly and unrealistically.
POLL free_text_polls/yqZNkSY38WVmWmj Do I ever arrive in the (ideal) town of Speed?
ANS No. I am always an hour away!
ANS But I do get extremely close (after several hours)
Does anyone remember Zeno's paradox?
ANS Don't worry about it, then
----------------------------------------------------------------------
Characteristic times
If something is declining exponentially, the rate of change
(units [widgets/time]) is always proportional to the size of the
thing ([widgets]).
The constant ratio between the rate of change and the thing that is
changing is:
the \textbf{characteristic time} (something/change), or
the \textbf{rate of exponential decline} (change/something)
COMMENT I'm always 1 hour away from the town of Speed
----------------------------------------------------------------------
RSLIDE Characteristic times
FIG exponential/speed_story.Rout-0.pdf
----------------------------------------------------------------------
RSLIDE Characteristic times
FIG exponential/speed_story.Rout-1.pdf
----------------------------------------------------------------------
ASLIDE Characteristic times
FIG exponential/speed_story.Rout-2.pdf
----------------------------------------------------------------------
RSLIDE Characteristic times
FIG exponential/speed_story.Rout-3.pdf
----------------------------------------------------------------------
Bacteriostasis
What if we add an agent to the tank that makes the birth and death
rates nearly zero?
Now the bacteria are merely washing out at the rate of 0.02/hr
If we start with 10 bacteria/ml, how many do we have after:
POLL free_text_polls/Es8VWnO5ERxNOlx 1 hr?
POLL free_text_polls/c6LRaLzWaiQZFKa 1 wk?
CHANGE CC: Another poll or just showing the answers from yesterday?
----------------------------------------------------------------------
Bacteriostasis answers
Bacteria wash out at the rate of 0.02/hr
ANS This can only make sense with concrete units if we think of
it as an instantaneous rate -- more soon
ANS $N = N_0 exp(-rt)$
Start with 10 bacteria/ml:
ANS After one hour, 9.802 bacteria/ml
ANS After one week, 0.347 bacteria/ml
----------------------------------------------------------------------
Bacteriostasis analysis
Rate of exponential decline is $r = 0.02/\hr$
Characteristic time is $T_c = 1/r = 50 \hr$
If experiment time $t \ll T_c$, then proportional decline $\approx
t/T_c$
The answer makes sense for short times and for long times
COMMENT We will come back to this
----------------------------------------------------------------------
RSLIDE Characteristic times
FIG exponential/bacteria_scales.Rout-0.pdf
----------------------------------------------------------------------
RSLIDE Characteristic times
FIG exponential/bacteria_scales.Rout-1.pdf
----------------------------------------------------------------------
ASLIDE Characteristic times
FIG exponential/bacteria_scales.Rout-2.pdf
----------------------------------------------------------------------
RSLIDE Characteristic times
FIG exponential/bacteria_scales.Rout-3.pdf
----------------------------------------------------------------------
Euler's $e$
The reason mathematicians like $e$ is that it makes this link
between instantaneous change and long-term behaviour
If I drive for an hour, how much closer do I get to the ideal town
of Speed?
ANS $e$ times closer
----------------------------------------------------------------------
CONT Euler's $e$
$e$ or $1/e$ is the approximate answer to a lot of questions like this one
If I compound 1%/year interest for 100 years, how much does my money grow?
If two people go deal out two decks of cards simultaneously, what is the
probability they will never match cards?
If everyone picks up a backpack at random after a test, what's the probability nobody gets the right backpack?
----------------------------------------------------------------------
Exponential growth
We can think about exponential growth the same way as exponential
decline:
Things are always changing at a rate that would take a fixed
amount of time to get (back) to zero
This is the characteristic time
Exponential growth follows $N = N_0 \exp(rt) = N_0\exp(t/T_c)$
----------------------------------------------------------------------
RSLIDE Characteristic times
FIG exponential/bacteria_scales.Rout-4.pdf
----------------------------------------------------------------------
RSLIDE Characteristic times
FIG exponential/bacteria_scales.Rout-5.pdf
----------------------------------------------------------------------
ASLIDE Characteristic times
FIG exponential/bacteria_scales.Rout-6.pdf
----------------------------------------------------------------------
RSLIDE Characteristic times
FIG exponential/bacteria_scales.Rout-7.pdf
----------------------------------------------------------------------
Doubling time
Some people prefer to think about doubling times.
These make just as much sense as characteristic times, but don't
have the direct link to the instantaneous change.
It takes $T_c$ time to increase by a factor of $e$
It takes $\log_e(2) T_c \approx 0.69 T_c$ to increase by a factor
of 2
We can write $T_d = \log_e(2) T_c$
You should be able to do this calculation
NOTES $\exp(rT_d) = 2$
NOTES $T_d = \log_e(2)/r$
NOTES $T_d = \log_e(2) T_c$
----------------------------------------------------------------------
RSLIDE
FIG exponential/bacteria_times.Rout-3.pdf
----------------------------------------------------------------------
RSLIDE
FIG exponential/bacteria_times.Rout-4.pdf
----------------------------------------------------------------------
ASLIDE Characterstic time and doubling time
FIG exponential/bacteria_times.Rout-5.pdf
----------------------------------------------------------------------
Half life
The half life plays the same role for exponential decline as the
doubling time does for exponential growth:
$T_h = \log_e(2) T_c$
It takes $T_c$ time for a declining population to decrease by a
factor of $e$
It takes $\log_e(2) T_c \approx 0.69 T_c$ to decrease by a factor
of 2
We can write $T_h = \log_e(2) T_c$
----------------------------------------------------------------------
RSLIDE
FIG exponential/bacteria_times.Rout-0.pdf
----------------------------------------------------------------------
RSLIDE
FIG exponential/bacteria_times.Rout-1.pdf
----------------------------------------------------------------------
ASLIDE Characterstic time and half life
FIG exponential/bacteria_times.Rout-2.pdf
----------------------------------------------------------------------
SEC Constructing models
----------------------------------------------------------------------
TSS Dynamical models
----------------------------------------------------------------------
BC
Tools to link scales
Models are what we use to link:
Individual-level to population-level processes
Short time scales to long time scales
In both directions
NC
SIDEFIG images/touching.jpg
SIDEFIG images/ew_measles.png
EC
----------------------------------------------------------------------
Assumptions
BC
Models are always simplifications of reality
``The map is not the territory''
``All models are wrong, but some are useful''
Models are useful for:
linking assumptions to outcomes
identifying where assumptions are broken
NC
SIDEFIG images/flat.png
EC
----------------------------------------------------------------------
Dynamical models
\textbf{Dynamical models} describe rules for how a system changes at
each point in time
We will see what these assumptions about how the system
\emph{changes} lead to conclusions about what the system \emph{does}
over longer time periods
----------------------------------------------------------------------
States and state variables
Our dynamic models imagine that a system has a \textbf{state} at any
given time, described by one or more \textbf{state variables}
Examples:
Dandelions: state is population size, described by one state
variable (the number of individuals)
Bacteria: state is population density, described by one state
variable (the number of individuals per ml)
Pine trees: state is amount of wood, described by one state
variable (tons per hectare)
Limiting the number of state variables is key to simple models
----------------------------------------------------------------------
Parameters
\textbf{Parameters} are the quantities that describe the rules for
our system
Examples:
Birth rate, death rate, fecundity, survival probability
----------------------------------------------------------------------