Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

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.

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:

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.

SettingDefaultNotes
T305.15 Kroughly skin-surface temperature
pHblankused by the compatibility check
MD presetFastFast: 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:

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)

TermMeaning
Ccthe emulsifier’s characteristic curvature; negative = hydrophilic
EACNthe 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
cT0.06 per °C for ethoxylated emulsifiers, which become more oil-loving as they warm; taken as zero for the others
k0.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:

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 valueSource
CcTween 20 −7.9, Tween 80 −3.7, Span 20 3.5, Span 80 3.1, lecithin 4S. Abbott, Practical Surfactants Cc list
EACNn-hexadecane (the mineral-oil model) 16, isopropyl myristate 7.3, tricaprylin (the MCT model) 12.3Delforce 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:

With no emulsifier selected, the bare oil/water interface is simulated.

SettingDefaultNotes
Emulsifier blendup to two, with weight fractions
Coverage1fraction of a full monolayer (0.05–1.5)
API copies2started half in the water, half in the oil
BoxFastQuick: 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 modelTIP4P/2005surface tension about 69 mN/m. OPC is also good; TIP4P-Ew gives about 63 and TIP3P about 52 mN/m (tensions too low)
Droplet radius1 µmfor Laplace pressure, creaming and ripening time
η continuous0.89 mPa·sviscosity of the water phase, for creaming
Film elasticity, Ostwald ripeningonelasticity adds about half the production time
T305.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:

LegWhat it gives
vacuumthe reference for the two solvation free energies
watersolvation free energy in water
oilsolvation free energy in the oil, and with water: log P (oil/water)
interfaceadsorption 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.

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

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:

Accuracy

MixtureCOSMO-RSMeasured
water in 1-octanol, 25 °Cx = 0.277x ≈ 0.27
1-octanol in water, 25 °Cx = 3.4·10⁻⁴x ≈ 7·10⁻⁵
methanol / n-hexane, critical point293 K, x(methanol) = 0.49≈ 307 K, ≈ 0.5
water / ethanolone liquid at all temperaturesone 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,

ln⁡xA+ln⁡γA(xA,vehicle,T)=ln⁡asolid(T)\ln x_A + \ln \gamma_A(x_A, \text{vehicle}, T) = \ln a_{\text{solid}}(T)

COSMO-RS supplies γA\gamma_A 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 asolida_{\text{solid}}, 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

RouteWhat it needsQuality
Measured solubilityone value, in any one of the solventsbest — see below
Melting point + ΔHfusDSCindicative
Melting point onlyDSCan 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):

RouteIn waterIn ethanolMeasured
Melting point + ΔHfus24 mg/g1080 mg/g3.3 and ≈250 mg/g
Anchored on the measured water value3.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

SettingDefaultNotes
Force fieldRefined where shipped, else GAFFrefined 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, polarisedHF/6-31G* in CPCM (ε = 10). Also RESP in the gas phase, or D4 (instant, screening only)
PlatformOpenCLCPU or CUDA

Force fields built during a run are cached in formulation_ff_cache in your output folder and reused.

Limitations

Files

Each MD run writes to formulation_runs/<run id> in your output folder, including the final structure and the trajectory as PDB.