Description
-
Improving Euler’s method (again):
-
-
Read section 7.2 of the text. Make sure you can explain the idea of improved Euler’s method.
-
-
-
Write a function named \ImprovedEuler” using the same inputs and output as the \Euler” function in project 1.
-
-
-
Write a script to reproduce table 7.1 in the text. Plot the approximate solution combined with the true solution.
-
-
The Runge-Kutta Method:
-
-
Read section 7.3 of the text. Make sure you can explain the idea of the Runge-Kutta method.
-
-
-
Write a function named \RK” using the same inputs and output as the \Euler” function in project 1.
-
-
-
Write a script to reproduce table 7.2 in the text. Plot the approximate solution combined with the true solution.
-
-
Order of convergence: We showed in class that (forward) Euler’s method is a rst order method. That is, the error can be shown to be of the form
jeN j = jyN y(tN )j = C t ( rst power for t):
where C is a constant independent of t. An order p method has error of the form jeN j = jyN y(tN )j = C tp (pth power for t)
so that for t small, tp is very small for big whole number p implying the error is very small as well.
(a) If a method is of order p, then
jeN j = C tp:
. Taking half the stepsize (twice the number of steps), we have that
-
je2N j = C
t
p
:
2
Show that
je2Nj :
p log2
eN
j
j
Use this formula for the next two parts.
(b) Using the example in the previous two problems, write a script which computes the error and order of convergence for t = 101 ; 201 ; 401 ; for each of the following methods.
-
-
-
Euler’s method
-
-
-
-
-
Improved Euler’s method
-
-
-
-
-
The Runge-Kutta method
-
-
-
-
Find a way to see the order of convergence for centered Euler’s method. Compare this method to other methods.
-
-
Scilab ODE solver:
-
-
Use the Scilab command \ode(y0,t0,t,f,‘rk’)” to solve the problem in the previous three problems.
-
-
-
Find the order of convergence of this method.
-
-
-
Compare this method to our other methods.
-
1
-
(Bonus Problem!) Scilab is open source. Track down the source code for the \ode” command and explain what you nd.
-
(Bonus Problem!) Prove that improved Euler’s method is an order 2 method. Prove that Runge-Kutta is an order 4 method.
-
(Bonus Problem!) Eventually you will see these high order methods stop improving in your Scilab outputs. Explain why.
2