PHAR 7632 Homework #6 1999

Numerical Integration, Optimization, One Compartment IV Bolus Urine Data, and another Laplace Transform

DUE 27th April 1999

Question 1. Use the three .BAT files Ch9904NI0.BAT (Runge-Kutta), Ch9904NI2.BAT (RKF45), and Ch9904NI4.BAT (Gear) (Macintosh versions) or Ch9904PC0.BAT (Runge-Kutta), Ch9904PC2.BAT (RKF45), and Ch9904PC4.BAT (Gear) (Windows versions) with Boomer to explore the effect of changing the value of ka on the time it takes to simulate a model using three different numerical integration methods.

If you use the links below make sure you save the page as TEXT with the .BAT extension.

For each numerical method simulate answers using ka equal to 1, 10, 100, or 1000 hr-1. Keep all the other parameters the same. You wil need to edit the .BAT file to change the ka value. Use a text editor if possible. Record your results, either a time for simulation or no answer/error result in tabular form. A slower machine is probably more instructive. Use the same machine for all your runs.

As an answer turn in your table of results and three (only) printouts, one from each numerical integration method.

Answers

Timing (seconds from Virtual PC on a Macintosh 9600/200)
  NI = 0 NI = 2 NI = 4
ka = 1.0 2.97 0.50 0.60
ka = 10 45.0 0.77 0.66
ka = 100 * 3.68(*) 1.05
ka = 1000 * 43.1(*) 0.83
* Error(s)

Timings below were using the Macintosh version on a Mac 9600/200 (same machine - different operating systems :-)

Runge Kutta

 ** FINAL OUTPUT FROM Boomer (v2.7.8) **      27-Apr-1999 ---  3:44:19 pm

 Title:  Test for stiff systems                                      
 Input: From Ch9904NI0.BAT                                                   
 Output:  To Ch9904NI.OUT                                                    
 Data for [Drug] came from keyboard (or ?.BAT)                                             
 Fitting algorithm: Simulation                 
 Numerical integration method: 0) Classical 4th Order RK                  
          with  9 de(s)
 With relative error   0.1000E-01
 This simulation took     0.9961E-01 seconds

 Model and Parameter Definition

  #  Name                    Value       Type From To     Dep  Start Stop

  1) Dose                =   500.0        1    0    2       0    0    0
  2) ka                  =   1.000        2    2    1       0    0    0
  3) k12                 =  0.5000        2    1    3       0    0    0
  4) k21                 =  0.5000        2    3    1       0    0    0
  5) k12                 =  0.2500        2    1    4       0    0    0
  6) k21                 =  0.2500        2    4    1       0    0    0
  7) k12                 =  0.7500        2    1    5       0    0    0
  8) k21                 =  0.7500        2    5    1       0    0    0
  9) k12                 =  0.2500        2    1    6       0    0    0
 10) k21                 =  0.2500        2    6    1       0    0    0
 11) k12                 =  0.7500        2    1    7       0    0    0
 12) k21                 =  0.7500        2    7    1       0    0    0
 13) k12                 =  0.2500        2    1    8       0    0    0
 14) k21                 =  0.2500        2    8    1       0    0    0
 15) k12                 =  0.7500        2    1    9       0    0    0
 16) k21                 =  0.7500        2    9    1       0    0    0
 17) k10                 =  0.1000        2    1    0       0    0    0
 18) V                   =   10.00       18    1    1       0    0    0

 Data for [Drug]          :-

 DATA #   Time       Calculated     Observed      (Weight)   Weighted residual

     1   0.0000      0.000000      0.000000      0.000000      0.000000    
     2   0.2500       7.32017      0.000000      0.000000     -0.000000    
     3   0.5000       9.27166      0.000000      0.000000     -0.000000    
     4   0.7500       9.46280      0.000000      0.000000     -0.000000    
     5    1.000       9.13082      0.000000      0.000000     -0.000000    
     6    1.500       8.26741      0.000000      0.000000     -0.000000    
     7    2.000       7.58633      0.000000      0.000000     -0.000000    
     8    3.000       6.75135      0.000000      0.000000     -0.000000    
     9    4.000       6.29520      0.000000      0.000000     -0.000000    
    10    6.000       5.81686      0.000000      0.000000     -0.000000    
    11    9.000       5.44600      0.000000      0.000000     -0.000000    
    12    12.00       5.19865      0.000000      0.000000     -0.000000    
    13    18.00       4.80872      0.000000      0.000000     -0.000000    
    14    24.00       4.46732      0.000000      0.000000     -0.000000    
Plots of observed (*) and calculated values (+)
           versus time for [Drug]         . Superimposed points (X)

    9.463      Linear                      9.463      Semi-log
 | +                                     | +                                   
 |+                                      |+                                    
 | +                                     | +                                   
 |                                       |                                     
 |  +                                    |                                     
 |                                       |                                     
 |   +                                   |  +                                  
 |+                                      |                                     
 |                                       |                                     
 |    +                                  |   +                                 
 |                                       |                                     
 |      +                                |+                                    
 |         +                             |                                     
 |             +                         |                                     
 |                  +                    |    +                                
 |                           +           |                                     
 |                                    +  |                                     
 |                                       |      +                              
 |                                       |                                     
 |                                       |                                     
 |                                       |         +                           
 |                                       |                                     
 |                                       |                                     
 |                                       |             +                       
 |                                       |                  +                  
 |                                       |                                     
 |                                       |                                     
 |                                       |                                     
 |                                       |                           +         
 |                                       |                                     
 |X**** *  *   *    *        *        *  |                                    +
 |_____________________________________  |X****_*__*___*____*________*________*
   0.0000                                  4.467    
 0              <-->             24.     0              <-->             24.    

RKF45 Method

 ** FINAL OUTPUT FROM Boomer (v2.7.8) **      27-Apr-1999 ---  3:46:23 pm

 Title:  Test for stiff systems                                      
 Input: From Ch9904NI2.BAT                                                   
 Output:  To Ch9904NI.OUT                                                    
 Data for [Drug] came from keyboard (or ?.BAT)                                             
 Fitting algorithm: Simulation                 
 Numerical integration method: 2) Fehlberg RKF45                          
          with  9 de(s)
 With relative error   0.1000E-01
 With absolute error   0.1000E-01
 This simulation took     0.1758E-01 seconds

 Model and Parameter Definition

  #  Name                    Value       Type From To     Dep  Start Stop

  1) Dose                =   500.0        1    0    2       0    0    0
  2) ka                  =   1.000        2    2    1       0    0    0
  3) k12                 =  0.5000        2    1    3       0    0    0
  4) k21                 =  0.5000        2    3    1       0    0    0
  5) k12                 =  0.2500        2    1    4       0    0    0
  6) k21                 =  0.2500        2    4    1       0    0    0
  7) k12                 =  0.7500        2    1    5       0    0    0
  8) k21                 =  0.7500        2    5    1       0    0    0
  9) k12                 =  0.2500        2    1    6       0    0    0
 10) k21                 =  0.2500        2    6    1       0    0    0
 11) k12                 =  0.7500        2    1    7       0    0    0
 12) k21                 =  0.7500        2    7    1       0    0    0
 13) k12                 =  0.2500        2    1    8       0    0    0
 14) k21                 =  0.2500        2    8    1       0    0    0
 15) k12                 =  0.7500        2    1    9       0    0    0
 16) k21                 =  0.7500        2    9    1       0    0    0
 17) k10                 =  0.1000        2    1    0       0    0    0
 18) V                   =   10.00       18    1    1       0    0    0

 Data for [Drug]          :-

 DATA #   Time       Calculated     Observed      (Weight)   Weighted residual

     1   0.0000      0.000000      0.000000      0.000000      0.000000    
     2   0.2500       7.32047      0.000000      0.000000     -0.000000    
     3   0.5000       9.27186      0.000000      0.000000     -0.000000    
     4   0.7500       9.46447      0.000000      0.000000     -0.000000    
     5    1.000       9.13196      0.000000      0.000000     -0.000000    
     6    1.500       8.27741      0.000000      0.000000     -0.000000    
     7    2.000       7.58824      0.000000      0.000000     -0.000000    
     8    3.000       6.75298      0.000000      0.000000     -0.000000    
     9    4.000       6.29060      0.000000      0.000000     -0.000000    
    10    6.000       5.79946      0.000000      0.000000     -0.000000    
    11    9.000       5.44576      0.000000      0.000000     -0.000000    
    12    12.00       5.19719      0.000000      0.000000     -0.000000    
    13    18.00       4.80875      0.000000      0.000000     -0.000000    
    14    24.00       4.46734      0.000000      0.000000     -0.000000    
Plots of observed (*) and calculated values (+)
           versus time for [Drug]         . Superimposed points (X)

    9.464      Linear                      9.464      Semi-log
 | +                                     | +                                   
 |+                                      |+                                    
 | +                                     | +                                   
 |                                       |                                     
 |  +                                    |                                     
 |                                       |                                     
 |   +                                   |  +                                  
 |+                                      |                                     
 |                                       |                                     
 |    +                                  |   +                                 
 |                                       |                                     
 |      +                                |+                                    
 |         +                             |                                     
 |             +                         |                                     
 |                  +                    |    +                                
 |                           +           |                                     
 |                                    +  |                                     
 |                                       |      +                              
 |                                       |                                     
 |                                       |                                     
 |                                       |         +                           
 |                                       |                                     
 |                                       |                                     
 |                                       |             +                       
 |                                       |                  +                  
 |                                       |                                     
 |                                       |                                     
 |                                       |                                     
 |                                       |                           +         
 |                                       |                                     
 |X**** *  *   *    *        *        *  |                                    +
 |_____________________________________  |X****_*__*___*____*________*________*
   0.0000                                  4.467    
 0              <-->             24.     0              <-->             24.    

Gear's Method

 ** FINAL OUTPUT FROM Boomer (v2.7.8) **      27-Apr-1999 ---  3:47:31 pm

 Title:  Test for stiff systems                                      
 Input: From Ch9904NI4.BAT                                                   
 Output:  To Ch9904NI.OUT                                                    
 Data for [Drug] came from keyboard (or ?.BAT)                                             
 Fitting algorithm: Simulation                 
 Numerical integration method: 4) Gears method with PEDERV                
          with  9 de(s)
 With absolute error   0.1000E-01
 This simulation took     0.0000     seconds

 Model and Parameter Definition

  #  Name                    Value       Type From To     Dep  Start Stop

  1) Dose                =   500.0        1    0    2       0    0    0
  2) ka                  =   1.000        2    2    1       0    0    0
  3) k12                 =  0.5000        2    1    3       0    0    0
  4) k21                 =  0.5000        2    3    1       0    0    0
  5) k12                 =  0.2500        2    1    4       0    0    0
  6) k21                 =  0.2500        2    4    1       0    0    0
  7) k12                 =  0.7500        2    1    5       0    0    0
  8) k21                 =  0.7500        2    5    1       0    0    0
  9) k12                 =  0.2500        2    1    6       0    0    0
 10) k21                 =  0.2500        2    6    1       0    0    0
 11) k12                 =  0.7500        2    1    7       0    0    0
 12) k21                 =  0.7500        2    7    1       0    0    0
 13) k12                 =  0.2500        2    1    8       0    0    0
 14) k21                 =  0.2500        2    8    1       0    0    0
 15) k12                 =  0.7500        2    1    9       0    0    0
 16) k21                 =  0.7500        2    9    1       0    0    0
 17) k10                 =  0.1000        2    1    0       0    0    0
 18) V                   =   10.00       18    1    1       0    0    0

 Data for [Drug]          :-

 DATA #   Time       Calculated     Observed      (Weight)   Weighted residual

     1   0.0000      0.000000      0.000000      0.000000      0.000000    
     2   0.2500       7.32041      0.000000      0.000000     -0.000000    
     3   0.5000       9.27237      0.000000      0.000000     -0.000000    
     4   0.7500       9.46444      0.000000      0.000000     -0.000000    
     5    1.000       9.13245      0.000000      0.000000     -0.000000    
     6    1.500       8.26871      0.000000      0.000000     -0.000000    
     7    2.000       7.58740      0.000000      0.000000     -0.000000    
     8    3.000       6.75166      0.000000      0.000000     -0.000000    
     9    4.000       6.29455      0.000000      0.000000     -0.000000    
    10    6.000       5.81646      0.000000      0.000000     -0.000000    
    11    9.000       5.44578      0.000000      0.000000     -0.000000    
    12    12.00       5.19825      0.000000      0.000000     -0.000000    
    13    18.00       4.80853      0.000000      0.000000     -0.000000    
    14    24.00       4.46723      0.000000      0.000000     -0.000000    
Plots of observed (*) and calculated values (+)
           versus time for [Drug]         . Superimposed points (X)

    9.464      Linear                      9.464      Semi-log
 | +                                     | +                                   
 |+                                      |+                                    
 | +                                     | +                                   
 |                                       |                                     
 |  +                                    |                                     
 |                                       |                                     
 |   +                                   |  +                                  
 |+                                      |                                     
 |                                       |                                     
 |    +                                  |   +                                 
 |                                       |                                     
 |      +                                |+                                    
 |         +                             |                                     
 |             +                         |                                     
 |                  +                    |    +                                
 |                           +           |                                     
 |                                    +  |                                     
 |                                       |      +                              
 |                                       |                                     
 |                                       |                                     
 |                                       |         +                           
 |                                       |                                     
 |                                       |                                     
 |                                       |             +                       
 |                                       |                  +                  
 |                                       |                                     
 |                                       |                                     
 |                                       |                                     
 |                                       |                           +         
 |                                       |                                     
 |X**** *  *   *    *        *        *  |                                    +
 |_____________________________________  |X****_*__*___*____*________*________*
   0.0000                                  4.467    
 0              <-->             24.     0              <-->             24.