8.5. Chapter 8 Exercise#
You should try the following exercise questions first, then check with the answers.
Exercise 8.1
A certain chemical reaction is described by a stiff system
Show that \(\,y_1\,\) decays rapidly while \(\,y_2\,\) decays slowly.
Find the eigenvalues of the associated Jacobian matrix and the stiffness ratio.
Solution to
Exercise 8.2
Consider the problem
The general solution is \(y(x) = -A\cos x - B\sin x + Ce^{-100x}\). In what sense could this single equation be said to exhibit stiffness? If Euler’s rule were used to obtain a numerical solution, what would be the maximum allowable steplength.
Solution to
From both the equation and the analytical solution it can be seen that the solution has a fast decaying element as well as a slowly varying element, hence the problem can be considered as stiff.
The stability region for Euler method is \([-2, 0]\), this means
as \(\lambda =-100\), so
Exercise 8.3
Detertermine whether the following problem is stiff
[Hint: reduce the equation to a system of two first order ODEs i.e. let \(y = y_1\), \(y' = y_2\), then differentiation gives \(y' = y_1'\), and \(y'' = y'_2\,\)].
Solution to
Rearrange the equation as
The characteristic equation is
so the roots of the characteristic equation are
so the general solution is
Substituting the initial conditions, we can determine the coefficient \(c_1=1\) and \(c_2=1\). Therefore the solution is
The solution has two components, \(e^{-19x}\) changing much faster than \(e^{-x}\), so the problem can be considered stiff.
The Jacobian matrix is
its eigenvalues are
so the stiffness ratio of the system is
Exercise 8.4
Consider the non-linear chemical system in Example 8.3. Find time-dependent solution of the species \(y_1\), \(y_2\), and \(y_3\) for a duration of 60 seconds using the stiff equation solver routine ode15s from the MATLAB ODE solver routines. Try to run the model using ode113 solver and comment on your results. Change both tolerances RelTol and AbsTol and comment on your results.
Exercise 8.5
Consider the Robertson Problem in the MATLAB Program 4. Find time-dependent solution of the species \(y_1\), \(y_2\), and \(y_3\) for a duration of \(t = 100\) seconds using the stiff equation solver routine ode15s from MATLAB ODE solver routines. Use tic toc commands to record the run time. Try to run the model using ode113 solver and comment on your results. Change the tolerances RelTol and AbsTol and comment on your results. Using the results from the ode15s, find the eigenvalues of the the Jacobian Matrix at \(t = 0\), \(t = 1.0e-5\) and \(t = 60\) seconds, and by finding the corresponding stiffness ratio, comment on the stability of the system. Produce a table to record the run times and your computational stats.
Solution to
You will find the running time for ode15s is much shorter than that for ode113. Check your results and comment.
Exercise 8.6
Find the interval of absolute stability for the backward differentiation formulae (BDF) for \(k = 1,2,\dots,4\) methods using root locus method, and show whether they are convergent. For the same BDF methods plot the region of absolute stability using boundary root locus method.
Solution to
Solution are shown in the lecture notes Fig. 8.1.
Exercise 8.7
Consider the following system of ODEs which represents the mathematical formulation of an electric circuit:
The above system can be re-arranged as a system of two ODEs:
Find time-dependent solution of \(y_1\) and \(y_2\) for a duration of 5 seconds using the stiff equation solver routine ode15s from the MATLAB ODE solver routines. Try to run the model using ode113 solver and comment on your results. Change both tolerances RelTol and AbsTol and comment on your results. Set the option ‘Stats’ ‘on’ in the options=odeset command, e.g.
options=odeset('Stats','on','RelTol',1e-6,'AbsTol',1.e-8)
and prepare a table for comparison of the stats using the two different solvers. Comment on your results.