Maximizing polynomial


#1

Hi, I want to maximize a simple function:

V=(140*h - 48*h*h + 4*h*h*h)
with h being 
h>=0
h<=5

But MATLAB is throwing following error:
Illegal operation: {log-affine} - {log-affine}

Here is a plot
http://www.wolframalpha.com/input/?i=(140h±+48hh+%2B+4hhh),+for+h%3E0,+h%3C5

Is there a way to solve it with CVX?

cvx_begin gp
    variables h
    maximize (140*h - 48*h*h + 4*h*h*h)
    subject to
     h>=0
     h<=5
cvx_end

(Mark L. Stone) #2

This is non-convex. Why isn't CVX accepting my model? READ THIS FIRST!