Added scipy optimize function to calibrate.