︠311b0c58-d28c-4be5-a3ac-3cbc942af64esi︠
%hide
%html
Modeling the population of the U.S.
Objective:
To use historical data from the
U.S. Census Bureau
to develop differential equation models
for population trends in the U.S.
Warmup:
Given the following estimates from the Census Bureau,
find the population of the U.S. in 2004:
* Population in 2001: 285,102,075
* Births, deaths, and net international immigration:
2002: 4,006,985; 2,429,999; 1,262,159
2003: 4,055,469; 2,432,874; 1,225,161
2004: 4,099,399; 2,453,984; 1,221,013
This warmup need not be turned in with the rest of your
report.
Lab tasks:
Explore and develop two different differential equation
models for the total population of the U.S., using census
data for the period 1900 through 1999
- an exponential model
- a logistic model
Use your models to predict the current
population of the U.S. How close are they to reality?
Census datafiles are available in 2 different forms:
original data in plain text format,
and cleaned up version in csv format
Some pointers and issues to consider:
- What units will you use for each of the variables?
- A standard exponential model offers only 1 parameter to
play with -- i.e., the growth rate. What is the best value
for it? Justify your choice.
- In a logistic model you get to pick 2 parameters -- the
intrinsic growth rate and the carrying capacity. What are good
ways to estimate them?
- What if we try a 3rd model in which we let the
intrinsic growth rate vary with time. How would you
model its dependence on time?
What to turn in:
All lab reports are expected to contain the following
minimum components (or, you can think of them as section
headings):
- Problem statement and objectives
- Methodology
- Results and interpretation/conclusion(s)
Your report should also contain equations, graphs, figures and/or
tables, as needed, to support your written work. However, it is
not necessary to "overdo" these items! Feel free to include only
the minimum needed graphs/tables that illustrate and clarify
your analysis, claims and conclusions.
What to turn in:
All lab reports will be graded based on a simple rubric, on
a 10 point scale.
Grading will consider mathematical content, as well as clarity
and completeness of your written discussion. The rubric for
this lab will consist of my assessment of the following
items on a 1-point scale:
- Are the objective(s), goal(s) or problem statement clear?
- Is the organizational structure of the report effective?
- Does the report define all variables and clarify units used?
- Is there adequate exploration of math and/or modeling?
- Are the explorations explained clearly?
- Are there needed graphs, figures, tables, etc.?
- Are the graphs/ figures/ tables clearly labeled?
- Are the spelling, grammar, and punctuation correct?
- Are the results and their presentation adequate?
- Are the interpretations/conclusions clear?
︡40cd7154-5685-4905-bd3a-906c0bb75abd︡{"hide":"input"}︡{"html":"\nModeling the population of the U.S.\n
\n\n\nObjective: \nTo use historical data from the\nU.S. Census Bureau\nto develop differential equation models \nfor population trends in the U.S.\n\n\nWarmup: \nGiven the following estimates from the Census Bureau, \nfind the population of the U.S. in 2004:
\n \n* Population in 2001: 285,102,075
\n \n* Births, deaths, and net international immigration:
\n \n 2002: 4,006,985; 2,429,999; 1,262,159
\n \n 2003: 4,055,469; 2,432,874; 1,225,161
\n \n 2004: 4,099,399; 2,453,984; 1,221,013 \n
\nThis warmup need not be turned in with the rest of your \nreport.\n\n\n\n\nLab tasks: \n\nExplore and develop two different differential equation\nmodels for the total population of the U.S., using census \ndata for the period 1900 through 1999\n\n\n - an exponential model\n
- a logistic model\n
\n\nUse your models to predict the current \npopulation of the U.S. How close are they to reality?\n
\nCensus datafiles are available in 2 different forms: \noriginal data in plain text format, \nand cleaned up version in csv format\n\n\n\nSome pointers and issues to consider: \n\n\n - What units will you use for each of the variables?\n\n
- A standard exponential model offers only 1 parameter to \nplay with -- i.e., the growth rate. What is the best value \nfor it? Justify your choice.\n\n
- In a logistic model you get to pick 2 parameters -- the \nintrinsic growth rate and the carrying capacity. What are good \nways to estimate them?\n
- What if we try a 3rd model in which we let the \nintrinsic growth rate vary with time. How would you \nmodel its dependence on time?\n
\n \n\nWhat to turn in:
\n\nAll lab reports are expected to contain the following \nminimum components (or, you can think of them as section\nheadings):\n\n\n - Problem statement and objectives\n
- Methodology\n
- Results and interpretation/conclusion(s)\n
\n\nYour report should also contain equations, graphs, figures and/or \ntables, as needed, to support your written work. However, it is \nnot necessary to \"overdo\" these items! Feel free to include only \nthe minimum needed graphs/tables that illustrate and clarify \nyour analysis, claims and conclusions.\n\n
\n\nWhat to turn in: \n\nAll lab reports will be graded based on a simple rubric, on \na 10 point scale. \nGrading will consider mathematical content, as well as clarity \nand completeness of your written discussion. The rubric for \nthis lab will consist of my assessment of the following \nitems on a 1-point scale: \n\n - Are the objective(s), goal(s) or problem statement clear?\n
- Is the organizational structure of the report effective?\n
- Does the report define all variables and clarify units used?\n
- Is there adequate exploration of math and/or modeling?\n
- Are the explorations explained clearly?\n
- Are there needed graphs, figures, tables, etc.?\n
- Are the graphs/ figures/ tables clearly labeled?\n
- Are the spelling, grammar, and punctuation correct?\n
- Are the results and their presentation adequate?\n
- Are the interpretations/conclusions clear?\n
\n"}︡{"done":true}︡
︠3f121ba2-572e-4c63-8e4d-7ba1bfa08752si︠
%hide
%html
Some potentially useful Sage code segments
(I) Here is how to read csv datafiles and store needed data
in local variables that you get to define (ydata
in this example):
︡84d86772-db1e-4505-ad84-dc9852294e13︡{"hide":"input"}︡{"html":"\nSome potentially useful Sage code segments\n
\n\n(I) Here is how to read csv datafiles and store needed data \nin local variables that you get to define (ydata \nin this example):"}︡{"done":true}︡
︠131a0858-57f8-4fde-8877-0033fa7ea5c7s︠
f = open('./us_population_1900_1999.csv') # This file has comma separated data, with a plain text header line.
ydata = [] # This will assemble my y-data (i.e., the population) in the form of a list
headerline = f.readline() # Read & discard the header line
line = f.readline() # This is the first line of actual data
while (line !=''):
xy = line.split(',') # The comma splits each line into two items of data
ydata.append(float(xy[1])) # Append to xdata
# print xy[1] # optional: to check whether it's doing what I am thinking
line = f.readline() # Read the next line
# print ydata # optional: to check whether it's working correctly
︡ebad707b-1cb1-412c-9b08-87b8615fd0be︡{"done":true}︡
︠b7fcc326-5a9a-4ca2-bffa-de393f6531bfsi︠
%hide
%html
(II) Here is one way to create an independent variable
(e.g., tdata) containing the years 1900-1999:
︡245398fe-d96d-4c21-b8fb-963237e8da6d︡{"hide":"input"}︡{"html":"\n(II) Here is one way to create an independent variable \n(e.g., tdata) containing the years 1900-1999:"}︡{"done":true}︡
︠05510079-f107-4348-8c4d-514c4b5f1dfes︠
tdata = [ 1900+j for j in range(100) ]
tdata # just to print and check whether it did what I expect
︡6201714e-8c7e-4ee0-9f2f-d3c2f1994183︡{"stdout":"[1900, 1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912, 1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920, 1921, 1922, 1923, 1924, 1925, 1926, 1927, 1928, 1929, 1930, 1931, 1932, 1933, 1934, 1935, 1936, 1937, 1938, 1939, 1940, 1941, 1942, 1943, 1944, 1945, 1946, 1947, 1948, 1949, 1950, 1951, 1952, 1953, 1954, 1955, 1956, 1957, 1958, 1959, 1960, 1961, 1962, 1963, 1964, 1965, 1966, 1967, 1968, 1969, 1970, 1971, 1972, 1973, 1974, 1975, 1976, 1977, 1978, 1979, 1980, 1981, 1982, 1983, 1984, 1985, 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999]\n"}︡{"done":true}︡
︠5b51b403-03e3-409d-8b3a-d228a20fbbd9is︠
%hide
%html
(III) Here's one way to view a plot of the data:
︡033ecbc0-0fe0-4e82-ac00-582433bc6518︡{"hide":"input"}︡{"html":"\n(III) Here's one way to view a plot of the data:\n"}︡{"done":true}︡
︠d793806e-0b27-4148-b297-3852eb7902b1s︠
point(zip(tdata, ydata), axes_labels=['year', 'population'], pointsize=30)
︡ab864099-f9b7-4bd4-b4d1-19672ca13e06︡{"file":{"filename":"/home/user/.sage/temp/project-578ca849-8aff-4a03-8cc8-0e985f103ac3/207/tmp_w4wUa6.svg","show":true,"text":null,"uuid":"09c97465-de40-4d47-aa41-2e86e9637b5f"},"once":false}︡{"done":true}︡
︠82a74ffd-f97a-45aa-89ad-e7480bbc5b4ais︠
%hide
%html
(IV) Here are worksheets containing examples of some related
tasks that may be potentially useful:
* How
to solve a DE; how to plot direction fields, etc.
* How
to find best-fit straight line, or other curve, to given data.
︡f91eef3a-8105-4102-8749-66ed550ac508︡{"hide":"input"}︡{"html":"\n(IV) Here are worksheets containing examples of some related\ntasks that may be potentially useful:\n\n* How \nto solve a DE; how to plot direction fields, etc.\n\n* How \nto find best-fit straight line, or other curve, to given data."}︡{"done":true}︡