5.2 Euler’s Method.

Slides:



Advertisements
Similar presentations
Courant and all that Consistency, Convergence Stability Numerical Dispersion Computational grids and numerical anisotropy The goal of this lecture is to.
Advertisements

Formal Computational Skills
Chapter 6 Differential Equations
HAMPIRAN NUMERIK SOLUSI PERSAMAAN DIFERENSIAL (lanjutan) Pertemuan 12 Matakuliah: METODE NUMERIK I Tahun: 2008.
Numeriska beräkningar i Naturvetenskap och Teknik 1. Numerical differentiation and quadrature Discrete differentiation and integration Trapezoidal and.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 32 Ordinary Differential Equations.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 31 Ordinary Differential Equations.
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.
Numerical Solutions to ODEs Nancy Griffeth January 14, 2014 Funding for this workshop was provided by the program “Computational Modeling and Analysis.
Derivatives and Differential Equations
Slope Fields and Euler’s Method. When taking an antiderivative that is not dealing with a definite integral, be sure to add the constant at the end. Given:find.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Prentice Hall 5.4 Fundamental Theorem of Calculus.
EE3561_Unit 8Al-Dhaifallah14351 EE 3561 : Computational Methods Unit 8 Solution of Ordinary Differential Equations Lesson 3: Midpoint and Heun’s Predictor.
Application of Differential Applied Optimization Problems.
9.4 Random Numbers from Various Distributions. Distributions A distribution of numbers is a description of the portion of times each possible outcome.
Computational Biology, Part 15 Biochemical Kinetics I Robert F. Murphy Copyright  1996, 1999, 2000, All rights reserved.
Computer Animation Algorithms and Techniques
1.6 – Tangent Lines and Slopes Slope of Secant Line Slope of Tangent Line Equation of Tangent Line Equation of Normal Line Slope of Tangent =
3.1 Definition of the Derivative & Graphing the Derivative
4.5: Linear Approximations, Differentials and Newton’s Method.
Review Calculus (Make sure you study RS and WS 5.3)
4.1 Antiderivatives and Indefinite Integration Definition of Antiderivative: A function F is called an antiderivative of the function f if for every x.
Euler’s Method CS 170: Computing for the Sciences and Mathematics.
Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization.
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Prentice Hall 5.5 Trapezoidal Rule.
PHY 301: MATH AND NUM TECH Contents Chapter 10: Numerical Techniques I. Integration A.Intro B.Euler  Recall basic  Predictor-Corrector C. Runge-Kutta.
Problem of the Day - Calculator Let f be the function given by f(x) = 2e4x. For what value of x is the slope of the line tangent to the graph of f at (x,
Tangent Line Approximations A tangent line approximation is a process that involves using the tangent line to approximate a value. Newton used this method.
Lesson 9-2 Direction (Slope) Fields and Euler’s Method.
Numerical Integration Methods
Antiderivatives with Slope Fields
Antiderivatives 5.1.
Module 3.2 Unconstrained Growth and Decay
Slope Fields If you enjoyed connecting the dots, you’ll love slope fields It is a graphical method to find a particular solution to any differential equation.
5.4 Runge-Kutta 4 Method.
ECE 576 – Power System Dynamics and Stability
Module 2.2 Unconstrained Growth and Decay
525602:Advanced Numerical Methods for ME
ME/AE 339 Computational Fluid Dynamics K. M. Isaac Topic1_ODE
Class Notes 18: Numerical Methods (1/2)
Numerical Solutions of Ordinary Differential Equations
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2, 27-1 CISE301_Topic8L4&5.
Class Notes 19: Numerical Methods (2/2)
Ch 8.6: Systems of First Order Equations
Section Euler’s Method
Gradient Checks for ANN
Ordinary differential equaltions:
6.1 day 2 Euler’s Method Leonhard Euler made a huge number of contributions to mathematics, almost half after he was totally blind. (When this portrait.
Sec 21: Analysis of the Euler Method
Modeling #5 - The Cab Control Problem
Calculus (Make sure you study RS and WS 5.3)
Numerical Analysis Lecture 26.
WELCOME TO MY CLASS NUMERICAL METHOD Name : Masduki
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM (Term 101) Section 04 Read , 26-2, 27-1 CISE301_Topic8L2.
Numerical Computation and Optimization
Numerical Analysis Lecture 38.
The Elementary Theory of Initial-Value Problems
Numerical Integration Methods
Numerical solution of first-order ordinary differential equations
ECE 576 POWER SYSTEM DYNAMICS AND STABILITY
Choose the equation which solution is graphed and satisfies the initial condition y ( 0 ) = 8. {applet} {image}
6.4 Runge-Kutta 4 Method.
Ch5 Initial-Value Problems for ODE
Numerical Computation and Optimization
Differential equations
Fundamental Theorem of Calculus
Numerical solution of first-order ordinary differential equations 1. First order Runge-Kutta method (Euler’s method) Let’s start with the Taylor series.
Part 7 Optimization in Functional Space
Modeling and Simulation: Exploring Dynamic System Behaviour
NUMERICAL ANALYSIS REVISION APKC FACULTY OF MET, AFAC.
Presentation transcript:

5.2 Euler’s Method

Leonhard Euler (1707-1783) Euler Lagrange Fourier Dirichlet Lipschitz Klein Story Lefschetz Tucker Minsky Winston Waltz Pollack Levy Y’all

Motivation Accumulating a value (stock variable) requires us to integrate it Sometimes definite integral exists (analytical solution): f(x) = x2 ⇒ ∫f(x) dx = x3 / 3 Sometimes it does not: f(x) = e-x2 In such cases we use numerical methods to approximate the integral (Euler, Runge-Kutta 2 and 4)

Example We use a somewhat artificial example where there is an analytical solution, to compare numerical methods with it. Consider dP/dt = 0.10P with P0=100. We know that P = 100e0.10t General finite difference equation is P(t) = P(t-∆t) + growth(t)*∆t Let’s compute P(8) for this example

Example dP/dt = 0.10P with P0=100 P(t) = P(t-∆t) + growth(t)*∆t with ∆t = 8 = P(t-∆t) + growth_rate*P(t-∆t)*∆t with ∆t = 8 = P(t-8) + 0.10 * P(t-8) * 8 = P(t-8) + 0.80 * P(t-8) = P(t-8) * (1 + 0.80) = 1.8*P(t-8) Let’s compute P(8)….

Example Check against analytical solution: P(t) = 1.8*P(t-8) P(8) = 1.8*P(0) = 1.8*100 = 180 Check against analytical solution: P = 100e0.10t P8 = 100e(0.10)(8) = 223

Example

Algorithm for Euler’s Method t ← t0 P(t0)← P0 Initialize SimulationLength while t < SimulationLength do the following: t ← t + ∆t P(t) ← P(t - ∆t) + P’(t - ∆t) * ∆t What’s wrong with this picture?

Better Algorithm for Euler’s Method P(t0)← P0 Initialize NumberOfSteps for n going from 1 to NumberOfSteps do the following: tn ← t0 + n∆t Pn ← Pn-1 + f(tn-1, Pn-1 )∆t where f is the derivative at a given time step

Error Vanishes in the Limit For ∆t = 8, relative error = |180-223|/|223 |= 19% For ∆t = 1: P(t) = P(t-1) + 0.10 * P(t-1) * 1 = P(t-1) * 1.1 = 100 * 1.1 = 110 P = 100e0.10t P8 = 100e(0.10)(1) = 100e(0.10)(1) = 111 Relative error = |110-111|/|111| = 1%