230 likes | 614 Views
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.
E N D
Computational Error Analyses for Euler's Method, Runge-Kutta 4th and 6th 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
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.
Runge-Kutta Method 2 Uses trial step at midpoint of an interval to cancel out lower order error terms Estimate is determined by weighted averages of slope at midpoints Used to give numerical solutions to differential equations (approximations) Generally very accurate
The Solution of Harmonic Oscillator Differential Equation: y''+y=0 Initial conditions: y(0)=1, y'(0)=0 Exact Solution: y=cos t
Errors from the theoretical solutions with Euler’s, Runge- Kutta 4th, and Runge- Kutta 6th order.
Error Comparisons Euler’s vs Runge-Kutta 4th order Runge-Kutta 4th vs Runge-Kutta 6th order
The other example 1 Differential Equation: y''-2y'-3y=0 Initial conditions: y(0)=1, y'(0)=2 Exact Solution: 0.25 exp[-t]+0.75exp[3t]
Errors from the theoretical solutions with Euler’s, Runge- Kutta 4th, and Runge- Kutta 6th order.
Interesting Results (For this exponential solution, the 4th and 6th have similar properties in terms of the error.)
The other example 2 Differential Equation: u''+16u'+192u=0 Initial conditions: u(0)=0.5, u'(0)=0 Exact Solution:
Step size .005 Errors from the theoretical solutions with Euler’s, Runge- Kutta 4th, and Runge- Kutta 6th order.
The other example 3 Differential Equation: y*y''-(y')^2=1 Initial conditions: y(0)=1, y'(0)=0 Exact Solution: y=cosh(t)
Step size .005 Errors from the theoretical solutions with Euler’s, Runge- Kutta 4th, and Runge- Kutta 6th order.
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.