File tree Expand file tree Collapse file tree 2 files changed +33
-0
lines changed
src/tutorials/Polynomial Optimization Expand file tree Collapse file tree 2 files changed +33
-0
lines changed Original file line number Diff line number Diff line change 11[deps ]
2+ Alpine = " 07493b3f-dabb-5b16-a503-4139292d7dd4"
23BenchmarkTools = " 6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
34CSDP = " 0a46da34-8e4b-519e-b418-48813639ff34"
45Clarabel = " 61c947e1-3e6d-4ee4-985a-eec8c727bd6e"
@@ -10,6 +11,7 @@ Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
1011Dualization = " 191a621a-6537-11e9-281d-650236a99e60"
1112DynamicPolynomials = " 7c1d4256-1411-5781-91ec-d7bc3513ac07"
1213GroupsCore = " d5909c97-4eac-4ecc-a3dc-fdd0858a4120"
14+ HiGHS = " 87dc4568-4c63-4d18-b0c0-bb2238e4078b"
1315HomotopyContinuation = " f213a82b-91d6-5c5d-acf7-10f1c761b327"
1416ImplicitPlots = " 55ecb840-b828-11e9-1645-43f4a9f9ace7"
1517Ipopt = " b6b21f68-93f8-5de0-b562-5493be1d77c9"
@@ -22,6 +24,7 @@ MultivariateBases = "be282fd4-ad43-11e9-1d11-8bd9d7e43378"
2224MultivariateMoments = " f4abf1af-0426-5881-a0da-e2f168889b5e"
2325MultivariatePolynomials = " 102ac46a-7ee4-5c85-9060-abc95bfdeaa3"
2426MutableArithmetics = " d8a4904e-b15c-11e9-3269-09a3773c0cb0"
27+ Pavito = " cd433a01-47d1-575d-afb7-6db927ee8d8f"
2528PermutationGroups = " 8bc5a954-2dfc-11e9-10e6-cd969bffa420"
2629Plots = " 91a5bcdd-55d7-5caf-9e0b-520d859cae80"
2730PolyJuMP = " ddf597a6-d67e-5340-b84c-e37d84115374"
Original file line number Diff line number Diff line change @@ -93,6 +93,36 @@ solution_summary(gmodel)
9393@test value (b) ≈ 0.5 rtol= 1e-5 # src
9494value (a), value (b)
9595
96+ # ## QCQP approach
97+
98+ import Alpine, HiGHS, Pavito
99+ ipopt = optimizer_with_attributes (
100+ Ipopt. Optimizer,
101+ MOI. Silent () => true ,
102+ # "sb" => "yes",
103+ # "max_iter" => 9999,
104+ )
105+ highs = optimizer_with_attributes (
106+ HiGHS. Optimizer,
107+ " presolve" => " on" ,
108+ " log_to_console" => false ,
109+ )
110+ pavito = optimizer_with_attributes (
111+ Pavito. Optimizer,
112+ MOI. Silent () => true ,
113+ " mip_solver" => highs,
114+ " cont_solver" => ipopt,
115+ " mip_solver_drives" => false ,
116+ )
117+ alpine = optimizer_with_attributes (
118+ Alpine. Optimizer,
119+ " nlp_solver" => ipopt,
120+ " mip_solver" => pavito,
121+ )
122+ set_optimizer (model, () -> PolyJuMP. QCQP. Optimizer (alpine))
123+ @NLobjective (model, Min, a^ 3 - a^ 2 + 2 a* b - b^ 2 + b^ 3 )
124+ optimize! (model)
125+
96126# ## Sum-of-Squares approach
97127
98128# We will now see how to find the optimal solution using Sum of Squares Programming.
You can’t perform that action at this time.
0 commit comments