unconstrained growth and decay cs 170: computing for the sciences and mathematics

16
Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

Upload: arabella-wilcox

Post on 18-Jan-2016

216 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

Unconstrained Growth and Decay

CS 170:Computing for the Sciences

and Mathematics

Page 2: 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

Page 3: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

Unconstrained Growth

Population growth without constraints

Examples?

Page 4: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

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.

Page 5: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

Analytic Solution

“Closed Form” solution

Can determine with a computer algebra system Like Maple

P = P0ert

Page 6: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

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?

Page 7: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

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.

Page 8: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

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

Page 9: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

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?

Page 10: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

Systems Dynamics Tool

Helps to model

Performs simulation

What happens at one time step influences what happens at next

Page 11: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

Stock/Box Variable/Reservoir

Anything that accumulates, buffer, resourceExamples

Population Radioactivity Phosphate Body fat Labor

Page 12: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

Flow

Represents activitiesExamples

Birthing, dying with population Intaking & expending calories with body fat Moving from one population to another Diffusion Reactions

Page 13: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

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

Page 14: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

Connector/Arrow/Arc

LinkTransmits information & inputsRegulates flows

Shows dependence

Page 15: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

With system dynamics tool

Enter equationsRun simulationsProduce graphsProduce tables

Page 16: Unconstrained Growth and Decay CS 170: Computing for the Sciences and Mathematics

HOMEWORK!

READ Module 3.2 in the textbook

YES CLASS on Monday