Models a drug (the API) in a topical product. Two modes share the API input and the level settings; switch between them with Gel and Emulsion at the top of the sidebar.
Gel: the API in a solvent vehicle (water, alcohols, glycols). An instant compatibility check, and MD of the vehicle showing how the drug moves and what surrounds it.
Emulsion: an oil phase with emulsifiers. Instant emulsifier design, the API’s partition between oil and water, and MD of the oil/water interface.
The API is given as SMILES, or as XYZ coordinates (with all hydrogens). An XYZ geometry is used for the force field and the single points, and a SMILES is worked out from it for the compatibility rules. If you give both, they must be the same molecule.
Gel¶
Enter the API with its w/w % (default 2 %) and add vehicle components with theirs; the total must be 100 %. Components: water, ethanol, isopropyl alcohol, propylene glycol, glycerol, PEG-400, Transcutol, benzyl alcohol and isopropyl myristate.
⚑ Check compatibility (instant) matches the API’s functional groups against the excipients’ known reactive impurities and the vehicle’s water and alcohols: peroxides (oxidation), formaldehyde and formic acid (N-methylation, N-formylation), aldehydes and ketones (imines), nitrite (nitrosamines), water (hydrolysis) and alcohols (esterification). Each flag has a reason and a risk class (high, medium, low), and where one exists, the stability analysis that quantifies it. The check computes nothing itself: it is a rule-based screen.
▶ Run gel MD builds and equilibrates a box of the vehicle with the API, and reports:
the density of the vehicle
the self-diffusion coefficient of every species, above all the API’s
the API’s first solvation shell: which components are in it, and how much more or less than their share of the box (preferential solvation)
the API’s hydrogen bonds, by partner and role
whether the water forms a percolating hydrogen-bond network
Gelling polymers (HPC, carbomer) are not in the box: at 1–5 % their network cannot be represented at this scale. The model is the gel’s solvent phase, where the drug sits and moves. Water is TIP3P.
| Setting | Default | Notes |
|---|---|---|
| T | 305.15 K | roughly skin-surface temperature |
| pH | blank | used by the compatibility check |
| MD preset | Fast | Fast: about 3000 atoms, 500 ps production. Standard: about 6000 atoms, 1 ns (glycerol-rich gels) |
Emulsion¶
Build the oil phase from the library (mineral oil, isopropyl myristate and palmitate, MCT, castor oil, oleic acid, cetyl and stearyl alcohol), in parts by weight, and choose the emulsifiers to consider (polysorbates, sorbitan esters, glyceryl monostearate, PEG-40 stearate, steareth-2 and -20, lecithin), or give your own as SMILES.
⚖ Emulsifier design + compatibility (instant) gives:
the required HLB of the oil phase, weight-averaged from tabulated oil-in-water values. Tables differ by 1–2 units: type your supplier’s value to override one
each emulsifier’s tabulated HLB next to an estimate from its structure (Griffin’s formulas, Davies’ group numbers as a fallback), so a custom emulsifier is judged on the same scale
pairs of a low- and a high-HLB emulsifier mixed to the required HLB, ranked
the compatibility check against the excipients’ impurities, as for gels
the HLD design — see below
HLD: hydrophilic–lipophilic deviation¶
HLB describes the emulsifier on its own. HLD describes the whole system — emulsifier, oil, salt and temperature — and says which side of phase inversion the formulation is on:
HLD = Cc + F(S) − k · EACN + cT · (T − 25 °C)
| Term | Meaning |
|---|---|
| Cc | the emulsifier’s characteristic curvature; negative = hydrophilic |
| EACN | the oil’s effective alkane carbon number |
| F(S) | salt: 0.13 × S for ethoxylated emulsifiers (S in g NaCl per 100 mL); none for sorbitan esters and glycerides |
| cT | 0.06 per °C for ethoxylated emulsifiers, which become more oil-loving as they warm; taken as zero for the others |
| k | 0.15–0.17 for ordinary emulsifiers; 0.16 by default |
Below zero favours oil-in-water, above zero water-in-oil. At zero the emulsion inverts: the interfacial tension is lowest there, which a microemulsion wants but which makes a conventional emulsion separate fastest. Within ±0.5 the card warns you that you are close.
Set the temperature, the salt in the water phase and a target HLD under HLD conditions (−1 by default, for oil-in-water). The card gives:
pairs of emulsifiers mixed to the target, by weight, each with the temperature at which it would invert. An oil-in-water blend that inverts within 20 °C of the use temperature is ranked down
Check ▸ on a blend: its HLD split into the Cc, oil, salt and temperature terms, and HLD plotted from 5 to 95 °C with the zero line, so you can see how much room it has
Use ▸ puts the blend into the interface MD, as for the HLB blends
Emulsifiers mix by mole fraction and oils by volume fraction (Acosta’s rule; by mass or by moles is measurably worse). Non-ideal mixing of emulsifiers is not modelled.
For one Tween 80 / Span 80 blend in isopropyl myristate, HLD and HLB agree: the target HLD of −1 gives 70 / 30 by weight, the required HLB of 11.5 gives 67 / 33. Where they part company is everything HLB leaves out — heat that blend and HLD says it inverts at about 64 °C.
Parameters. Only published values are filled in:
| Published value | Source | |
|---|---|---|
| Cc | Tween 20 −7.9, Tween 80 −3.7, Span 20 3.5, Span 80 3.1, lecithin 4 | S. Abbott, Practical Surfactants Cc list |
| EACN | n-hexadecane (the mineral-oil model) 16, isopropyl myristate 7.3, tricaprylin (the MCT model) 12.3 | Delforce et al., ACS Omega 2022 |
No published value was found for Tween 60, Span 60, glyceryl monostearate, PEG-40 stearate, steareth-2 or -20, nor for isopropyl palmitate, castor oil, oleic acid or the fatty alcohols. Those are left blank on purpose: an emulsifier without a Cc is left out of the blends, and an oil without an EACN stops the HLD part, until you enter a value in the card’s parameter table. Published values themselves disagree — isopropyl myristate is also quoted as 13 — and the Cc of a commercial ethoxylate depends on its distribution of chain lengths and on concentration. Your supplier’s or your own measured value is the better number when you have one.
⇄ Where does the API go? (minutes) computes log P from SMD solvation free energies at r²SCAN/def2-SVP in water, n-hexadecane (hydrocarbon oils) and 1-octanol (the polar limit), and log D at the pH under Conditions (7.4 if blank). Give measured acidic and basic pKa values if you have them; otherwise typical values for the ionisable groups found are used, good to 1–2 units. log D for another pH or other pKa values is recomputed instantly, without new quantum chemistry. It needs the neutral form (charge 0). There is no SMD parameter set for ester oils (IPM, MCT), so the two solvents give a bracket; the interface MD gives the oil-specific answer. With COSMO-RS (Premium) the card also shows COSMO-RS log P values beside the SMD ones; its octanol is water-saturated, which makes it more reliable for small polar molecules.
▶ Run interface MD simulates a periodic water slab | emulsifier film | oil slab | film, so two interfaces. The film’s area per molecule is set by the coverage, and the result is the tension at that coverage:
interfacial tension by the test-area method (Gloor et al., J. Chem. Phys. 2005, 123, 134703), with long-range Lennard-Jones by LJPME
density profiles across the interface for water, each oil, the emulsifier heads and tails and the API; the Gibbs dividing surfaces and the 10–90 interface width
where each API molecule spends its time: water, interface or oil
stability indicators: the Laplace pressure of a droplet, the creaming (Stokes) velocity, the film (Gibbs) elasticity from a second run at 10 % less area, and Ostwald ripening from each oil’s solubility in water. Changing the droplet radius or the continuous-phase viscosity restates these without new MD
With no emulsifier selected, the bare oil/water interface is simulated.
| Setting | Default | Notes |
|---|---|---|
| Emulsifier blend | up to two, with weight fractions | |
| Coverage | 1 | fraction of a full monolayer (0.05–1.5) |
| API copies | 2 | started half in the water, half in the oil |
| Box | Fast | Quick: 5 nm wide, 4 nm slabs, 1 ns. Fast: 7 nm, 5 nm slabs, 3 ns (GPU). Standard: 9 nm, 6 nm slabs, 10 ns (GPU) |
| Water model | TIP4P/2005 | surface tension about 69 mN/m. OPC is also good; TIP4P-Ew gives about 63 and TIP3P about 52 mN/m (tensions too low) |
| Droplet radius | 1 µm | for Laplace pressure, creaming and ripening time |
| η continuous | 0.89 mPa·s | viscosity of the water phase, for creaming |
| Film elasticity, Ostwald ripening | on | elasticity adds about half the production time |
| T | 305.15 K |
Solvation free energies (FEP)¶
Solvation free energies (under the emulsion buttons) computes where the API wants to be, from molecular dynamics with the same force fields, water model and emulsifier film as the interface MD. The API is switched off alchemically four times:
| Leg | What it gives |
|---|---|
| vacuum | the reference for the two solvation free energies |
| water | solvation free energy in water |
| oil | solvation free energy in the oil, and with water: log P (oil/water) |
| interface | adsorption free energy at the oil/water interface, relative to bulk water |
At the interface the API is held at the water’s dividing surface, ±0.8 nm — the same width the interface MD uses to count an API molecule as “at the interface”. A negative adsorption free energy means it prefers that layer to the same thickness of bulk water. The card also gives the adsorption length K: multiplied by the API’s bulk concentration, it is the amount at the interface per unit area.
Force field and water. The API is parameterised the way the Solvation module does it, because that combination was benchmarked against measured solvation free energies: GAFF with gas-phase RESP charges for a neutral API, and the module’s ion recipe for a singly charged one. The water is SPC/E by default for the same reason, whatever the interface MD above uses. The oil and the emulsifiers keep the force fields chosen under Force field. All legs share one water model, since the adsorption free energy is a difference between two of them.
A charged API gets the water leg only, in SPC/E, with the same surface-potential (Galvani) correction as the Solvation module. Moving an ion into oil or onto the interface needs corrections that are not calibrated, so those legs are refused; run them on the neutral form.
This is a different route from the SMD and COSMO-RS log P in Where does the API go?. Those use a continuum solvent; this uses your actual oil, with its force field, and it is the only one of the three that can say anything about the interface.
One oil for the oil leg: the oil box is a single liquid. With a blend, leave the oil leg out — the interface still uses the blend.
Quick look runs short windows to check that everything builds; its numbers carry a warning and should not be quoted. Standard is about 17 windows of 0.5 ns per leg — hours on a GPU. Use the GPU platform.
Every window runs in a process of its own, so the GPU memory leak in OpenMM does not build up over the run (see the binding FEP page).
The card warns when neighbouring windows overlap too little for the uncertainty to be trusted.
Phase diagram¶
The third mode, Phase diagram, draws three diagrams, chosen at the top of the tab. All three need the COSMO-RS add-on as well. A molecule that is not in the solvent list needs its COSMO surface computed once, a minute or two; it is cached after that.
Solvents: liquid–liquid — where two liquids stop mixing
API solubility: cosolvent curve — how much of your compound dissolves across a two-solvent blend
API solubility: ternary vehicle map — the same over three solvents at once
Solvents: liquid–liquid¶
The liquid–liquid equilibrium of a binary mixture over a temperature range.
Choose two components from the solvent list, or give either as a SMILES (neutral molecules only), and a temperature range.
COSMO-RS gives each component’s activity at every composition. Where the Gibbs energy of mixing is not convex the mixture splits, and the two coexisting liquids are the compositions at which both components have the same activity in both phases. The result:
the binodal curve — the composition of each liquid at each temperature, as mole or mass fraction, on a linear or logarithmic axis
the critical solution temperature, if the gap closes inside the range: an upper one (UCST) when the liquids mix on heating, a lower one (LCST) when they mix on cooling
the mutual solubilities near 25 °C, in % w/w
Accuracy¶
| Mixture | COSMO-RS | Measured |
|---|---|---|
| water in 1-octanol, 25 °C | x = 0.277 | x ≈ 0.27 |
| 1-octanol in water, 25 °C | x = 3.4·10⁻⁴ | x ≈ 7·10⁻⁵ |
| methanol / n-hexane, critical point | 293 K, x(methanol) = 0.49 | ≈ 307 K, ≈ 0.5 |
| water / ethanol | one liquid at all temperatures | one liquid |
Expect critical temperatures within 10–20 K, and the composition of a dilute phase within about half an order of magnitude to one order of magnitude. Mutual solubilities in the concentrated phase are much better. The COSMO-RS parameters were fitted to partition coefficients and hydration free energies, not to phase equilibria.
API solubility in a vehicle¶
The question behind most vehicle work: how much of this compound will dissolve, and in which blend? At saturation the dissolved API is in equilibrium with its own crystal,
COSMO-RS supplies at the composition the solution actually reaches, not at infinite dilution — a well-dissolved API changes its own surroundings. What COSMO-RS cannot supply is , the crystal’s activity relative to its own subcooled liquid. That is a property of the solid, and it has to come from you.
The crystal’s activity: give a measured solubility if you have one¶
| Route | What it needs | Quality |
|---|---|---|
| Measured solubility | one value, in any one of the solvents | best — see below |
| Melting point + ΔHfus | DSC | indicative |
| Melting point only | DSC | an estimate (Walden’s rule, ΔSfus = 56.5 J/mol/K) |
A single measured solubility does more than set the scale. It absorbs the polymorph — which melting-point data cannot describe — and the model’s own systematic bias for that molecule, both of which cancel when the ratio to other compositions is taken.
How much that matters, on aspirin at 25 °C (ΔHfus 25.6 kJ/mol, Tm 135 °C):
| Route | In water | In ethanol | Measured |
|---|---|---|---|
| Melting point + ΔHfus | 24 mg/g | 1080 mg/g | 3.3 and ≈250 mg/g |
| Anchored on the measured water value | 3.3 mg/g (by construction) | 219 mg/g | ≈250 mg/g |
The DSC route is about sevenfold high; anchored on one water measurement, ethanol comes out 12% low. Read the shape of the curve, not the absolute level, unless you anchored it.
Cosolvent curve¶
Give the API as SMILES, two solvents, and the temperature. The result is solubility across the blend, in mg per g of vehicle, % w/w, or mole fraction, on a log or linear axis. For aspirin in water/ethanol it climbs smoothly from 3.3 to 219 mg/g — the log-linear cosolvency every formulator knows, from first principles rather than fitted.
Ternary vehicle map¶
Three solvents at once, drawn as a triangle: each point is a vehicle, 100% of a solvent at its own corner, darker means more dissolves. The grid step is yours to set — 10% w/w gives 66 vehicles and takes a minute or two, 5% gives 231 and takes several.
Vehicles that would not exist¶
Every composition on both diagrams is tested for a liquid–liquid split of the vehicle itself, by a tangent-plane test on the same activity coefficients. A blend that would separate is marked — dashed red on the curve, a red ring on the map — because a solubility computed for a single liquid there describes a mixture nobody can make. Water/ethanol is miscible throughout and nothing is flagged; water/toluene is flagged everywhere except the pure ends.
Force fields¶
| Setting | Default | Notes |
|---|---|---|
| Force field | Refined where shipped, else GAFF | refined force fields (from Liquid properties, Fast preset) ship for ethanol, isopropyl alcohol, propylene glycol, glycerol and Transcutol; the alternative is GAFF for every component |
| Charges (GAFF components) | RESP, polarised | HF/6-31G* in CPCM (ε = 10). Also RESP in the gas phase, or D4 (instant, screening only) |
| Platform | OpenCL | CPU or CUDA |
Force fields built during a run are cached in formulation_ff_cache in your output
folder and reused.
Limitations¶
No polymer network in gels, as above.
Droplets are not simulated. The interface MD is a flat film; the stability numbers are estimates built on its tension.
log P for ester oils is a bracket, not a value.
Files¶
Each MD run writes to formulation_runs/<run id> in your output folder, including the
final structure and the trajectory as PDB.