Tutorial 7 - 2010
Due date(s): | 11 November 2010 |
(PDF) | Tutorial questions |
Other instructions | Hand-in at class. |
<rst> <rst-options: 'toc' = False/> <rst-options: 'reset-figures' = False/>
.. |m3| replace:: m\ :sup:`3` .. highlight:: python
.. rubric:: Tutorial objectives: Numerical differentiation and plotting.
Question 1 [2]
====
This question uses the experimental data from the class notes. A batch system was charged with reactant :math:`{\sf A}` at time :math:`t=0` at a concentration of 1.0 mol/L. As the assumed first-order reaction evolved, the concentrations were recorded:
.. csv-table:: :header: "Time (minutes)", "Concentration (mol/L)"
0, 1.00 5, 0.84 10, 0.72 20, 0.57 30, 0.47 45, 0.37 60, 0.30
The dynamic balance for this system can be shown to be :math:`\displaystyle \frac{dC_{\sf A}(t)}{dt} = -k C_{\sf A}(t)`.
- . Reproduce the above table and add a column that provides an approximation of :math:`\displaystyle \frac{dC_{\sf A}(t)}{dt}` at each time step.
- . Add a fourth column that lists the order of your approximation listed in part 1.
- . Use a 2nd order Lagrange polynomial to approximate the :math:`C_{\sf A}(t)` data, and use this polynomial to estimate :math:`C_{\sf A}\,'(t)` at time :math:`t=15` minutes.
- . Can you provide an :math:`O(h^2)` estimate of :math:`\displaystyle \frac{dC_{\sf A}(t)}{dt}` at :math:`t=0`? If so, please calculate it.
Question 2 [1.5]
====
A second order reaction in a constant-volume batch reactor has the following time-dependent behaviour:
.. math::
C_{\sf A}(t) = \frac{C_{\sf A}(0)}{C_{\sf A}(0)kt + 1} \qquad\,\text{with}\qquad\, k = 0.002 \frac{\text{m}^3}{\text{mol.s}} \qquad\,\text{and}\qquad\,C_{\sf A}(0) = 2.5 \frac{\text{mol}}{\text{m}^3}
Starting with :math:`h = 1.0` and decreasing in powers of 10, which step size, :math:`h=\Delta t`, provides the lowest error estimate of :math:`\displaystyle \left.\frac{dC_{\sf A}}{dt}\right|_{t=100}` at :math:`t=100` seconds?
Present your results in tabular form with these 5 columns:
* Step size, :math:`h = \Delta t` * Forward difference approximation * Error in the forward difference approximation * Central difference approximation * Error in the central difference approximation
Bonus question [0.5]
=========
Show the two error columns from question 2 in graphical form, using log-axes for both the x- and y-axis. Search for help over the internet if you don't know how to plot log-plots in MATLAB, or with Python's ``matplotlib`` library. Add a legend, grid lines and axis labels to the plot.
.. raw:: latex
\vspace{0.25cm} \hrule \begin{center}END\end{center} </rst>