Solubility advantage of amorphous pharmaceuticals: I. A thermodynamic analysis