unconstrained growth and decay cs 170: computing for the sciences and mathematics
TRANSCRIPT
Unconstrained Growth and Decay
CS 170:Computing for the Sciences
and Mathematics
Administrivia
Last time Error and Basic differential calculus Assigned HW 2
Today HW2 due! Unconstrained Growth
WE HAVE CLASS ON MONDAY
Unconstrained Growth
Population growth without constraints
Examples?
Example of Unconstrained Growth
Rate of change of population is directly proportional to number of individuals in the population (P)
dP/dt = rP
where r is the growth rate.
Analytic Solution
“Closed Form” solution
Can determine with a computer algebra system Like Maple
P = P0ert
Exponential Decay
Rate of change of mass of radioactive substance proportional to mass of substance
Constant of proportionality(rate) is negativeRadioactive Carbon-14: -0.000120968
(about .0120968% per year)
dQ/dt = -0.000120968 Q
Q = Q0 e-0.000120968t
Why Carbon-14?
Where’s The Computation?
An analytic solution is always preferable! But…finding it can be very hard
Instead of solving the relationship, we’ll approximate it.
Finite difference equation
new = old + change
population(t) = population(t - ∆t) + ∆population
If I repeat this calculation a lot (moving the time up a bit each pass), I can see the trend of population over time
Approximating Unconstrained Growth
initialize simulationLength, population, growthRate, ∆t
numIterations simulationLength / ∆tfor i going from 1 to numIterations do the following:
growth growthRate * populationpopulation population + growth * ∆tt i * ∆tdisplay t, growth, and population
UNITS ARE IMPORTANTDoes this give me the exact answer?
Systems Dynamics Tool
Helps to model
Performs simulation
What happens at one time step influences what happens at next
Stock/Box Variable/Reservoir
Anything that accumulates, buffer, resourceExamples
Population Radioactivity Phosphate Body fat Labor
Flow
Represents activitiesExamples
Birthing, dying with population Intaking & expending calories with body fat Moving from one population to another Diffusion Reactions
Converter/Variable/Formula
Contains equations that generate output for each time period
Converts inputs into outputsTakes in information & transforms for use by
another variableExamples
Growth rate with population & growth Calories in a food Rates of reaction/diffusion
Connector/Arrow/Arc
LinkTransmits information & inputsRegulates flows
Shows dependence
With system dynamics tool
Enter equationsRun simulationsProduce graphsProduce tables
HOMEWORK!
READ Module 3.2 in the textbook
YES CLASS on Monday