I have a question of understanding in Gurobi: I have an objective function in which my optimization variable x is squared. I have solved this bsiher by a quadratic objective function with $x$, $x$. Now, however, I need another optimization variable in this equation, so according to other posts here, I have set up a constraint that returns me the optimization variable $z = x^2$ and use this instead of $x, x$ in my objective function. Correspondingly, I also set the parameter for NonConvex to 2. What irritates me now is that I get different values for my objective function when using $x, x$ or $z$. Maybe someone can explain to me why this is the case or maybe I am doing something wrong.