You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Current behavior: bioavailability is set from whatever is in play at the time of a dose. This creates a problem when lag times are being used and the dose is actually given at a time when bioavailability has changed since the apparent administration.
In the example below, there is a lag time of 1 and both doses happen (apparently at time 0); so we should see 100 x 0.7 + 200 * 0.1 = 90 units in the dosing compartment at time 1. We don't see this because both doses see the 0.1 as the bioavailability.
library(mrgsolve)
#> #> Attaching package: 'mrgsolve'#> The following object is masked from 'package:stats':#> #> filtermod<- mread("1005", project= modlib())
#> Loading required namespace: xml2#> Building 1005 ... done.code<-'$PARAM CL = 1, V = 10, KA = 1$MAINALAG_A = 1;if(self.amt==100) F_A = 0.7; if(self.amt==200) F_A = 0.1;$PKMODEL cmt = "A,B", depot = TRUE'mod<- mcode("foo", code)
#> Building foo ... done.data<-data.frame(amt= c(100,200), evid=1, time=0, ID=1, cmt=1)
mrgsim(mod, data, recsort=3, end=1)
#> Model: foo #> Dim: 4 x 4 #> Time: 0 to 1 #> ID: 1 #> ID time A B#> 1: 1 0 0 0#> 2: 1 0 0 0#> 3: 1 0 0 0#> 4: 1 1 30 0
One solution is bioavailability gets stored in the record object early on and is always read from that specific record object rather than this global bioavailability floating around.
The text was updated successfully, but these errors were encountered:
Current behavior: bioavailability is set from whatever is in play at the time of a dose. This creates a problem when lag times are being used and the dose is actually given at a time when bioavailability has changed since the apparent administration.
In the example below, there is a lag time of 1 and both doses happen (apparently at time 0); so we should see
100 x 0.7 + 200 * 0.1 = 90
units in the dosing compartment at time 1. We don't see this because both doses see the 0.1 as the bioavailability.Created on 2023-11-13 with reprex v2.0.2
One solution is bioavailability gets stored in the record object early on and is always read from that specific record object rather than this global bioavailability floating around.
The text was updated successfully, but these errors were encountered: