The result of program is giving very different solutions CVXpy

Hello:
Here is my optimization code:

        d=64
        x = cvxpy.Variable(d) 
        constraints = [M.T @ x >= 1]
        constraints += [x>=0]
        prob = cvxpy.Problem(cvxpy.Minimize(x @ v0),constraints ) #x@v11 v0
        print(prob)
        prob.solve()

    # Print result. c.T@x
    print("\nThe optimal value is", prob.value)
    print("A solution x is")
    print(x.value)
    print("A dual solution is")
    print(prob.constraints[0].dual_value)

M is a constant matrix and it is correct
v0 is changing
When I run the program, sometimes I am getting the correct answer which is approximately 0.42 but sometimes I am getting very weird result like 2.45673e-11. I know the result can be different but not that much
What can I do for that?

This is the CVX forum, and does not address CVXPY. I suggest you post at https://groups.google.com/g/cvxpy . When you post there, perhaps you’ll show the values of v0 you used, and the corresponding solutions, as well as all input data to make it a completely reproducible problem.

1 Like