0

I would like to have CVXPY solve a maximization problem where objective function is a summation over [0,i]. However, I want the same solution for all x[0,i]

I tried the code as displayed here but solution to x are not the same.

x = Variable(10)
g= 0
for i in range(inflist[0],inflist[-1]+1):
    g+= "some function here"

prob = cp.Problem(Maximize(g))
prob.solve()

z= x.value
z

I can optimize over the summation but solution to x are not the same

Bryan Lwy
  • 45
  • 1
  • 6

0 Answers0