0% found this document useful (0 votes)
43 views3 pages

Computer Application in Engineering Homework I: Mehmet Fatih Reyhan ID: 110170002

This document summarizes and compares three numerical methods - Modified Euler, 4th Order Runge-Kutta, and Adams-Bashford - for solving the differential equation dy/dx = y + 2x - 1. It provides the formulation for each method and calculates their global errors for step sizes h=0.1 and h=0.05. The 4th Order Runge-Kutta method was found to be the most accurate with errors on the order of O(h^4), followed by Adams-Bashford with errors of O(h^3), and Modified Euler with errors of O(h^2). Accuracy improved for all methods as step size decreased.

Uploaded by

fatih reyhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views3 pages

Computer Application in Engineering Homework I: Mehmet Fatih Reyhan ID: 110170002

This document summarizes and compares three numerical methods - Modified Euler, 4th Order Runge-Kutta, and Adams-Bashford - for solving the differential equation dy/dx = y + 2x - 1. It provides the formulation for each method and calculates their global errors for step sizes h=0.1 and h=0.05. The 4th Order Runge-Kutta method was found to be the most accurate with errors on the order of O(h^4), followed by Adams-Bashford with errors of O(h^3), and Modified Euler with errors of O(h^2). Accuracy improved for all methods as step size decreased.

Uploaded by

fatih reyhan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

Computer Application in Engineering

Homework I
Mehmet Fatih Reyhan

ID : 110170002

1
Problem
dy
Solving the dx = f (x, y) = y + 2x − 1 differential equation numerically with Modified Euler, 4th order

Runge-Kutta and Adams-Bashford methods for initial condition y(x = 0) = 1.

Solution

Modified Euler

Method calculates the next step value by adding stepsize times averages of next step and current step

slopes to current step value. To calculate next step slope, first next step value is calculated by classical

Euler method. This is called predictor step. By using next step slope and current step slope, next

step value is determined and overwritten that is called corrector step.

yn+1 = yn + hf (xn , yn )

(f (xn , yn ) + f (xn+1 , yn+1 )


yn+1 = yn + h
2

4th Order Runge-Kutta

In this method next step is calculated by adding stepsize times weighted averages of slopes for different

points between current step and next step.

k1 =hf (xn , yn )
h k1
k2 =hf (xn + , yn )
2 2
h k2
k3 =hf (xn + , yn )
2 2
k4 =hf (xn + h, yn + k3 )
k1 + 2k2 + 2k3 + k4
yn+1 =yn +
6

2
Adams-Bashford

The methods mentioned above is single-step methods. They use the values of the last step. But

Adams-Bashford is a multistep method that uses different values of y and y 0 to calculate next step.

h
yn+1 = yn + (23fn − 16fn−1 + 5fn−2 )
12

First three values of f are needed to calculate next steps . These values are taken from 4th order

Runge-Kutta solution and Adams-Bashford solution starts.

Error

These solutions are done by taking step size h = 0.1 and h = 0.05. All values and errors can be found

in the HW1.m file with the solution algortihms. Global errors can be seen by the following table for

different step sizes and solution methods.

Solution Method
Global Error
Modified Euler 4th Order Runge-Kutta Adams-Bashford
h = 0.1 0.0084 4.17E-06 0.0015
step size
h = 0.05 0.0022 2.72E-07 2.17E-04

Conclusion

As can be seen from the table as step size decreased accuracy of solution increases. And the most

accurate method is 4th order Runge-Kutta which have a global error of O(h4 ). Adams-Bashford have a

global error of O(h3 ) degree. Modified euler have a gloabal error of O(h2 ) degree. As stepsize becomes

half global errors decreased approximately 4 times, 16 times and 8 times respectively for Modified

Euler, 4th order Runge-Kutta and Adams-Bashford methods.

You might also like