1. A method of optimizing operation efficiency of a motor drive or generator, comprising: measuring data corresponding to input power and output power of a motor drive or generator at a control parameter and different load values; generating a three-dimensional surface model based on the measured data, the three-dimensional surface model estimating an efficiency of the motor drive or generator at the control parameter and at unmeasured load values; determining optimal efficiency of the motor drive or generator for the different load values and the unmeasured load values based on the three-dimensional surface model; and adjusting operation of the motor drive or generator in real-time to perform at setpoint configurations in response to load values based on the three-dimensional surface model.