Fakultät für Mathematik und Informatik 22. Mai 2013 TU Bergakademie Freiberg
Prof. Dr. O. Rheinbach/Dr. M. Helm
Numerical Analysis of Differential Equations Initial Value Problems (V) – MATLAB training
Hint: This exercises should be done during the problem session on June, 13. If possible please install MATLAB or OCTAVE (http://www.gnu.org/software/octave/, for free) on your laptop and bring it with you.
Exercise 1
Consider the initial value problem
y0(t) =tsin(2y), y(0) =π 4.
from session 1.
a) Approximate the exact solution
y(t) = arctan(et2)
on the time interval [0,3]with the modified Euler and Heun’s third-order method. Draw a picture of the exact and the numerical solutions. Play with the step size parameterh.
b) Approximate the solution with the explicit fourth-order Adams-Bashforth method. Take the first values from Heuns’s method in (a) as a startup.
c) Draw a loglog plot of the error maxi|yi −y(ti)| of the numerical solutions for step sizes between1and 10−4
Exercise 2 The ODE
y0(t) =λ[y(t)−g(t)] +g0(t) has the general solution
y(t) =Ceλt+g(t), C∈R
which, for Reλ <0, consists on a decaying transientCeλtand a steady state componentg(t). We consider the caseg(t) = arctant,λ=−10.
a) Draw a picture of the general solution, i. e. plot the graph ofy(t)for several choices ofC.
b) Find the exact solution for the initial conditiony(0) = 0.
c) Try to approximate the solution of this IVP with the explicit Euler method. Plot the nume- rical solutions on the time interval [0,5]forh= 0.5,h= 0.25andh= 0.1.
d) Repeat the experiment from (c) with the implicit Euler method. Comment your observation.