Notes on Lab #3

In this lab we'll apply some of our newly-acquired modeling techniques to a real-world situation: the spread of drugs in the body.

To get started, download the Aspirin Model and Dilantin Model.1 Then read through Module 3.5 pp. 98 - 103 (up to Mathematics of Repeated Doses), in which you will use these pre-built models to get familiar with the overall approach. These two models will also serve as templates for the more complicated models you will build for your turnin. These more complicated models are described in Projects 1 and 3 on p. 108. For these projects, you will turn in three model files, named appropriately. For example, my files would be levys_TwoCompartmentAspirin1a.mdl, levys_TwoCompartmentAspirin1b.mdl, and levys_OneCompartmentDilantin3.mdl. You will also turn in a single writeup in PDF format. As usual, it's nicer if you can zip all your files together into one ( so you only have to submit one file. If you do this, do a "reality check" by first unzipping the file to make sure it has everything it's supposed to!

Project 1

To get started, build the compartment for the digestive system first. This should be like the population model from the first lab (see also p. 75), except that

Test this digest-system compartment model by itself first, looking for exponential decay in the concentration of aspirin in the intestines. Once this is working, connect the other end of the absorption flow into the aspirin in plasma stock (you may have to delete the old flow and rebuild it). Change the aspirin in plasma stock to have an initial value of zero.

Now, think about what should happen to aspirin in plasma in this simple two-compartment model. Run the model and test your predictions by plotting aspirin in plasma. In your writeup, include labeled plots for the one-compartment plot for this variable, as well as its plot under two different values of absorption rate. For each of the plots, write a brief description of how the plots characterize the differences between the successive models.

Once you're satisfied with username_TwoCompartmentAspirin1a, save it as username_TwoCompartmentAspirin1b and make the indicated modifications:

Add a few labeled plots and comments to your writeup, showing some runs from the 1b version.

Project 3

Next, copy the Dilantin model and rename the copy appropriately. An easy way to do Project 3 is to add three more flows into drug in system, one for each loading dosage and time. Before you do that, you can change the normal (entering) flow to start at 28 hours (24 hours after the final loading dose at 4 hours). Run the model, then plot drug in system to make sure this initial modification worked. Then add the new flows for the loading doses, by mimicking what's in entering. Each of these loading-dosage flows will use a pulse at a given time (400 mg at 0 hours, 300 mg at 2 hours, 300 mg at 4 hours, but check the original dosage variable to determine the actual magnitudes). As with the aspirin model, show a labeled plot contrasting this version with the original, and briefly comment on the effect of the loading dose. If you have time, you might want to rename the variables to distinguish between the normal and loading flows. You may also be able to reduce the three loading-dosage flows to a single flow, using a pulse train, combined with a dosage that uses an IF-THEN-ELSE that is sensitive to time. This would simplify the appearance of the model.
1This model is modified slightly from the one on the textbook's web page, so it will match the example in the book. There also appears to be an error in the book, on the top of p. 104: to reproduce the results in this section, the time interval must be 1 sec, not 0.01 sec.