I am trying to minimize the follow objective function: the problem is finding qs that minimizes Cg
So, i made a function in python to then minimize the function with