Skip to content

Turning off compartment if IPRED < 0 #603

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

You must be logged in to vote

In theory this should work. However, this comparison will not happen when A exactly turns zero. If A is negative it will stay negative for the duration with something like this.

You could also use the stateTrim solving option to handle situations like this.

Here is the rxSolve option:

stateTrim: When amounts/concentrations in one of the states are above
          this value, trim them to be this value. By default Inf.  Also
          trims to -stateTrim for large negative
          amounts/concentrations.  If you want to trim between a range
          say ‘c(0, 2000000)’ you may specify 2 values with a lower and
          upper range to make sure all state values are in the
          reas…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@JonKnights
Comment options

Answer selected by JonKnights
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