Skip to content

How to set time-varying variable in the model block? #700

Answered by mattfidler
OmarAshkar asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @OmarAshkar

I'm unsure what you are trying to model, but the model output is correct as written. You can use plot(x, Ts) to focus on the Ts endpoint. You can select whatever item you wish to plot in the output this way. The D1 and D2 are both plotted because they are output in the solve.

To show the change I have focused on time 0-48 and only shown the Ts endpoint as follows:

library(rxode2)
#> Warning: package 'rxode2' was built under R version 4.3.3
#> rxode2 2.1.3 using 4 threads (see ?getRxThreads)
#>   no cache: create with `rxCreateCache()`
mod <- function(){

  ini({
    Ts_init = 5500
    TR1_init = 0
    k_g1 = 0.03
    k_s1 = 0.1
    k_M1 = 0.05
    k_M2 = 0.03
  })

  model(…

Replies: 2 comments

Comment options

You must be logged in to vote
0 replies
Answer selected by OmarAshkar
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants