CS 170: Computing for the Sciences and Mathematics Unconstrained Growth and Decay
Administrivia Last time Today WE HAVE CLASS ON MONDAY 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 negative Radioactive 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 / ∆t for i going from 1 to numIterations do the following: growth growthRate * population population population + growth * ∆t t i * ∆t display t, growth, and population UNITS ARE IMPORTANT Does 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, resource Examples Population Radioactivity Phosphate Body fat Labor
Flow Represents activities Examples 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 outputs Takes in information & transforms for use by another variable Examples Growth rate with population & growth Calories in a food Rates of reaction/diffusion
Connector/Arrow/Arc Link Transmits information & inputs Regulates flows Shows dependence
With system dynamics tool Enter equations Run simulations Produce graphs Produce tables
HOMEWORK! READ Module 3.2 in the textbook YES CLASS on Monday