Convex Optimization, Constrained Optimization, Lagrange Multiplier, Pangpuriyesuperai, Superaiengineer.
optimization problem. x = cp.Variable(n) prob = cp.Problem(cp.Minimize(c.T@x),[A@x <= b]) prob.solve() # Print result. print("\nThe optimal value is", prob.value) print("A solution x is") print(x.value) ก็จะได้ output ดึงนี้ The optimal value is -15.220912604467838 A solution x is [-1.10131657