Full treatment, from model formulation to computational implementation, of optimization techniques that solve central problems in finance