New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make sure the UI is uncompressed before checking for meta information #661
Comments
It seems that this is some sort of edge case because this works: library(rxode2)
#> rxode2 2.1.2 using 8 threads (see ?getRxThreads)
#> no cache: create with `rxCreateCache()`
nimo <- function() {
ini({
tcl <- -6.20447388279654
tv1 <- 0.191575008970249
tQ <- -5.87988849322313
tv2 <- 1.20088373795058
tkss <- 2.05936091989241
tkint <- -1.57948966650851
tksyn <- 0.830859686356613
tkdeg <- 2.38731427957655
add.err <- c(0, 0.686603620607056)
eta.cl ~ 0.91005447260584
eta.v1 ~ 0.173555359121338
eta.kss ~ 0.0114928866324284
})
model({
cl <- exp(tcl + eta.cl)
v1 <- exp(tv1 + eta.v1)
Q <- exp(tQ)
v2 <- exp(tv2)
kss <- exp(tkss + eta.kss)
kint <- exp(tkint)
ksyn <- exp(tksyn)
kdeg <- exp(tkdeg)
k <- cl/v1
k12 <- Q/v1
k21 <- Q/v2
eff(0) <- ksyn/kdeg
conc = 0.5 * (central/v1 - eff - kss) + 0.5 * sqrt((central/v1 -
eff - kss)^2 + 4 * kss * central/v1)
d/dt(central) = -(k + k12) * conc * v1 + k21 * peripheral -
kint * eff * conc * v1/(kss + conc)
d/dt(peripheral) = k12 * conc * v1 - k21 * peripheral
d/dt(eff) = ksyn - kdeg * eff - (kint - kdeg) * conc *
eff/(kss + conc)
IPRED = log(conc)
IPRED ~ add(add.err)
})
}
nimo <- nimo()
# should have raw in it because it is compressed not really an environment
print(class(nimo))
#> [1] "rxUi" "raw"
nimo_sim <- rxSolve(nimo, nlmixr2data::nimoData)
print(nimo_sim)
#> ── Solved rxode2 object ──
#> ── Parameters ($params): ──
#> # A tibble: 12 × 13
#> id tcl tv1 tQ tv2 tkss tkint tksyn tkdeg add.err eta.cl eta.v1
#> <fct> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 -6.20 0.192 -5.88 1.20 2.06 -1.58 0.831 2.39 0.687 -0.975 0.166
#> 2 2 -6.20 0.192 -5.88 1.20 2.06 -1.58 0.831 2.39 0.687 -1.32 0.318
#> 3 3 -6.20 0.192 -5.88 1.20 2.06 -1.58 0.831 2.39 0.687 0.955 -0.448
#> 4 5 -6.20 0.192 -5.88 1.20 2.06 -1.58 0.831 2.39 0.687 0.0768 -0.127
#> 5 6 -6.20 0.192 -5.88 1.20 2.06 -1.58 0.831 2.39 0.687 0.00911 0.223
#> 6 7 -6.20 0.192 -5.88 1.20 2.06 -1.58 0.831 2.39 0.687 0.799 -0.135
#> 7 8 -6.20 0.192 -5.88 1.20 2.06 -1.58 0.831 2.39 0.687 -1.00 -0.168
#> 8 9 -6.20 0.192 -5.88 1.20 2.06 -1.58 0.831 2.39 0.687 0.256 -0.453
#> 9 10 -6.20 0.192 -5.88 1.20 2.06 -1.58 0.831 2.39 0.687 -0.160 -0.375
#> 10 11 -6.20 0.192 -5.88 1.20 2.06 -1.58 0.831 2.39 0.687 -0.300 -0.396
#> 11 12 -6.20 0.192 -5.88 1.20 2.06 -1.58 0.831 2.39 0.687 -0.364 -0.511
#> 12 13 -6.20 0.192 -5.88 1.20 2.06 -1.58 0.831 2.39 0.687 0.339 0.352
#> # ℹ 1 more variable: eta.kss <dbl>
#> ── Initial Conditions ($inits): ──
#> central peripheral eff
#> 0 0 0
#> ── First part of data (object): ──
#> # A tibble: 321 × 20
#> id time cl v1 Q v2 kss kint ksyn kdeg k
#> <int> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
#> 1 1 1.28 0.000762 1.43 0.00280 3.32 9.50 0.206 2.30 10.9 0.000533
#> 2 1 23.2 0.000762 1.43 0.00280 3.32 9.50 0.206 2.30 10.9 0.000533
#> 3 1 46.9 0.000762 1.43 0.00280 3.32 9.50 0.206 2.30 10.9 0.000533
#> 4 1 95.2 0.000762 1.43 0.00280 3.32 9.50 0.206 2.30 10.9 0.000533
#> 5 1 144. 0.000762 1.43 0.00280 3.32 9.50 0.206 2.30 10.9 0.000533
#> 6 1 167. 0.000762 1.43 0.00280 3.32 9.50 0.206 2.30 10.9 0.000533
#> # ℹ 315 more rows
#> # ℹ 9 more variables: k12 <dbl>, k21 <dbl>, conc <dbl>, IPRED <dbl>,
#> # ipredSim <dbl>, sim <dbl>, central <dbl>, peripheral <dbl>, eff <dbl> Created on 2024-03-07 with reprex v2.1.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Note I got the following:
Created on 2024-03-07 with reprex v2.1.0
Session info
Originally posted by @mattfidler in nlmixr2/nlmixr2#208 (reply in thread)
The text was updated successfully, but these errors were encountered: