V function (learning to optimize when the model is available)