A method of generating refrigeration in a process operating at sub-ambient temperatures, said method comprising: compressing a process stream utilized within the process to produce a compressed process stream; expanding the compressed process stream within a turboexpander having an impeller that is driven by the process stream with performance of work, thereby producing an exhaust stream; introducing the exhaust stream into the process to impart the refrigeration into the process; generating electrical power with a generator having a rotor coupled to the impeller so that the generator is driven by the work of expansion; characterized in that the turboexpander is designed to operate at an operational efficiency parameter equal to optimal value of U/C o; and said method further comprising controlling speed of the rotor of the generator and therefore, the turboexpander through electromagnetic braking of the rotor such that the speed is maintained at a setpoint and electrical current output of the generator increases as the speed of the rotor decreases and decreases as the speed of the rotor increases; controlling voltage and frequency of the electrical power generated by the generator as to be maintained at line matching levels and the electrical power generated by the generator may be introduced into a local electrical power grid at the line matching levels; and continually determining the setpoint of the speed of the rotor and therefore, the turboexpander by setting the setpoint equal to the product of the operational efficiency parameter and a square root of twice the difference between enthalpies of the compressed process stream upon entry into the turboexpander and the exhaust stream upon discharge from the turboexpander, divided by a product of pi and a diameter of the impeller. compressing a process stream utilized within the process to produce a compressed process stream; expanding the compressed process stream within a turboexpander having an impeller that is driven by the process stream with performance of work, thereby producing an exhaust stream; introducing the exhaust stream into the process to impart the refrigeration into the process; generating electrical power with a generator having a rotor coupled to the impeller so that the generator is driven by the work of expansion; controlling speed of the rotor of the generator and therefore, the turboexpander through electromagnetic braking of the rotor such that the speed is maintained at a setpoint and electrical current output of the generator increases as the speed of the rotor decreases and decreases as the speed of the rotor increases; controlling voltage and frequency of the electrical power generated by the generator as to be maintained at line matching levels and the electrical power generated by the generator may be introduced into a local electrical power grid at the line matching levels; and continually determining the setpoint of the speed of the rotor and therefore, the turboexpander by setting the setpoint equal to the product of the operational efficiency parameter and a square root of twice the difference between enthalpies of the compressed process stream upon entry into the turboexpander and the exhaust stream upon discharge from the turboexpander, divided by a product of pi and a diameter of the impeller.