Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS 170: Computing for the Sciences and Mathematics

Similar presentations


Presentation on theme: "CS 170: Computing for the Sciences and Mathematics"— Presentation transcript:

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

2 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

3 Unconstrained Growth Population growth without constraints Examples?

4 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.

5 Analytic Solution “Closed Form” solution
Can determine with a computer algebra system Like Maple P = P0ert

6 Exponential Decay Rate of change of mass of radioactive substance proportional to mass of substance Constant of proportionality(rate) is negative Radioactive Carbon-14: (about % per year) dQ/dt = Q Q = Q0 e t Why Carbon-14?

7 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.

8 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

9 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?

10 Systems Dynamics Tool Helps to model Performs simulation
What happens at one time step influences what happens at next

11 Stock/Box Variable/Reservoir
Anything that accumulates, buffer, resource Examples Population Radioactivity Phosphate Body fat Labor

12 Flow Represents activities Examples Birthing, dying with population
Intaking & expending calories with body fat Moving from one population to another Diffusion Reactions

13 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

14 Connector/Arrow/Arc Link Transmits information & inputs
Regulates flows Shows dependence

15 With system dynamics tool
Enter equations Run simulations Produce graphs Produce tables

16 HOMEWORK! READ Module 3.2 in the textbook YES CLASS on Monday


Download ppt "CS 170: Computing for the Sciences and Mathematics"

Similar presentations


Ads by Google