Download (right-click, save target as ...) this page as a jupyterlab notebook from: Lab13-TH
LAST NAME, FIRST NAME
R00000000
ENGR 1330 Laboratory 12 - Homework
# Preamble script block to identify host, user, and kernel
import sys
! hostname
! whoami
print(sys.executable)
print(sys.version)
print(sys.version_info)
atomickitty sensei /opt/jupyterhub/bin/python3 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0] sys.version_info(major=3, minor=8, micro=10, releaselevel='final', serial=0)
Most drugs have therapeutic benefits when the drug is above a “therapeutic threshold” but toxic side effects above a “toxic threshold”. Dosing protocols are intended to maintain the level of the drug in the patient’s blood within a “therapeutic window” that between these two thresholds. Using mathematical models helps an engineer optimize the drug design so the entire delivery process is as efficient as possible and localized drug concentrations are kept within a therapeutic window. Here you will test some mathematical models for just one part of this process - an in vitro experiment of drug release from a nanoparticle. (“Nanosystems for Simultaneous Imaging and Drug Delivery to T Cells”, by Fahmy et al, AAPS Journal, 2007 vol 9.). The experimental results are listed below
Time(Days) | $\mu$-grams released |
---|---|
0 | 2.5 |
0.25 | 3.6 |
0.5 | 5.3 |
1 | 9.5 |
2 | 14.0 |
3 | 16.5 |
4 | 18.8 |
5 | 21.5 |
6 | 23.2 |
8 | 26.8 |
10 | 28.4 |
Plot the drug release data with time on the horizontal axis, and mass released on the vertical axis. Use red circles as the marker.
Create and plot a linear data model using a blue curve for the model. $\mu g_{release} = \beta_0 + \beta_1 \cdot t_{days}$
Create a list of prediction error; produce a histogram of these errors (called residuals).
Compute the sum of the squares of all of the residuals.
# code here
# plotting function
# linear model function
# supply data
# build lists of observation
# build lists of model
# plot
# prediction residuals
# sum_of_squares
Using the drug release data, repeat your analysis using a 2-nd order polynomial data model
$\mu g_{release} = \beta_0 + \beta_1 \cdot t_{days} + \beta_2 \cdot t_{days}^2 $
# code here
# quadratic model function
# build lists of model
# plot
# prediction residuals
# sum_of_squares
Using the drug release data, repeat your analysis using a 3-rd order polynomial data model
$\mu g_{release} = \beta_0 + \beta_1 \cdot t_{days} + \beta_2 \cdot t_{days}^2 + \beta_3 \cdot t_{days}^3$
Perform your trial-and-error fit. Report the sum of square of residuals of your fitted data model.
What is the order of the polynomial that gives the best fit in terms of the lowest sum of square of residuals?
# code here
# cubic model function
# build lists of model
# plot
# prediction residuals
# sum_of_squares
Using the drug release data, repeat your analysis using an exponential-decay type model
$\mu g_{release} = \beta_0 (1- e^{-\beta_1 \cdot t_{days}}) $
# code here
# exponential decay model function
# build lists of model
# plot
# prediction residuals
# sum_of_squares
Which of the drug-release models do you like best? Why? The parameters in the exponential-decay model have bio-chemical conceptual meaning. What is the significance of $\beta_0$ in this model? (Consider what happens as time gets large)
# change to markdown and write your answer
In a radiation-induced polymerization study, a gamma source was used to give measured doses of radiation. The dosage varied with position in the apparatus, with the following data being recorded:
Position from emitter (inches) | Dosage Rate, $10^5$ rads/hr |
---|---|
0 | 1.90 |
0.5 | 2.39 |
1.0 | 2.71 |
1.5 | 2.98 |
2.0 | 3.20 |
3.0 | 3.20 |
3.5 | 2.98 |
4.0 | 2.74 |
For some reason, the reading at 2.5 inches was not reported, but the value of radiation at that distance is needed; estimate the dosage level at 2.5 inches using a lagrange interpolation-type prediction engine. Plot the interpolating function as well as the observations.
# code here - ok to copy from lesson and reuse lagrange interpolation tools