Skip navigation
About Us Contact Us Software Support

Q: How do I handle data and change conditions or inputs that occur simultaneously? 

A: This is a situation that can occur whenever something in the model makes the quantity of material in a compartment discontinuous at a specific time point. Most commonly the discontinuity is caused by either a change condition or an exogenous input occurring at the same time data is being measured.

For example, suppose the single compartment model in Figure 1 has a bolus input at time 0, and at time 10.0, q1 = 40.0 just before a second bolus of magnitude 60.0 is administered.  The question is whether the measured data value at time 10.0 should 40.0 or 100.0. The safest way to handle this situation in the Compartmental application is make the time for the second bolus 10.0, and to make the measured data time either slightly before or slightly after 10.0 depending upon whether or not the measurement includes the bolus.

Figure 1

Unfortunately, users commonly make both occur at exactly the same time, so the application must make an assumption on how to handle simultaneous discontinuities and measurements.  To resolve the ambiguity, the Compartmental application assumes that any discontinuities occur prior to the data measurement.  In the preceding example, the application would compute q1 = 100.0 at time 10.0, and any data measured at time 10.0 must include the second bolus.

Using the same example, where q1 = 40.0 at time 10.0, suppose instead of a second bolus, the contents of q1 are emptied using a change condition to set q1 = 0.0 at time 10.0. Should a measurement of the contents of q1 at time 10.0 show that q1 = 40.0 or q1 = 0.0? As before, the application assumes that any discontinuities occur prior to the data measurement, so the measured value for q1 should be 0.0.

Internally, the Compartmental application handles this problem by maintaining two time values at every discontinuity. If the Values window were examined for the above example, it would show two time 10.0 entries. One would contain the computed value for q1 just before, and the other the computed value just after, the discontinuity. Numerically the two times appear to be 10.0, but internally the first is a value just slightly prior to 10.0, and the associated value for q1 would be prior to the bolus or change condition.  Any data measured at time 10.0 would appear at the second time 10.0 entry where any discontinuities have already occurred..

<< Back to Support Page