1 / 9

CS 170: Computing for the Sciences and Mathematics

CS 170: Computing for the Sciences and Mathematics. Euler’s Method. Administrivia. Last time (in P265) Basics of Algorithms and computation Today More Maple Euler’s method HW #6 Due! HW #7 assigned. Euler’s method. Simplest simulation technique for solving differential equation

Download Presentation

CS 170: Computing for the Sciences and Mathematics

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CS 170:Computing for the Sciences and Mathematics Euler’s Method

  2. Administrivia • Last time (in P265) • Basics of Algorithms and computation • Today • More Maple • Euler’s method • HW #6 Due! • HW #7 assigned

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

  4. Euler’s Method • Euler’s Method is a simulation technique. • Example: unconstrained growth dP/dt = 0.1P with P0 = 100 • P(t) = P(t - ∆t) + growth(t)∆t (new = old + change) • growth(t) is dP/dt = 0.1P(t - ∆t) (change = r*Pold)

  5. Example • dP/dt = 0.1P with P0 = 100 and ∆t= 8

  6. Approximating Unconstrained Growth initialize simulationLength, population, growthRate, ∆t numIterations  simulationLength / ∆t fori going from 1 to numIterations do the following: growth  growthRate * population population  population + growth * ∆t t  t + ∆t

  7. Approximating Unconstrained Growth (Better) initialize simulationLength, population, growthRate, ∆t numIterations  simulationLength / ∆t fori going from 1 to numIterations do the following: growth  growthRate * population population  population + growth * ∆t t  i*∆t

  8. Error • Analytical solution: P = 100 e0.10t • After 100 time units: P = 2,202,647 • Smaller ∆t better estimation • ∆t = 1 estimate of P = 1,378,061 • ∆t = 0.25 estimate of P = 1,947,808 • ∆t = 0.01 estimate of P = 2,191,668 • ∆t = 0.005 estimate of P = 2,197,149

  9. HOMEWORK! • Homework 7 • Maple Tutorial 2 • Complete the worksheet’s questions and turn it in • Also complete Module 5.2’s Project 1 on page 167. • Due 11/1/2010 • Thursday’s Class in P115

More Related