Analytical, modelling, and experimental studies of the primary and secondary drying stages of the freeze-drying of pharmaceutical crystalline and amorphous solutes