This function is currently not exported, so be sure to call it with mrgsolve:::code(...).

code(x)

Arguments

x

an mrgsolve model object

Value

A character vector of model code.

Examples

mod <- mrgsolve::house()
mrgsolve:::code(mod)
#>  [1] "$PROB "                                                                 
#>  [2] ""                                                                       
#>  [3] "# `mrgsolve` housemodel"                                                
#>  [4] ""                                                                       
#>  [5] "This model is compiled with `mrgsolve`."                                
#>  [6] ""                                                                       
#>  [7] "  - Author: Metrum Research Group, LLC"                                 
#>  [8] "  - Description: Generic indirect response PK/PD model"                 
#>  [9] "  - Covariates: Weight, female sex"                                     
#> [10] "  - Random effects: CL, VC, KA, KOUT"                                   
#> [11] "  - Error model: exponential"                                           
#> [12] ""                                                                       
#> [13] ""                                                                       
#> [14] ""                                                                       
#> [15] "$PLUGIN base"                                                           
#> [16] ""                                                                       
#> [17] "$PARAM @annotated"                                                      
#> [18] "CL   : 1    : Clearance  (L/hr)"                                        
#> [19] "VC   : 20   : Volume of distribution (L)"                               
#> [20] "KA   : 1.2  : Absorption rate constant (1/hr)"                          
#> [21] "F1   : 1.0  : Bioavailability fraction (.)"                             
#> [22] "D1   : 2.0  : Infusion duration (hr)"                                   
#> [23] "WT   : 70   : Weight (kg)"                                              
#> [24] "SEX  : 0    : Covariate female sex"                                     
#> [25] "WTCL : 0.75 : Exponent WT on CL"                                        
#> [26] "WTVC : 1.00 : Exponent WT on VC"                                        
#> [27] "SEXCL: 0.7  : Prop cov effect on CL"                                    
#> [28] "SEXVC: 0.85 : Prop cov effect on VC"                                    
#> [29] "KIN  : 100  : Resp prod rate constant (1/hr)"                           
#> [30] "KOUT : 2    : Resp elim rate constant (1/hr)"                           
#> [31] "IC50 : 10   : Conc giving 50% max resp (ng/ml)"                         
#> [32] ""                                                                       
#> [33] "$CMT @annotated"                                                        
#> [34] "GUT  : Dosing compartment (mg)"                                         
#> [35] "CENT : Central compartment (mg)"                                        
#> [36] "RESP : Response (unitless)"                                             
#> [37] ""                                                                       
#> [38] "$OMEGA @labels ECL EVC EKA EKOUT"                                       
#> [39] "0 0 0 0"                                                                
#> [40] ""                                                                       
#> [41] "$SIGMA @labels EXPO"                                                    
#> [42] "0"                                                                      
#> [43] ""                                                                       
#> [44] "$SET end=120, delta=0.25"                                               
#> [45] ""                                                                       
#> [46] ""                                                                       
#> [47] "$GLOBAL"                                                                
#> [48] "#define CP (CENT/VCi)"                                                  
#> [49] "#define INH (CP/(IC50+CP))"                                             
#> [50] ""                                                                       
#> [51] "typedef double localdouble;"                                            
#> [52] ""                                                                       
#> [53] "$MAIN"                                                                  
#> [54] "F_GUT = F1;"                                                            
#> [55] "D_CENT = D1;"                                                           
#> [56] ""                                                                       
#> [57] "double CLi   = exp(log(CL)   + WTCL*log(WT/70) + log(SEXCL)*SEX + ECL);"
#> [58] "double VCi   = exp(log(VC)   + WTVC*log(WT/70) + log(SEXVC)*SEX + EVC);"
#> [59] "double KAi   = exp(log(KA)   + EKA);"                                   
#> [60] "double KOUTi = exp(log(KOUT) + EKOUT);"                                 
#> [61] ""                                                                       
#> [62] "RESP_0 = KIN/KOUTi;"                                                    
#> [63] ""                                                                       
#> [64] "$ODE"                                                                   
#> [65] "dxdt_GUT = -KAi*GUT;"                                                   
#> [66] "dxdt_CENT = KAi*GUT - (CLi/VCi)*CENT;"                                  
#> [67] "dxdt_RESP = KIN*(1-INH) - KOUTi*RESP;"                                  
#> [68] ""                                                                       
#> [69] "$TABLE"                                                                 
#> [70] "double DV = CP*exp(EXPO);"                                              
#> [71] ""                                                                       
#> [72] "$CAPTURE @annotated"                                                    
#> [73] "DV: Dependent variable (ng/ml)"                                         
#> [74] "CP: Plasma concentration (ng/ml)"                                       
#> [75] ""