Quick Tutorial - A Compartmental Scheme

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.

To create the reaction scheme:

  1. Select File | New Scheme | Compartmental Model... from the menu bar of Kinetiscope's main window
    or
    click the push button on the main window's tool bar.

    A Select Units Dialog appears.

  2. Select the following units for time, energy and concentration using the three drop-down list boxes: 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:

    This is the only time that the units for a particular file can be specified. The units that are selected here must be used consistently for all input data, and are used for plotting the simulation results.
  3. Click OK.
You now return to Kinetiscope's main window, where a new compartmental scheme window named untitled1 - compartmental model has been created. The diagram contains a single empty compartment.

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.

To save a reaction scheme under a name you specify:

  1. Select File | Save As... 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.
  2. Use the dialog to navigate to the directory you have selected for your files, and enter the name

    tutorial2,

    then click OK.

If you make an undesired change (for example, accidentally delete a step), you now can recover by selectingFile | Revert to Saved... 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.

To create the compartments:

  1. Click the Scheme tab on the scheme window.
  2. Click the (Add new compartment) push button.

    A new, empty compartment is added to the scheme diagram, named Compartment 2.

  3. 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.
  4. Repeat Steps 2 and 3 three more times until you have five compartments laid out as shown.

    (It does not critical which compartment is placed at a particular location - we will rename them all later).

To create the transfer paths:

  1. Click the (Add transfer path) push button.

    The mouse cursor changes to a cross.

  2. 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.

  3. 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.

To configure the compartments:
  1. Click on the Scheme tab of the scheme window.
  2. Double-click the left mouse button on the center compartment in the scheme diagram.

    A Compartment Editor Dialog appears.

  3. Click on the Compartment Details tab of the dialog.
  4. In the Compartment Name data entry field, type

    central .

  5. Set the Constant Volume data entry field to a value of

    19.7 .

  6. Click the white square button displaying the current Compartment Color.

    This opens a Select Color Dialog.

  7. 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.

  8. Close the Compartment Editor Dialog by clicking OK.
  9. Repeat steps 2-8 four more times to configure the remaining four compartments in the same way, using these settings:

    Left compartment:

    Compartment Name fast
    Constant Volume 34.8 liter
    Color light blue

    Right compartment:

    Compartment Name slow
    Constant Volume 236 liter
    Color light blue

    Top compartment:

    Compartment Name source
    Constant Volume 1.0 liter
    Color white

    Bottom compartment:

    Compartment Name output
    Constant Volume 1.0 liter
    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.

To define a dummy reaction step:
  1. Click on the Scheme tab on the scheme window.
  2. 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.

  3. Click the Reaction Steps tab, then click the (Add 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.

  4. Type in the reaction step in the Equation data entry field:

    propofol => propofol

  5. In the Rate Constant Values area directly below the equation data entry field, set the drop-down list box to the

    Temperature-independent

    setting.

  6. In the Forward Rate Constant k data entry field, type

    1.0e-100.

  7. Click OK to dismiss the Reaction Editor Dialog.

    This returns you to the Compartment Editor Dialog.

  8. Select the Initial Concentrations tab.
  9. In the table of species concentrations, double-click on the entry for propofol in the Initial Concentration column.
  10. 6e-3

    and then press the Enter key.

  11. Click OK to dismiss the Compartment Editor Dialog.

    This will return you to the tutorial2 - compartmental model scheme window.

To configure the transfer steps:
  1. Click on the Scheme tab on the scheme window.
  2. 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.

  3. In the Compartment Name data entry field, type

    fast transfer .

  4. Click the (Add 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.

  5. 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
  6. Click OK to dismiss the Transfer Step Editor Dialog.

    This returns you to the Transfer Path Editor Dialog.

  7. Click OK to dismiss the Transfer Path Editor Dialog.

    This returns you to the scheme diagram.

  8. 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.

  1. Click the Reaction Conditions tab.
  2. Select

    Volume is constant

    for the top left list box.

  3. Leave the bottom left list box in the

    Pressure is constant

    state; variable pressure is not allowed for this type of scheme.

  4. Select

    Temperature is constant

    for the top right list box.

  5. Leave the middle right list box in the

    Voltage is off

    state.

  6. Select

    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.

  7. In the Temperature data entry field, leave the value at its default value:

    298.15.

    There are no temperature-dependent rates in the reaction scheme so this value has no effect.

  8. In the Maximum Step Size data entry field, type

    1.0.

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.

To define an external stimulus profile that implements this:
  1. With the left mouse button, click the Change Profile... push button.

    A Profile Editor Dialog appears.

  2. On the dialog, click the click the (Add a profile) push button on the dialog's tool bar.
  3. A message box appears requesting a unique identifying name for the profile. Type

    profile 1

    into the entry field and click OK.

    A default profile is created and displayed on the data table and the graph.

  4. 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:

  5. Click OK.

    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.

To enter the simulation settings:
  1. Select the Simulation Settings tab.
  2. Set the data entry field for the Total Number of Particles to

    1000000.

    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 ).

  3. Set the data entry field for the Record State at Intervals of to

    750.

  4. Set the data entry field for the Random Number Seed to

    12947.

    The next group of parameters control the limits of the simulation.

  5. Set the data entry field for the Maximum Number of Events to a value of

    0 events.

    Setting this parameter to zero disables it.

  6. Set the data entry field for the Maximum time in Simulation to

    0.0 seconds.

    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.

  7. 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.

To start the simulation:

  1. Click the Scheme tab.
  2. 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:

  3. Click the OK push 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.

To view the simulation results for this compartment:
  1. Click the Scheme tab on the scheme window
  2. Select the central compartment with a single click of the left mouse button
  3. Click the (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.

To modify the graph:

  1. Click the right mouse button when the cursor is over the graph.

    The context menu appears.

  2. select the Modify... action form the context menu.
  3. 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.

Next Steps

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.