The present invention provides a method and apparatus for generating refrigeration in a process operating at sub-ambient temperatures in which the refrigeration is generated by a turboexpander. The turboexpander is coupled to a generator controlled so that its speed is maintained at a setpoint through electromagnetic braking and its power output is maintained at line matching voltage and frequency. The speed control of the generator therefore, also controls the speed of the turboexpander. The setpoint is calculated to be equal to a product of an operational efficiency parameter, U/Co, and a square root of twice the enthalpy drop in the flow passing through the turboexpander divided by a product of pi and a diameter of an impeller employed within the turboexpander.