Objective Formulation

You got the error because you didn’t follow CVX’s rules.

See the post by @Michal_Adamaszek in Interpolation error for how to handle exp(x)*x .