More Accurate Rate Estimation CS 170: Computing for the Sciences and Mathematics.

Slides:



Advertisements
Similar presentations
Chapter 6 Differential Equations
Advertisements

Numerical Solutions of Differential Equations Euler’s Method.
Section 7.2: Direction Fields and Euler’s Methods Practice HW from Stewart Textbook (not to hand in) p. 511 # 1-13, odd.
Derivatives - Equation of the Tangent Line Now that we can find the slope of the tangent line of a function at a given point, we need to find the equation.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
Cyberinfrastructure for Scalable and High Performance Geospatial Computation Xuan Shi Graduate assistants supported by the CyberGIS grant Fei Ye (2011)
1 The Game of Life Supplement 2. 2 Background The Game of Life was devised by the British mathematician John Horton Conway in More sophisticated.
Cellular Automata (Reading: Chapter 10, Complexity: A Guided Tour)
Copyright © 2006 The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Ordinary Differential Equations Equations which are.
Creating new worlds inside the computer COS 116: 2/14/2008 Sanjeev Arora.
Initial-Value Problems
CS305j Introduction to Computing Two Dimensional Arrays 1 Topic 22 Two Dimensional Arrays "Computer Science is a science of abstraction -creating the right.
Cellular Automata Orit Moskovich
PART 7 Ordinary Differential Equations ODEs
Cellular Automata Avi Swartz 2015 UNC Awards Ceremony.
Does not Compute 3: Awesomer Cellular Automata In which we consider how to upgrade our cellular automata A few key choices are considered, but eventually.
Nawaf M Albadia Introduction. Components. Behavior & Characteristics. Classes & Rules. Grid Dimensions. Evolving Cellular Automata using Genetic.
Section 6.1: Euler’s Method. Local Linearity and Differential Equations Slope at (2,0): Tangent line at (2,0): Not a good approximation. Consider smaller.
Creating new worlds inside the computer COS 116, Spring 2012 Adam Finkelstein.
Ch 8.1 Numerical Methods: The Euler or Tangent Line Method
Boyce/DiPrima 9th ed, Ch 8.4: Multistep Methods Elementary Differential Equations and Boundary Value Problems, 9th edition, by William E. Boyce and Richard.
Operations Research Models
Chapter 12: Simulation and Modeling
Multiscale Modelling Mateusz Sitko
Computer Viruses, Artificial Life & the Origin of Life Robert C Newman Abstracts of Powerpoint Talks - newmanlib.ibri.org -newmanlib.ibri.org.
Modeling and simulation of systems Numerical methods for solving of differential equations Slovak University of Technology Faculty of Material Science.
Simulating Spatial Partial Differential Equations with Cellular Automata By Brian Strader Adviser: Dr. Keith Schubert Committee: Dr. George Georgiou Dr.
CS 484 – Artificial Intelligence1 Announcements Lab 4 due today, November 8 Homework 8 due Tuesday, November 13 ½ to 1 page description of final project.
Does not Compute 4: Finite Automata In which we temporarily admit defeat with cellular automata (we will face them again, in the epic final “Does Not Compute”
AP Calculus BC September 9, 2015 Day 7 – The Chain Rule and Implicit Differentiation.
1 Chapter 13 Artificial Life: Learning through Emergent Behavior.
The Game of Life A simulation of "life". From simple rules, complex behavior arises Rules –A cell that is alive and has fewer than two live neighbors dies.
Topic 26 Two Dimensional Arrays "Computer Science is a science of abstraction -creating the right model for a problem and devising the appropriate mechanizable.
Cellular Automata. The Game The Game of Life is not your typical computer game. It is a 'cellular automation', and was invented by the Cambridge mathematician.
Playing God: The Engineering of Functional Designs in the Game of Life Liban Mohamed Computer Systems Research Lab
Parallel Programming 0024 Spring Semester 2010 May 6, 2010.
Modelling and Simulations The Kingsway School. What are Computer Models? When a real life situation is represented by computer software. Can you think.
Marking Philosophy Feasibility: could the plan you proposed be used in reality Consistency: are your numbers internally consistent? Optimality: is your.
Scientific Computing Multi-Step and Predictor-Corrector Methods.
Euler’s Method CS 170: Computing for the Sciences and Mathematics.
CS 170: Computing for the Sciences and Mathematics
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 7 - Chapter 25.
Cellular Automata Introduction  Cellular Automata originally devised in the late 1940s by Stan Ulam (a mathematician) and John von Neumann.  Originally.
Numerical Analysis – Differential Equation
Introduction to the Runge-Kutta algorithm for approximating derivatives PHYS 361 Spring, 2011.
Computational Biology, Part 14 Recursion Relations Robert F. Murphy Copyright  1996, 1999, 2000, All rights reserved.
PHY 301: MATH AND NUM TECH Contents Chapter 10: Numerical Techniques I. Integration A.Intro B.Euler  Recall basic  Predictor-Corrector C. Runge-Kutta.
Conway’s Game of Life Jess Barak Game Theory. History Invented by John Conway in 1970 Wanted to simplify problem from 1940s presented by John von Neumann.
Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
ENGR-25_Lec-21_Integ_Diff.ppt 1 Bruce Mayer, PE Engineering/Math/Physics 25: Computational Methods Bruce Mayer, PE Licensed Electrical.
1/14  5.2 Euler’s Method Compute the approximations of y(t) at a set of ( usually equally-spaced ) mesh points a = t 0 < t 1
Lecture 39 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
Announcements Topics: -Introduction to (review of) Differential Equations (Chapter 6) -Euler’s Method for Solving DEs (introduced in 6.1) -Analysis of.
Aim: How do we take second derivatives implicitly? Do Now: Find the slope or equation of the tangent line: 1)3x² - 4y² + y = 9 at (2,1) 2)2x – 5y² = -x.
Keywords (ordinary/partial) differencial equation ( 常 / 偏 ) 微分方程 difference equation 差分方程 initial-value problem 初值问题 convex 凸的 concave 凹的 perturbed problem.
Pedro Ribeiro de Andrade Münster, 2013
Differential Equations
Advanced Numerical Methods (S. A. Sahu) Code: AMC 51151
Illustrations of Simple Cellular Automata
Class Notes 18: Numerical Methods (1/2)
Class Notes 19: Numerical Methods (2/2)
Differential Equations
Topic 26 Two Dimensional Arrays
On a small neighborhood The function is approximately linear
2.1 The Derivative and the Slope of a Graph
Unit 3: Visualizing the Change Section 6: Here and There
Modeling Pattern Formation in Skin Diseases by a Cellular Automaton
2.5 Basic Differentiation Properties
Presentation transcript:

More Accurate Rate Estimation CS 170: Computing for the Sciences and Mathematics

Administrivia Last time (in P265)  Euler’s method for computation Today  Better Methods  Simulation / Automata  HW #7 Due!  HW #8 assigned

Euler’s method Simplest simulation technique for solving differential equation Intuitive Some other methods faster and more accurate Error on order of ∆t  Cut ∆t in half  cut error by half

Euler’s Method t n = t 0 + n  t P n = P n-1 + f(t n-1, P n-1 )  t

Runge-Kutta 2 method Euler's Predictor-Corrector (EPC) Method Better accuracy than Euler’s Method Predict what the next point will be (with Euler) – then correct based on estimated slope.

Concept of method Instead of slope of tangent line at (t n-1, P n-1 ), want slope of chord For ∆t = 8, want slope of chord between (0, P(0)) and (8, P(8))

Concept of method Then, estimate for 2 nd point is ?  (∆t, P(0) + slope_of_chord * ∆t)  (8, P(0) + slope_of_chord * 8)

Concept of method Slope of chord ≈ average of slopes of tangents at P(0) and P(8)

EPC How to find the slope of tangent at P(8) when we do not know P(8)? Y = Euler’s estimate for P(8)  In this case Y = *(.1*8) = 180 Use (8, 180) in derivative formula to obtain estimate of slope at t = 8  In this case, f(8, 180) = 0.1(180) = 18 Average of slope at 0 and estimate of slope at 8 is  0.5( ) = 14 Corrected estimate of P 1 is (14) = 212

Predicted and corrected estimation of (8, P(8))

Runge-Kutta 2 Algorithm initialize simulationLength, population, growthRate, ∆t numIterations  simulationLength / ∆t for i going from 1 to numIterations do the following: growth  growthRate * population Y  population + growth * ∆t t  i*∆t population  population+ 0.5*( growth + growthRate*Y) estimating next point (Euler) averaging two slopes

Error With P(8) = and Euler estimate = 180, relative error = ?  |(180 - P(8))/P(8)| ≈ 19.1% With EPC estimate = 212, relative error = ?  |(212 - P(8))/P(8)| ≈ 4.7% Relative error of Euler's method is O(  t)

EPC at time 100  tEstimated PRelative error 1.02,168, ,193, ,200, Relative error of EPC method is on order of O((  t) 2 )

Runge-Kutta 4 If you want increased accuracy, you can expand your estimations out to further terms. base each estimation on the Euler estimation of the previous point.  P 1 = P 0 +  1,  1 = rate*P 0 *  t  P 2 = P 1 +  2,  2 = rate*P 1 *  t  P 3 = P 2 +  3,  3 = rate*P 2 *  t   4 = rate*P 3 *  t P1 = (1/6)*(  1 + 2*  2 + 2*  3 +  4 ) error: O(  t 4 )

SIMULATION CS 170: Computing for the Sciences and Mathematics

Computer simulation Having computer program imitate reality, in order to study situations and make decisions Applications?

Use simulations if… Not feasible to do actual experiments  Not controllable (Galaxies) System does not exist  Engineering Cost of actual experiments prohibitive  Money  Time  Danger Want to test alternatives

Example: Cellular Automata Structure  Grid of positions  Initial values  Rules to update at each timestep  often very simple New = Old + “Change” This “Change” could entail a diff. EQ, a constant value, or some set of logical rules

Mr. von Neumann’s Neighborhood Often in automata simulations, a cell’s “change” is dictated by the state of its neighborhood Examples:  Presence of something in the neighborhood  temperature values, etc. of neighboring cells

Conway’s Game of Life The Game of Life, also known simply as Life, is a cellular automaton devised by the British mathematician John Horton Conway in  The “game” takes place on a 2-D grid  Each cell’s value is determined by the values of an expanded neighborhood (including diagonals) from the previous time-step.  Initially, each cell is populated (1) or empty (0) Because of Life's analogies with the rise, fall and alterations of a society of living organisms, it belongs to a growing class of what are called simulation games (games that resemble real life processes).

Conway’s Game of Life The Rules For a space that is 'populated':  Each cell with one or zero neighbors dies (loneliness)  Each cell with four or more neighbors dies (overpopulation)  Each cell with two or three neighbors survives For a space that is 'empty' or 'unpopulated‘  Each cell with three neighbors becomes populated

HOMEWORK! Homework 8  READ “Seeing Around Corners”  around-corners/2471/ around-corners/2471/  Answer reflection questions – to be posted on class site  Due THURSDAY 11/4/2010 Thursday’s Class in HERE (P265)