Skip to content

Preventing Negative Values in Simulation Results when using individual parameters as inputs #1176

Answered by kylebaron
XuefenYin asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @XuefenYin -

Please see the output below. Those negative numbers are happening after essentially all the mass has left the system. The ode solver can only give so much precision in that case and those numbers are just error around zero.

A couple of things you can try

  1. Make atol smaller (like 1e-10 or 1e-20 or something like that; that will give you additional precision around those numbers and they might stay small and positive; this didn't work for me to get rid of all the negative values
  2. You can stop the simulation earlier
  3. You can just set those numbers to zero after the simulation has ended

You can read more about this on this wkii page: https://github.com/metrumresearchgroup/mrgso…

Replies: 4 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

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

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

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
Converted from issue

This discussion was converted from issue #1174 on March 07, 2024 15:27.