Expand description
AUC / dense-grid helpers used by the cost function.
For the AUC targets, concentrations are simulated on a dense time grid and integrated with the trapezoidal rule:
AUC(t) = Σᵢ (C[i] + C[i-1]) / 2 × (t[i] - t[i-1])Functions§
- calculate_
auc_ at_ times - Calculate cumulative AUC at target times using the trapezoidal rule.
- calculate_
dense_ times - Generate a dense time grid for AUC calculations.
- calculate_
interval_ auc_ per_ observation - Calculate interval AUC for each observation independently.
- find_
last_ dose_ time_ before - Find the time of the last dose (bolus or infusion) before a given observation
time. Returns
0.0if no dose exists beforeobs_time.