Difference between revisions of "Assignment 4 - 2010"

From Process Model Formulation and Solution: 3E4
Jump to navigation Jump to search
m
m
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{OtherSidebar
{{OtherSidebar
| due_dates = 08 November 2010
| due_dates = 09 December 2010
| dates_alt_text = Due date(s)
| dates_alt_text = Due date(s)
| questions_PDF = Assignment-4b-2010.pdf
| questions_PDF = Assignment-4a-2010.pdf
| questions_text_alt = Assignment questions
| questions_text_alt = Assignment questions
| solutions_PDF =  
| solutions_PDF =  
Line 14: Line 14:
.. |m3| replace:: m\ :sup:`3`
.. |m3| replace:: m\ :sup:`3`


.. rubric:: Questions 1, 2 and 3 will be posted at the end of the semester in assignment 4(a).
Question 1 [2]
==============
 
A new type of `thermocouple <http://en.wikipedia.org/wiki/Thermocouple>`_ is being investigated by your group.  These devices produce an *almost* linear voltage  (millivolt) response at different temperatures. In practice though it is used the other way around: use the millivolt reading to predict the temperature.  The process of fitting this linear model is called *calibration*. 
 
#. Use the following data to calibrate a linear model:
 
================= ==== ==== ==== ==== ==== ==== ==== ==== ==== ====
Temperature [K]  273  293  313  333  353  373  393  413  433  453
----------------- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----
Reading [mV]   0.01 0.12 0.24 0.38 0.51 0.67 0.84 1.01 1.15 1.31 
================= ==== ==== ==== ==== ==== ==== ==== ==== ==== ====
Show the linear model and provide the predicted temperature when reading 1.00 mV.
#. Are you satisfied with this model, based on the coefficient of determination (:math:`R^2`) value? 
 
#. What is the model's standard error?  Now, are you satisfied with the model's prediction ability, given that temperatures can usually be recorded to an accuracy of :math:`\pm 0.1` K with most thermocouples.
 
Question 2 [2]
==============
 
Batch reactors are often used to calculate reaction rate data, since the dynamic balances are a direct function of the reaction rate:
 
.. math::
 
\frac{dC_{\sf A}(t)}{dt} = r_{\sf A}
assuming constant volume and assuming all energy-related terms are negligible.  We are unsure about the order of our reaction rate, :math:`\alpha`, and we also don't know the reaction rate constant, :math:`k` in the expression :math:`r_A = - k C_{\sf A}^{\alpha}`.
 
Integrating the above differential equation from time :math:`t=0` to time :math:`t=t` gives:
 
.. math::
 
\int_{C_{\sf A,0}}^{C_{\sf A}}{ \frac{1}{C_{\sf A}^\alpha} dC_{\sf A}} &= -k \int_{0}^{t}{dt} \\
                          \left.          \frac{C_{\sf A}^{1-\alpha}}{1-\alpha} \right|_{C_{\sf A,0}}^{C_{\sf A}} &= -kt  \qquad \text{where}\,\, \alpha \neq 1
 
The following concentrations are collected as a function of time
 
====================== ==== ==== ==== ==== ==== ==== ==== ==== ====
Time [hours]          0    0.5  1    2    3   5    7.5  10  17
---------------------- ---- ---- ---- ---- ---- ---- ---- ---- ----
Concentration [mol/L]  3.5  1.5  0.92 0.47 0.29 0.16 0.09 0.06 0.03
====================== ==== ==== ==== ==== ==== ==== ==== ==== ====
 
 
#. Use these concentration-time data to determine the values of :math:`\alpha` and :math:`k`, using a least squares model.
 
#. Once you have the rate constants, simulate the batch reactor (use the ``ode45`` or Python integrator) and superimpose the data from the above table on your concentration-time trajectory.  Do they agree?  Which regions of the plot have the worst agreement (this is where you would collect more data in the future).
 
 
Question 3 [3]
==============
 
The yield from your lab-scale bioreactor, :math:`y`, is a function of reactor temperature, impeller speed and reactor type (one with with baffles and one without).  You have collected these data from various experiments.
.. csv-table::
  :header: Temp = :math:`T` [°C], Speed = :math:`S` [RPM], Baffles = :math:`B` [Yes/No], Yield = :math:`y` [g]
  :widths: 30, 30, 30, 30
 
82,      4300,      No,      51
90,      3700,      Yes,    30
88,      4200,      Yes,    40
86,      3300,      Yes,    28
80,      4300,      No,      49
78,      4300,      Yes,    49
82,      3900,      Yes,    44
83,      4300,      No,      59
65,      4200,      No,      61
73,      4400,      No,      59
60,      4400,      No,      57
60,      4400,      No,      62
101,    4400,      No,      42
92,      4900,      Yes,    38
#. Use a built-in software function in MATLAB or Python (please don't use Excel) to fit a linear model that predicts the bioreactor yield from the above variables.  Your model should be of the form:
 
.. math::
\hat{y} = a_0 + a_T T + a_S S + a_B B
*Hint*: convert the No/Yes variables to integers with ``0=No`` and ``1=Yes``.
#. Interpret the meaning of each coefficient in the model and comment on the standard error.
 
#. Calculate and show the :math:`\mathbf{X}^T\mathbf{X}` and :math:`\mathbf{X}^T\mathbf{y}` matrices for this linear model in order to calculate the 4 coefficients in :math:`{\bf a} = \left[a_0, a_T, a_S, a_B\right]` yourself.  Your answer must include the MATLAB or Python code that computes these matrices and the :math:`{\bf a}` solution vector.
 


Question 4 [2]
Question 4 [2]

Latest revision as of 20:18, 2 December 2010

Due date(s): 09 December 2010
Nuvola mimetypes pdf.png (PDF) Assignment questions
Other instructions Hand-in at class.

<rst> <rst-options: 'toc' = False/> <rst-options: 'reset-figures' = False/> .. |m3| replace:: m\ :sup:`3`

Question 1 [2]

==

A new type of `thermocouple <http://en.wikipedia.org/wiki/Thermocouple>`_ is being investigated by your group. These devices produce an *almost* linear voltage (millivolt) response at different temperatures. In practice though it is used the other way around: use the millivolt reading to predict the temperature. The process of fitting this linear model is called *calibration*.

  1. . Use the following data to calibrate a linear model:

================= ==== ==== ==== ==== ==== ==== ==== ==== ==== ==== Temperature [K] 273 293 313 333 353 373 393 413 433 453 ----------------- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- Reading [mV] 0.01 0.12 0.24 0.38 0.51 0.67 0.84 1.01 1.15 1.31 ================= ==== ==== ==== ==== ==== ==== ==== ==== ==== ====


Show the linear model and provide the predicted temperature when reading 1.00 mV.

  1. . Are you satisfied with this model, based on the coefficient of determination (:math:`R^2`) value?
  1. . What is the model's standard error? Now, are you satisfied with the model's prediction ability, given that temperatures can usually be recorded to an accuracy of :math:`\pm 0.1` K with most thermocouples.

Question 2 [2]

==

Batch reactors are often used to calculate reaction rate data, since the dynamic balances are a direct function of the reaction rate:

.. math::

\frac{dC_{\sf A}(t)}{dt} = r_{\sf A}

assuming constant volume and assuming all energy-related terms are negligible. We are unsure about the order of our reaction rate, :math:`\alpha`, and we also don't know the reaction rate constant, :math:`k` in the expression :math:`r_A = - k C_{\sf A}^{\alpha}`.

Integrating the above differential equation from time :math:`t=0` to time :math:`t=t` gives:

.. math::

\int_{C_{\sf A,0}}^{C_{\sf A}}{ \frac{1}{C_{\sf A}^\alpha} dC_{\sf A}} &= -k \int_{0}^{t}{dt} \\

                          \left.          \frac{C_{\sf A}^{1-\alpha}}{1-\alpha} \right|_{C_{\sf A,0}}^{C_{\sf A}} &= -kt  \qquad \text{where}\,\, \alpha \neq 1

The following concentrations are collected as a function of time

================== ==== ==== ==== ==== ==== ==== ==== ====

Time [hours] 0 0.5 1 2 3 5 7.5 10 17


---- ---- ---- ---- ---- ---- ---- ---- ----

Concentration [mol/L] 3.5 1.5 0.92 0.47 0.29 0.16 0.09 0.06 0.03

================== ==== ==== ==== ==== ==== ==== ==== ====

  1. . Use these concentration-time data to determine the values of :math:`\alpha` and :math:`k`, using a least squares model.
  1. . Once you have the rate constants, simulate the batch reactor (use the ``ode45`` or Python integrator) and superimpose the data from the above table on your concentration-time trajectory. Do they agree? Which regions of the plot have the worst agreement (this is where you would collect more data in the future).


Question 3 [3]

==

The yield from your lab-scale bioreactor, :math:`y`, is a function of reactor temperature, impeller speed and reactor type (one with with baffles and one without). You have collected these data from various experiments.

.. csv-table:: :header: Temp = :math:`T` [°C], Speed = :math:`S` [RPM], Baffles = :math:`B` [Yes/No], Yield = :math:`y` [g] :widths: 30, 30, 30, 30

82, 4300, No, 51 90, 3700, Yes, 30 88, 4200, Yes, 40 86, 3300, Yes, 28 80, 4300, No, 49 78, 4300, Yes, 49 82, 3900, Yes, 44 83, 4300, No, 59 65, 4200, No, 61 73, 4400, No, 59 60, 4400, No, 57 60, 4400, No, 62 101, 4400, No, 42 92, 4900, Yes, 38

  1. . Use a built-in software function in MATLAB or Python (please don't use Excel) to fit a linear model that predicts the bioreactor yield from the above variables. Your model should be of the form:

.. math::

\hat{y} = a_0 + a_T T + a_S S + a_B B

*Hint*: convert the No/Yes variables to integers with ``0=No`` and ``1=Yes``.

  1. . Interpret the meaning of each coefficient in the model and comment on the standard error.
  1. . Calculate and show the :math:`\mathbf{X}^T\mathbf{X}` and :math:`\mathbf{X}^T\mathbf{y}` matrices for this linear model in order to calculate the 4 coefficients in :math:`{\bf a} = \left[a_0, a_T, a_S, a_B\right]` yourself. Your answer must include the MATLAB or Python code that computes these matrices and the :math:`{\bf a}` solution vector.


Question 4 [2]

==

.. Similar to Tutorial 8, 2009

The viscosity of sulphuric acid, :math:`\nu`, varies with purity, :math:`p` in the following manner:

======================== ===== =====
math:`p` [%] 20 60 80

----- ----- -----

math:`\nu` [millipascal] 1.40 5.37 17.4
======================== ===== =====
  1. . Express :math:`\nu(p)` as a quadratic function using Lagrange interpolating polynomials. Do not simplify the polynomial.
  2. . Express :math:`\nu(p)` as a quadratic function using Newton interpolating polynomials. Do not simplify the polynomial.
  3. . Fit a cubic spline through the data points: clearly show your :math:`{\bf Xa = y}` linear system of equations, then solve them using computer software; finally report your spline coefficients.
  4. . Use computer software to plot:
	*	the Newton interpolating polynomial 

* the cubic spline, * and the 3 data points on the same graph.

  1. . What is the estimated viscosity at :math:`p` = 40% purity using linear interpolation?
  2. . Which of the estimation procedures that you used above has the closest estimate to the true value of 2.51 millipascal?

Question 5 [2]

===

The following data are collected from a bioreactor experiment, during the growth phase.

============= ===== ===== ===== =====

Time [hours] 0 1.0 2.0 4.0 6.0


----- ----- ----- ----- -----

math:`C` [g/L] 0.1 0.341 1.102 4.95 11.24
============= ===== ===== ===== =====

Fit a natural cubic spline for these data and use it to estimate the number of cells at time 3, 5, and 7 hours.

Show your matrix derivation for the linear system of equations, and solve it using computer software. Plot the cubic spline over the time range 0 to 8 hours.

Bonus question [0.5]

========

Use the cubic spline from the previous question and find the time where the cell count was approximately 10.0 g/L. Do not solve the equation by hand, but investigate `MATLAB's <http://www.mathworks.com/help/techdoc/ref/roots.html>`_ or `Python's <http://docs.scipy.org/doc/numpy/reference/generated/numpy.roots.html>`_ polynomial root finding function: ``roots(...)``

.. raw:: latex

\vspace{0.5cm} \hrule \begin{center}END\end{center} </rst>