Documentation

14.25 Worked closed-form example and validation plan

This chapter includes a reproducible oral one-compartment example generated from a Bateman concentration curve:

C(t) = 100 × 1.5/(1.5−0.1) × (exp(−0.1t) − exp(−1.5t))
dose = 500

The exact terminal rate is 0.1 h⁻¹, terminal half-life is ln(2)/0.1 = 6.931 h, and AUCinf is 100/0.1 = 1000 in the concentration-time units. Apparent clearance is therefore 500/1000 = 0.5 and apparent terminal volume is 0.5/0.1 = 5 in coherent dose/concentration units. The finite sample grid intentionally makes trapezoidal output slightly different from the continuous closed form; that difference demonstrates numerical approximation rather than an error.

Reproducibility note: the frozen JSON is the authoritative source for exact values. If a value in prose differs after regenerating the fixture, use the evidence file and update the prose before release.

The example data are in ncachapter14.nca and csvch14_oral.csv. Exact quantities are stored in jsonclosed_form_reference.json, while segment-rule comparisons are in csvtrapezoid_comparison.csv.

What nlmx produced

The frozen run created one profile and 26 output files. Its selected terminal estimate is approximately 0.0999 h⁻¹, with half-life 6.941 h, AUClast 987.1, observed-Clast AUCinf 995.9, predicted-Clast AUCinf 996.0, and less than 1% extrapolation. The close terminal-rate match shows that late samples identify the known slow exponential. Exposure differs from the ideal continuous model because the generated configuration and reference must be read together; the machine-readable evidence is the basis for acceptance.

Worked oral concentration-time profile

The complete htmlHTML report, csvprofile table, and csvterminal candidate table let a reviewer trace the result. The result directory includes PNG and SVG plots plus checksums.

A practical validation plan

Regenerate the fixture with tools/ch14_examples.py. Confirm file checksums or intentionally review changed hashes. Independently recompute each trapezoid, the regression slope, AUC tail, and derived parameter. Then run the identical data and conventions in the reference package. Compare unrounded CSV values with endpoint-specific tolerances and compare categorical decisions—selected points, flags, and missing values—exactly.

Extend the matrix with ascending, descending, equal, zero-endpoint, BLQ, duplicate-time, infusion, steady-state, and failure profiles. A release should fail if a categorical method choice changes unexpectedly, even when final rounded values remain close.

Common mistakes

  • Treating sampled trapezoidal area as identical to continuous exact area.
  • Copying the displayed values without regenerating the evidence.
  • Comparing only the final parameter table.
  • Accepting changed checksums without explaining the cause.

Checklist

  • Read the configuration, data, and exact reference together.
  • Reproduce intermediate areas and terminal candidates.
  • Compare unrounded outputs with declared tolerances.
  • Review figures, flags, omissions, and checksums.
  • Add boundary cases before making broader accuracy claims.

Further reading

Return to reference-software agreement, terminal selection, and AUC extrapolation.