17
Hirophysics.com Computational Error Analyses for Euler's Method, Runge-Kutta 4 th and 6 th Methods Brenton K. Jones

Computational Error Analyses for Euler's Method, Runge-Kutta 4 th and 6 th Methods

  • Upload
    questa

  • View
    38

  • Download
    0

Embed Size (px)

DESCRIPTION

Computational Error Analyses for Euler's Method, Runge-Kutta 4 th and 6 th Methods. Euler's Method. Uses the first derivative to obtain slope of tangent a tangent line Then uses the slope to approximate the value of the solution. Error for Euler’s method. Runge-Kutta Method 1. - PowerPoint PPT Presentation

Citation preview

Page 1: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Computational Error Analyses for Euler's Method, Runge-Kutta

4th and 6th Methods

Brenton K. Jones

Page 2: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Euler's Method

Uses the first derivative to obtain slope of tangent a tangent line

Then uses the slope to approximate the value of the solution

Page 3: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Error for Euler’s method

Page 4: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Runge-Kutta Method 1

k1 is the slope at the beginning of the interval;

k2 is the slope at the midpoint of the interval, using slope k1 to determine the value of y at the point tn + h / 2 using Euler's method;

k3 is again the slope at the midpoint, but now using the slope k2 to determine the y-value;

k4 is the slope at the end of the interval, with its y-value determined using k3.

Page 5: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Runge-Kutta Method 2Uses trial step at midpoint of an interval to cancel out lower order error termsEstimate is determined by weighted averages of slope at midpointsUsed to give numerical solutions to differential equations (approximations)Generally very accurate

Page 6: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Differential Equation: y''+y=0Initial conditions: y(0)=1, y'(0)=0Exact Solution: y=cos t

The Solution of Harmonic Oscillator

Page 7: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Errors from the theoretical solutionswith Euler’s, Runge-Kutta 4th, and Runge-Kutta 6th order.

Page 8: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Error Comparisons

Euler’s vs Runge-Kutta 4th order Runge-Kutta 4th vs Runge-Kutta 6th order

Page 9: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Step sizes .005, .05, .2

Page 10: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Differential Equation: y''-2y'-3y=0Initial conditions: y(0)=1, y'(0)=2Exact Solution: 0.25 exp[-t]+0.75exp[3t]

The other example 1

Page 11: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Errors from the theoretical solutionswith Euler’s, Runge-Kutta 4th, and Runge-Kutta 6th order.

Page 12: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Interesting Results (For this exponential solution, the 4th and 6th have similar properties in terms

of the error.)

Page 13: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Differential Equation: u''+16u'+192u=0Initial conditions: u(0)=0.5, u'(0)=0Exact Solution: ))28sin(2)28cos(2(

4

1)( 8 ttetu t

The other example 2

Page 14: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Step size .005

Errors from the theoretical solutionswith Euler’s, Runge-Kutta 4th, and Runge-Kutta 6th order.

Page 15: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Differential Equation: y*y''-(y')^2=1Initial conditions: y(0)=1, y'(0)=0Exact Solution: y=cosh(t)

The other example 3

Page 16: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Step size .005

Errors from the theoretical solutionswith Euler’s, Runge-Kutta 4th, and Runge-Kutta 6th order.

Page 17: Computational Error Analyses for Euler's Method, Runge-Kutta 4 th  and 6 th  Methods

Hirophysics.com

Conclusions

Euler's Method (the 1st order) is the least accurate.

Runge-Kutta methods are generally very accurate.

Higher orders provide greater accuracy. The step size greatly effects results. Unless the solution converges to a stable

solution, larger t causes larger error.