5.4 Runge-Kutta 4 Method.

Slides:



Advertisements
Similar presentations
Ordinary Differential Equations
Advertisements

Derivation of the third-order
Chapter 6 Differential Equations
The Chain Rule Section 3.6c.
South China University of Technology Oscillator motions Xiaobao Yang Department of Physics
Numeriska beräkningar i Naturvetenskap och Teknik 1. Numerical differentiation and quadrature Discrete differentiation and integration Trapezoidal and.
CE5504 – Surface Water Quality Modeling CE5504 Surface Water Quality Modeling Lab 2. Numerical Methods and Population Growth Modeling.
ECIV 301 Programming & Graphics Numerical Methods for Engineers Lecture 31 Ordinary Differential Equations.
Initial-Value Problems
Numerical Integration CE5504 – Surface Water Quality Modeling  non-idealized loading functions  variable parameters  multi-segment systems  non-linear.
8-1 Chapter 8 Differential Equations An equation that defines a relationship between an unknown function and one or more of its derivatives is referred.
Muon Seeding Endcap: Cathode Strip Chambers up to 6 hits/station Barrel: Drift Tubes up to 12 hits/station.
Statistics: Data Presentation & Analysis Fr Clinic I.
Numerical Solutions of Ordinary Differential Equations
Numerical Solution of Ordinary Differential Equation
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.
EE3561_Unit 8Al-Dhaifallah14351 EE 3561 : Computational Methods Unit 8 Solution of Ordinary Differential Equations Lesson 3: Midpoint and Heun’s Predictor.
Modeling and simulation of systems Numerical methods for solving of differential equations Slovak University of Technology Faculty of Material Science.
Lecture 22 MA471 Fall Advection Equation Recall the 2D advection equation: We will use a Runge-Kutta time integrator and spectral representation.
An Over View of Runge-Kutta Fehlberg and Dormand and Prince Methods. Numerical Methods To Solve Initial Value Problems William Mize.
Computer Animation Algorithms and Techniques
Quick Quiz Consider the graph at the right. The object whose motion is represented by this graph is ... (include all that are true): moving in the positive.
Slope Fields. Quiz 1) Find the average value of the velocity function on the given interval: [ 3, 6 ] 2) Find the derivative of 3) 4) 5)
Inference for 2 Proportions Mean and Standard Deviation.
Calculus: The Key Ideas (9/3/08) What are the key ideas of calculus? Let’s review and discuss. Today we review the concepts of definite integral, antiderivative,
Scientific Computing Multi-Step and Predictor-Corrector Methods.
Introduction to the Runge-Kutta algorithm for approximating derivatives PHYS 361 Spring, 2011.
Suppose we are given a differential equation and initial condition: Then we can approximate the solution to the differential equation by its linearization.
Curves: ch 4 of McConnell General problem with constructing curves: how to create curves that are “smooth” CAD problem Curves could be composed of segments.
3.1 Derivative of a Function Objectives Students will be able to: 1)Calculate slopes and derivatives using the definition of the derivative 2)Graph f’
PHY 301: MATH AND NUM TECH Contents Chapter 10: Numerical Techniques I. Integration A.Intro B.Euler  Recall basic  Predictor-Corrector C. Runge-Kutta.
Product and Quotient Rule Find the derivative of the function using the Product Rule Find the derivative of the function using the Quotient Rule Find the.
Today’s class Ordinary Differential Equations Runge-Kutta Methods
Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display. 1 Part 6 - Chapters 22 and 23.
5.2 Euler’s Method.
Numerical Integration Methods
Notes on Weighted Least Squares Straight line Fit Passing Through The Origin Amarjeet Bhullar November 14, 2008.
CHAPTER 3 NUMERICAL METHODS
Part 7 - Chapter 25.
Positron Capture Simulations: Runge-Kutta vs Boris
Ordinary Differential Equations
ECE 576 – Power System Dynamics and Stability
1200 Hz = 1200/sec would mean in 5 minutes we
Physics 114: Exam 2 Review Material from Weeks 7-11
Class Notes 18: Numerical Methods (1/2)
Numerical Solutions of Ordinary Differential Equations
Class Notes 19: Numerical Methods (2/2)
Ch 8.6: Systems of First Order Equations
Average Rate vs. Instantaneous Rate
Euler’s Method If we have a formula for the derivative of a function and we know the value of the function at one point, Euler’s method lets us build an.
On a small neighborhood The function is approximately linear
Part 7 - Chapter 25.
ORBITAL Trajectories!!! Made by Karol Sanchez
Numerical Analysis Lecture 37.
ME 123 Computer Applications I Lecture 23: Advanced Graphics 4/17/03
Numerical Analysis Lecture 38.
Acceleration.
Numerical Integration Methods
Numerical solution of first-order ordinary differential equations
ECE 576 POWER SYSTEM DYNAMICS AND STABILITY
SE301: Numerical Methods Topic 8 Ordinary Differential Equations (ODEs) Lecture KFUPM Read , 26-2, 27-1 CISE301_Topic8L3 KFUPM.
6.4 Runge-Kutta 4 Method.
Ch5 Initial-Value Problems for ODE
Numerical Computation and Optimization
Implicit and Explicit Runge-Kutta methods
Numerical Computation and Optimization
Differential equations
Linear approximation Median home prices in Austin
Numerical solution of first-order ordinary differential equations 1. First order Runge-Kutta method (Euler’s method) Let’s start with the Taylor series.
Modeling and Simulation: Exploring Dynamic System Behaviour
Presentation transcript:

5.4 Runge-Kutta 4 Method

Martin Wilhelm Kutta (1867-1944) Carl Runge (1856-1927) Martin Wilhelm Kutta (1867-1944)

Motivation With Euler’s method, error is described by a straight line: i.e., it is proportionate to (linear in) Dt. We say that error is O(Dt) : “Order Dt”, or “Big-O Dt” Can we do better?

First Estimate ∂1 Recall update rule from Euler’s Method: Pn ← Pn-1 + f(tn-1, Pn-1 ) ∆t where f is the derivative function We call f(tn-1, Pn-1 ) = 80 the first estimate, or ∂1 ∂1 = 80 ∆t = 8

Second Estimate ∂2 Second estimate ∂2 uses the halfway point along the line segment to ∂1

Second Estimate ∂2 Combined with slope 0.10 (from dP/dt = 0.10P), this gives us a new endpoint = (0.1)(140)(8) = 112, which is the second estimate ∂2. ∂2 = f(tn-1+0.5t, Pn-1+0.5∂1) t ∂2= 112 ∆t = 8

Third Estimate ∂3 Third estimate ∂3 uses the halfway point along the line segment from ∂2 ∂3 =(0.1)(156)(8) = 124.8

Third Estimate ∂3 (0.1)(156)(8) = 124.8, which is the third estimate ∂3. ∂3 = f(tn-1+0.5t, Pn-1+0.5∂2) t ∂3= 124.8

Fourth Estimate ∂4 ∂4 =(0.1)(224.8)(8) = 179.84 Fourth estimate ∂4 is taken at end of interval ∂4 =(0.1)(224.8)(8) = 179.84

Fourth Estimate ∂4 ∂4 =(0.1)(224.8)(8) = 179.84, which is the fourth estimate ∂4. ∂4 = f(tn-1+ t, Pn-1+∂3) t ∂4= 179.8

Runge-Kutta 4 Estimate Bring it all together: a weighted average that privileges the middle values: Pn = Pn-1 + (∂1 + 2∂2 + 2∂3 + ∂4) / 6 = 100 + (80 + 2*112 + 2*124.8 + 179.84) / 6 = 222.24 Relative error = |222.4 - 222.55| / |222.55| = 0.14% (Compare 19% for Euler’s Method) RK4 error is O(Dt4) : a very small number, because error is < 1.

Runge-Kutta 4 Algorithm P(t0)← P0 Initialize NumberOfSteps for n going from 1 to NumberOfSteps do the following: tn ← t0 + n∆t ∂1 = f(tn-1, Pn-1 ) ∂2 = f(tn-1+0.5t, Pn-1+0.5∂1) t ∂3 = f(tn-1+0.5t, Pn-1+0.5∂2) t ∂4 = f(tn-1+ t, Pn-1+∂3) t

Runge-Kutta 4 in Excel

Runge-Kutta 4 in Excel

Runge-Kutta 4 in Excel

Runge-Kutta 4 in Excel

Runge-Kutta 4 in Excel

Runge-Kutta 4 in Excel