You are on page 1of 1

MMÜ 602 - NUMERICAL METHODS - FALL 2019 - HOMEWORK 6

Due: 6 January 2020, Monday

1) Solve the ODE, / = −166( − ln( )) + 1/ over the interval ∈ [1, 1.5] if the initial condition is
(1) = 0. Apply the Runge-Kutta Fehlberg method given in the lecture notes. In your program, choose the
initial step size as 0.5 . In order to determine the acceptable error values, choose = 10 and
= 10 . Use the formula ℎ = ∙ ℎ ( /| |)∝ to adjust the step size where the exponent ∝
switches between 0.2 and 0.25 depending on the amount of the local truncation error estimate . Choose
the safety factor as 0.95 . The maximum step size allowed in the solution is 0.02 . Make sure that your
numerical solution ends at exactly = 1.5 . The exact solution to the given ODE is = ( )+ .
Note that in Matlab, ( ) is written as log(t) .

a) Plot the numerical solution (as data-points) and the exact solution (as solid-line) together in the same
figure. (Note: In plotting the exact solution, use a step size of 0.001).
b) For the numerical solution, calculate the number of steps required, and the values of the minimum and
maximum step-sizes. Plot the step size versus .
c) Display the results of your numerical solution in tabulated form which must comprise separate columns
for , , (the corresponding exact values) and (the corresponding true errors).

You might also like