Selected work08 / 11

Lyophilization Mechanistic Model

First-principles ODE simulator for freeze-drying LNP/mRNA formulations. Nine coupled state variables across four process phases, with a batch driver that generates synthetic datasets for MSPC and ML pipelines.

Date
August 2025
Disciplines
Simulation, ODE Modeling, Biopharma, Python
Lyophilization mechanistic model architecture: Excel and YAML inputs, parsing and strict configuration, a phase schedule driving an ODE integration loop with the physics kernel, CQA prediction, and synthetic dataset outputsInputsExcel workbook, YAMLRecipeFormulationRunResultsconfig.yamlParsing and configurationstrict validationNo silent defaultsExcelParserRecipe, formulation, resultsPhaseManager4-phase schedule builderConfigLoaderStrict validationSimulation enginescipy.integrate.solve_ivpAdaptive BDF, stiff kineticsphase schedule, automatic transitionsFreezeAnnealPrimarySecondaryLNPFreezeDriverODE integration orchestratort, ydy/dtintegrationloopPhysics kernel9 coupled ODEsFirst-principles Arrhenius kineticsThermal and mass transferStandard freeze-drying physicsTpzPcXNRpLNP kineticsLeakage, RNA degradation, aggregationEERINDhkinetics.py: Arrhenius, WLF model, moisture couplingPost-processingCQA predictionPhase-attributed damageCQAPredictorRM%, EE%, RIN, Z50, PDIDamageTrackerPhase-attributed integralsOutputsML and MSPC readySynthetic datasetsCSV trajectories9-state time seriesExcel RunResultsCQA predictionsVisualizations6-panel overviewSummary statsCorrelation analysis

Context

Lyophilization is the process that stabilizes mRNA vaccines for storage and transport. Each experimental run occupies expensive equipment for hours, the parameter space is large, and failed runs destroy drug product. There is a clear need for synthetic data, both for process understanding and for training downstream ML models, without consuming bench time.

This project is a mechanistic simulator grounded in heat transfer, mass transfer, and LNP degradation kinetics. Developed at the University of Massachusetts Lowell Department of Chemical Engineering.

freezeannealprimary drysecondary drytimeTpzPcXNRpEERINDh
Illustration
01Nine state variables tracked through freeze, anneal, primary dry, secondary dry
TpPcfreezeannealprimary drysecondary dry
Illustration
02Automatic phase transition detection across four process phases

Model

The core is a 9-state ODE system: product temperature (Tp), ice front position (z), chamber pressure (Pc), residual moisture (X), potency (N), cake resistance (Rp), encapsulation efficiency (EE), RNA integrity (RIN), and particle size (Dh). The first six states follow standard freeze-drying physics. The last three capture LNP-specific dynamics:

  • Encapsulation efficiency: Arrhenius leakage kinetics modulated by moisture exposure, pH, and glass transition proximity
  • RNA integrity: Coupled thermal and hydrolytic degradation pathways with moisture dependence
  • Particle size: Aggregation driven by temperature history, encapsulation loss, and ionic environment

These are mechanistic relationships derived from the underlying chemistry, not empirical curve fits.

EEleakageRINdegradationDhaggregation
Illustration
01LNP-specific state evolution: EE leakage, RIN degradation, particle aggregation
freezeannealprimary drysecondary drysublimationdesorptionsuppressedactive
Illustration
02Phase-dependent physics: sublimation suppressed during freeze, desorption active in secondary dry

Specifications

ParameterValue
State vector[Tp, z, Pc, X, N, Rp, EE, RIN, Dh] — 9 coupled ODEs
SolverSciPy solve_ivp, BDF method, rtol = 1e-6
Process phasesFreeze, Anneal, Primary Dry, Secondary Dry (automatic transition detection)
LNP kineticsArrhenius leakage (E_leak = 15 kJ/mol), thermal + hydrolytic RNA degradation (E_deg = 15 kJ/mol), ionic-coupled aggregation
ConfigurationSingle config.yaml, strict runtime validation, no default substitution
Output formatsCSV, Parquet (MSPC and ML pipeline ready)
CQA predictionsResidual moisture, EE, RIN, particle size (Z50), PDI, reconstitution time, visual cake
Noise modelConfigurable sensor noise, vial-to-vial parameter jittering

Synthetic Data Generation

A batch driver wraps the ODE kernel with recipe parsing from Excel templates (matching the format labs already use), vial-to-vial parameter jittering, and configurable sensor noise. Output is structured CSV/Parquet, ready for MSPC or ML pipelines.

All parameters resolve from a single config.yaml. Missing parameters raise explicit errors at startup. This was a deliberate choice after earlier versions had inconsistent defaults across modules (e.g., E_leak defaulting to 40,000 J/mol in one file and 45,000 in another).

Tptimebatchesvials
Illustration
01Multi-batch synthetic dataset with realistic vial-to-vial variation
moistureEERINZ50y = xpredictedtarget
Illustration
02Predicted vs target quality attributes across batch runs

CQA Correlation Analysis

The system maps process-quality relationships across the full parameter space: EE loss vs thermal exposure, RIN degradation vs cumulative moisture damage, particle aggregation drivers (pH, ionic strength, lipid ratio), and per-phase contribution to final CQA outcomes.

EERINZ50thermal exposuremoisturepHionic strengthlipid ratiomodelled dependency
Illustration
01Process parameter to quality attribute correlation heatmap
freezeannealprimary drysecondary drymoistureEERINZ50PDIfinal value, attributed by phase
Illustration
02Per-phase contribution to final CQA values

Next project

AMBIC Data Platform

Full-stack web platform for biomanufacturing data: ingestion, normalization, visualization, and sharing across research teams. Handles life-critical data with provenance tracking and granular access control.

jsonxlsxcsvnormalizedcolumn mapping, source linked