Back

Partial Differential Equation (PDE) Based Spatial Pharmacometrics in NONMEM: Method of Lines (MOL) Implementation With AI-Assisted Model Development

LI, Y.; CHENG, Y.

2026-03-03 pharmacology and toxicology
10.64898/2026.03.01.708822 bioRxiv
Show abstract

Spatial heterogeneity in drug distribution, particularly within solid tumors, can compromise target engagement and drive therapeutic failure in oncology, yet it is rarely represented in population pharmacokinetic (PopPK) analyses. Standard empirical compartmental or semi-mechanistic models assume "well-stirred" tissues, and physiologically based pharmacokinetic (PBPK) models focus on organ-level distribution; neither framework directly captures intra-tumoral drug concentration gradients. Reaction-diffusion PDEs provide a mechanistic representation of penetration, spatial gradients, and washout, but routine implementation in NONMEM has been limited by operational complexity in the pharmacometrics field: native numerical templates (e.g., DOPDE/DOEXPAND-style expansions offered by NONMEM) remain cumbersome, and manual MOL coding quickly becomes labor-intensive and error-prone as geometry, initial and boundary conditions, and grid resolution change. With the emergence of advanced AI technologies, this operational barrier can be substantially reduced. This work presents a streamlined workflow for implementing spatial PDEs in NONMEM via AI tools. Using AI-assisted explicit code generation, we show how continuous spatial models can be systematically translated into coupled ordinary differential equation (ODE) systems that are directly executable in NONMEM, while keeping the resulting $DES block implementation transparent and reviewable. We illustrate the approach with one-dimensional, spherical, and two-dimensional rectangular reaction-diffusion models and provide practical guidance for iterative refinement across discretization and boundary-condition settings using appropriate prompt engineering with AI. Although AI does not reduce stiffness, remove numerical constraints, or resolve identifiability limitations, it reduces the engineering and maintenance burden of large MOL systems. When coupled with disciplined verification and appropriate scientific restraint, AI-assisted code generation can make PDE-based spatial pharmacometrics in NONMEM practical, transparent, and maintainable--supporting wider adoption of spatial modeling to interrogate target-site exposure and penetration-driven efficacy.

Published in The Journal of Clinical Pharmacology · not in our set (fewer than 10 published preprints to learn from) · training set

Matching journals

The top 4 journals account for 50% of the predicted probability mass.

50% of probability mass above

"Similar papers" are the closest papers from that journal in the model's embedding space. They show what the match is built on, but the ranking comes mostly from a classifier over the whole training set, not from these examples alone.