code for generating optimal feedback law minimizing K cumulants