Numerical methods for control optimization in linear systems