Optimization and control of the freeze-drying process of pharmaceutical products