In this tutorial, you will learn to:
- Create reaction scheme based on a compartmental model
- Configure the properties of each compartment
- Define transport processes between compartments
- Create an external stimulus profile
- Set the simulator parameters
- Run the simulation
- Display the simulation results
This section leads you through the procedure for simulating a typical compartmental model of the type used in pharmacokinetics. If you've never used Kinetiscope before, this tutorial will help you become familiar with Kinetiscope's different menus and functions.
Dosing of an Intravenous Anaesthetic
A three-compartment model is commonly used to quantitatively estimate concentration levels following administration of the drug. Such a model contains
- a central compartment into which the drug is injected and from which it is irreversibly eliminated and
- two peripheral compartments with different apparent volumes and intercompartmental transfer rates.
The two peripheral compartments are sometimes classified as "fast" and "slow" in accord with the transfer rates connecting them to the central compartment. After injection the drug becomes distributed among the three compartments, and the drug concentration then decays in a manner that depends on the various transfer rates and volumes. In this example, the pharmacokinetics of propofol (2,5-di-iso-propylphenol) are examined.
Creating a New Reaction Scheme
You will next create a new reaction scheme based on a compartmental model and save it as a file named tutorial2.rxn.
When you first create a compartmental reaction scheme, you specify the type of model and select the time, energy and concentration units to be used throughout. When you later save your input, you specify its file name and the directory where it will be stored.
Select from the
menu bar of Kinetiscope's
click the push button on the main window's tool bar.
A Select Units Dialog appears.
Select the following units for time, energy and concentration using the
min, kcal, mole/liter.
Make the selections by clicking the left mouse button on the drop-down list boxes and selecting the appropriate entry.
The dialog should look like this:
The scheme window will look like this:
If you hover with the mouse cursor over the compartment, a tool tip appears with a brief summary of its contents.
Saving your Reaction Scheme
As you modify your reaction scheme, remember to periodically save your changes. This will help prevent accidental loss of data.
- Select from the menu bar of the main window, or click the push button on the main window's tool bar. A File Save Dialog appears.
Use the dialog to navigate to the
directory you have selected for your files, and enter the name
If you make an undesired change (for example, accidentally delete a step), you now can recover by selecting from the menu bar of the main window, or clicking the (Revert to saved) push button on the main window's tool bar.
Constructing the Scheme Diagram
We begin by laying out the network of compartments and transfer paths that describe the system. While nominally this is termed a three-compartment model, we will use a total of five compartments; one additional compartment serves as a reservoir of drug to be delivered and the other additional compartment serves as a receptacle for eliminated drug.
- Click the Scheme tab on the scheme window.
(Add new compartment) push button.
A new, empty compartment is added to the scheme diagram, named Compartment 2.
- Move the new compartment to the right of the first by pressing the left mouse button over the new compartment, dragging it to the new location, and releasing the mouse button to anchor it.
Repeat Steps 2 and 3 three more times until you have five compartments laid out as
(It does not critical which compartment is placed at a particular location - we will rename them all later).
Click the (Add transfer path)
The mouse cursor changes to a cross.
Press and hold the left mouse while over Compartment 2, the move the mouse cursor until it is over
Compartment 1 and release the button.
A new transfer path named Transfer path 1 now connects the two compartments.
Repeat Steps 1 and 2 to add three more transfer paths between compartments so that
your scheme diagram looks like this.
(It does not matter which transfer path is at a particular location. In principle it does not matter which of the two connected compartments is clicked on first, but for clarity of instructions later in this tutorial, always click the center compartment first, then the second compartment).
Configuring Compartments and Transfer Paths
We next configure each compartment and transfer path.
- Click on the Scheme tab of the scheme window.
Double-click the left mouse button on the center compartment in the scheme diagram.
A Compartment Editor Dialog appears.
- Click on the Compartment Details tab of the dialog.
In the Compartment Name
data entry field, type
Set the Constant Volume data entry field to a value of
Click the white square button displaying the current Compartment Color.
This opens a Select Color Dialog.
- Use the Select Color Dialog to choose a light blue shade and close the color dialog.
The Square button on the Compartment Editor Dialog is now light blue.
Close the Compartment Editor Dialog by clicking
Repeat steps 2-8 four more times to configure the remaining four compartments in the same way, using these settings:
Compartment Name fast Constant Volume 34.8liter Color light blue
Compartment Name slow Constant Volume 236liter Color light blue
Compartment Name source Constant Volume 1.0liter Color white
Compartment Name output Constant Volume 1.0liter Color white
This particular compartmental scheme does not have chemical reactions, but we do need to define a species to whose concentrations in each compartment will be tracked. To do so, we enter a dummy reaction step that serves to define the species but will be inactive during the simulation.
- Click on the Scheme tab on the scheme window.
Double-click the left mouse button on the compartment you have named source (colored white).
The compartment is highlighted with a cross-hatch and the Compartment Editor Dialog opens.
Click the Reaction Steps tab, then click the
a reaction step) push button on the dialog's tool bar.
The Reaction Step Editor Dialog that appears is used to enter your reaction mechanism.
Type in the reaction step in the Equation data entry field:
propofol => propofol
In the Rate Constant Values area directly
below the equation data entry field, set the drop-down list box
Forward Rate Constant k data entry field,
OKto dismiss the Reaction Editor Dialog.
This returns you to the Compartment Editor Dialog.
- Select the Initial Concentrations tab.
- In the table of species concentrations, double-click on the entry for propofol in the Initial Concentration column.
OKto dismiss the Compartment Editor Dialog.
This will return you to the tutorial2 - compartmental model scheme window.
and then press the Enter key.
- Click on the Scheme tab on the scheme window.
Double-click the left mouse button on the transfer path linking the fast and central compartments.
The compartment is highlighted with a cross-hatch and the Transfer Path Editor Dialog opens.
In the Compartment Name
data entry field, type
a transfer step) push button on the dialog's tool bar.
The Transfer Step Editor Dialog that appears is used to initialize the new transfer step.
Set the controls on this dialog to the following settings:
Transfer Type Proportional flow Transferred Species propofol
Direction bidirectional Rate Constant Form Temperature-independent Rate Constant k Forward (central to fast) 1.006e-1 Rate Constant k Reverse (fast to central) 5.685e-2
OKto dismiss the Transfer Step Editor Dialog.
This returns you to the Transfer Path Editor Dialog.
OKto dismiss the Transfer Path Editor Dialog.
This returns you to the scheme diagram.
Repeat steps 2-7 three more times to configure the remaining three transfer paths in the same way, using the following settings:
Transfer path connecting central and slow compartments:
Transfer Path Name slow transfer Transfer Type Proportional flow Transferred Species propofol
Direction bidirectional Rate Constant Form Temperature-independent Rate Constant k Forward (central to slow) 5.364e-2 Rate Constant k Reverse (slow to central) 4.687e-3
Transfer path connecting central and source compartments:
Transfer Path Name input Transfer Type Constant flow Transferred Species propofol
Direction Reverse only(source to central) Rate Constant Form External Stimulus-independent Constant K' Reverse (source to central) 0.051
Transfer path connecting central and output compartments:
Transfer Path Name elimination Transfer Type Proportional flow Transferred Species propofol
Direction Forward only(central to output) Rate Constant Form Temperature-independent Rate Constant k Forward (central to output) 6.923e-2
The scheme diagram should now look like this:
At this point all four transfer paths have a transfer step.
The input transfer path is unique in that its step uses a rate constant controlled by an external stimulus. We configure the external stimulus in the next section.
Entering the Reaction Conditions
Different combinations of conditions can be chosen using the drop-down list boxes on the Reaction Conditions Page. Not all combinations of them are allowed (or physically meaningful). Kinetiscope will display an error message if an unsupported combination is selected.
You will simulate conditions where an external stimulus causes the drug to be injected into the system with an initial bolus, then followed by a steady slow rate of infusion.
- Click the Reaction Conditions tab.
Volume is constant
for the top left list box.
Leave the bottom left list box in the
Pressure is constant
state; variable pressure is not allowed for this type of scheme.
Temperature is constant
for the top right list box.
Leave the middle right list
box in the
Voltage is off
External stimulus follows a user-defined profile
for the lower right list box.
When you do so, a graph showing the current stimulus profile (currently unspecified) and data entry fields for the Temperature and the Maximum Step Size (in stimulus units, i.e. unitless) will be displayed below the list boxes.
Temperature data entry field, leave the value at
its default value:
There are no temperature-dependent rates in the reaction scheme so this value has no effect.
Maximum Step Size data entry field,
Defining an External Stimulus Profile
For this simulation, we want to first deliver a fixed quantity of the drug in a very short time; this is achieved by a short initial "square wave pulse" in the external stimulus profile. Following the bolus, a slow feed of drug is maintained by setting the external stimulus to an appropriate low value. At the end of a 30 minute period drug delivery is halted by setting the external stimulus value to zero. We will continue the simulation beyond this stopping point to observe how the drug level decays following this administration protocol.
With the left mouse button, click the
Change Profile...push button.
A Profile Editor Dialog appears.
- On the dialog, click the click the (Add a profile) push button on the dialog's tool bar.
appears requesting a unique identifying name for the profile. Type
into the entry field and click
A default profile is created and displayed on the data table and the graph.
Edit the Time and Stimulus values in the data table. To do so, double-click on an entry in the table, type in the new value, and press the Enter key. As you do so, the graph is updated with the current values.
Edit and add entries to the table so that it contains, in order, the following values:
Time(sec) Stimulus Value 0 0 0.0001 1 0.0101 1 0.0102 0.0003328 30.0 0.0003328 30.0001 0 60 0
The dialog should look like this:
The Profile Editor Dialog is dismissed and you are returned to the scheme window. Its profile graph is updated with the new profile you have just created.
All reaction conditions have now been set. The final step before simulation is to edit the simulation settings.
Entering the Simulation Settings
A number of parameters must be specified to configure the simulator. These settings are listed in three groups: General Settings, which include the total number of particles representing molecules and the recording interval; Limits, which allow you to set stopping points for the simulation; and Equilibrium Detect, settings for the Kinetiscope equilibrium detection and emulation system. You access the simulation parameters on the Simulation Settings Page.
- Select the Simulation Settings tab.
Set the data entry field for the Total Number of Particles to
This parameter specifies the initial number of particles in the simulation. They are apportioned among all species which have a nonzero initial concentration. The number should be large enough to accommodate the dynamic range of concentrations that will occur in the simulation. A larger number will also reduce stochastic noise. There is a trade-off between these benefits and the larger amount of computer time required to reach a given point in the simulation (see the Example Simulation Simulation Precision: Parallel Reactions ).
Set the data entry field for the Record State at Intervals of to
Set the data entry field for the Random Number Seed to
The next group of parameters control the limits of the simulation.
Set the data entry field for the Maximum Number of Events to a value of
Setting this parameter to zero disables it.
- Set the data entry field for the Maximum time in Simulation to
Setting this parameter to zero disables it. When reaction conditions use a programmed parameter (temperature, voltage or external stimulus) the simulation is programmed to end when the last time point in the profile is reached.
The third set of simulation settings are the Equilibrium Detect settings. This is used for systems with reversible reaction steps which may come into equilibrium during a simulation. In simulations whose reaction conditions specify a programmed parameter, the equilibrium detection algorithm has little benefit.
- Uncheck the box in the Equilibrium Detect area.
Your screen should now appear like this:
Running the Simulation
Now you are ready to run the simulation.
- Click the Scheme tab.
Click the (Start a
simulation) push button on the scheme window's tool bar.
A simulator window opens that tells you that the simulation is running. You can track the reaction as it progresses, with this window displaying the internal elapsed time in the simulation, the number of events that have occurred, how long the simulation has been running, and the number of times the system state has been recorded for later analysis:
OKpush button on the simulator window when the simulation completes.
If you do not click
OK, the window will close automatically after 5 seconds. When you return to Kinetiscope's main window, the status display at the bottom of the tutorial2 scheme window now tells you that the simulation has finished, and the reason why the simulation stopped.
Note: Kinetiscope automatically saves your reaction file with the new simulation results when the simulation is complete.
This simulation requires approximately one minute to complete on a mid-range microcomputer.
Viewing the Simulation Results
Our primary interest is the drug concentration in the central compartment, which represents the circulatory system.
- Click the Scheme tab on the scheme window
- Select the central compartment with a single click of the left mouse button
(Create results window) push button on the scheme window's tool bar.
A new results window appears, displaying a graph of concentrations of propofol in the compartment as a function of elapsed time:
You may zoom in to a specific range of the graph by pressing the left mouse button and drawing a rubber-band box around the region of interest.
You may modify the information displayed on the graph using the conttext menu.
- Click the right mouse button when the cursor is over the graph.
The context menu appears.
- select the action form the context menu.
Modifty the plot's content using the
Line Plot Settings Dialog that appears.
For example, in the Select Compartments area, hold down the Ctrl> key, click on the source compartment name in the list box, then click
OK. A new graph is added to the results window that shows the depletion of propofol from the source compartment.
You have now completed this tutorial. You should now know the basics for simulating a compartmental reaction scheme using Kinetiscope.
Other tutorials lead you through the procedures for setting up other types of reaction systems:
- In the Single Reactor Reaction Scheme Tutorial, you construct a reaction scheme to simulate the gas phase explosion of ozone under adiabatic conditions.
- In the Three-dimensional Reaction Scheme Tutorial, a reaction scheme depicting acid catalyzed chemistry in a thin film is constructed. An externally generated concentration profile is used to set the initial composition.
- In the Electrochemistry Tutorial, the steps you take to perform a simulation of a system containing electrochemical steps are detailed. This system uses an exponentially expanding grid of compartments.