Difference between revisions of "Simulator"

From ProcessDB
Jump to navigation Jump to search
Line 6: Line 6:
  
 
As an end user, mostly, you do not need to know about this simulator or think about it.  However, there are some reasons you may want to be familiar with how it works.  In particular, if the output is not as you expect then an understanding of what the simulator is doing may help you understand why the output is the way it is or, in some cases, change the input to the simulator so that the output is what you expect. Note in the latter case, this is not like optimizing model parameters and does not represent a problem in the simulator. Instead, there are inputs to the simulator that are critical to performing a correct numerical integration of a system of ordinary differential equations such as the tolerances of the system. Tolerances are domain specific (i.e., specific to your model) and an automatic selection of them is not always possible.
 
As an end user, mostly, you do not need to know about this simulator or think about it.  However, there are some reasons you may want to be familiar with how it works.  In particular, if the output is not as you expect then an understanding of what the simulator is doing may help you understand why the output is the way it is or, in some cases, change the input to the simulator so that the output is what you expect. Note in the latter case, this is not like optimizing model parameters and does not represent a problem in the simulator. Instead, there are inputs to the simulator that are critical to performing a correct numerical integration of a system of ordinary differential equations such as the tolerances of the system. Tolerances are domain specific (i.e., specific to your model) and an automatic selection of them is not always possible.
 +
 +
=Choosing Tolerances=
  
 
=Negative Numbers=
 
=Negative Numbers=
  
As stated in the [https://computation.llnl.gov/casc/sundials/support/faq.html#cvode_negvals CVODE FAQ], negative values may be present in a simulation for variables that cannot be negative in the physical world. This is normal as long as the magnitude of those values is comparable or less than the [[ProcessDB Reference Manual#Absolute Tolerance|absolute tolerance]].
+
As stated in the [https://computation.llnl.gov/casc/sundials/support/faq.html#cvode_negvals CVODE FAQ], negative values may be present in a simulation for variables that cannot be negative in the physical world. This is normal as long as the magnitude of those values is comparable or less than the [[ProcessDB Reference Manual#Absolute Tolerance|absolute tolerance]]. The numerical integrator (CVODE) cannot, due to the real world limitations on computing with real numbers and analytic algorithms, calculate the exact values of variables in your model. This may be a surprise or somewhat disconcerting, but be reassured that this problem has been researched for over half a century now and numerical analysts understand the problem well and have minimized its impact on simulations.  In fact, with stable numerical integrators the error in the simulations is guaranteed to be bound by some tolerance and you get to [[#Choosing Tolerances|choose the tolerance]]. When the simulator is doing its calculations, a number with magnitude less than the absolute tolerance is equivalent to zero. You can treat such numbers as zero and it is fair to report them as zero in publications. Future versions of ProcessDB may set these numbers to zero just before output for display or plotting while allowing internal use to maintain the small error in calculations for stability of the algorithms.

Revision as of 11:47, 29 October 2015

The ProcessDB simulator is custom designed for the types of models typically seen in biological modeling. This custom design includes necessary features for biological modeling, such as discrete events, and increases the speed of performing a simulation by up to sixteen times. Our simulator is composed of three parts:

  • CVODE - a public domain, robust, and fast stiff ODE solver;
  • interpreter - our custom code for evaluating mathematical expressions, conditionals, and functions;
  • simulator core - our custom code that integrates CVODE and the interpreter, manages control flow, processes biological events, and outputs data for plotting or other use.

As an end user, mostly, you do not need to know about this simulator or think about it. However, there are some reasons you may want to be familiar with how it works. In particular, if the output is not as you expect then an understanding of what the simulator is doing may help you understand why the output is the way it is or, in some cases, change the input to the simulator so that the output is what you expect. Note in the latter case, this is not like optimizing model parameters and does not represent a problem in the simulator. Instead, there are inputs to the simulator that are critical to performing a correct numerical integration of a system of ordinary differential equations such as the tolerances of the system. Tolerances are domain specific (i.e., specific to your model) and an automatic selection of them is not always possible.

Choosing Tolerances

Negative Numbers

As stated in the CVODE FAQ, negative values may be present in a simulation for variables that cannot be negative in the physical world. This is normal as long as the magnitude of those values is comparable or less than the absolute tolerance. The numerical integrator (CVODE) cannot, due to the real world limitations on computing with real numbers and analytic algorithms, calculate the exact values of variables in your model. This may be a surprise or somewhat disconcerting, but be reassured that this problem has been researched for over half a century now and numerical analysts understand the problem well and have minimized its impact on simulations. In fact, with stable numerical integrators the error in the simulations is guaranteed to be bound by some tolerance and you get to choose the tolerance. When the simulator is doing its calculations, a number with magnitude less than the absolute tolerance is equivalent to zero. You can treat such numbers as zero and it is fair to report them as zero in publications. Future versions of ProcessDB may set these numbers to zero just before output for display or plotting while allowing internal use to maintain the small error in calculations for stability of the algorithms.