Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Dev] Add optimisation solvers #304

Open
jbcaillau opened this issue Oct 6, 2024 · 1 comment
Open

[Dev] Add optimisation solvers #304

jbcaillau opened this issue Oct 6, 2024 · 1 comment
Assignees
Labels
internal dev Modification to the code is requested and should not affect user experiment

Comments

@jbcaillau
Copy link
Member

https://github.com/cvanaret/Uno
(still needs a Julia interface)

to be discussed with @cvanaret

@jbcaillau jbcaillau added the internal dev Modification to the code is requested and should not affect user experiment label Oct 6, 2024
@cvanaret
Copy link

Hi there,
Thanks to the patient guidance of Oscar Dowson and Alexis Montoison, Uno can now be installed in Julia via Uno_jll.jl and used via AmplNLWriter.jl:

julia> using AmplNLWriter, JuMP, Uno_jll

julia> model = Model(() -> AmplNLWriter.Optimizer(Uno_jll.amplexe));

julia> @variable(model, x);

julia> @variable(model, y);

julia> @objective(model, Min, (1 - x)^2 + 100 * (y - x^2)^2);

julia> optimize!(model)
Original model /var/folders/bg/dzq_hhvx1dxgy6gb5510pxj80000gn/T/jl_bVsNQH/model.nl
2 variables, 0 constraints
Reformulated model /var/folders/bg/dzq_hhvx1dxgy6gb5510pxj80000gn/T/jl_bVsNQH/model.nl_scaled_equalityconstrained_boundrelaxed
2 variables, 0 constraints

Used overwritten options:
- LS_backtracking_ratio = 0.5
- LS_min_step_length = 5e-7
- LS_scale_duals_with_step_length = yes
- armijo_decrease_fraction = 1e-8
- barrier_damping_factor = 1e-5
- barrier_tau_min = 0.99
- constraint_relaxation_strategy = feasibility_restoration
- filter_beta = 0.99999
- filter_fact = 1e4
- filter_gamma = 1e-8
- filter_type = standard
- filter_ubd = 1e4
- globalization_mechanism = LS
- globalization_strategy = waechter_filter_method
- l1_constraint_violation_coefficient = 1000.
- linear_solver = MUMPS
- loose_tolerance = 1e-6
- loose_tolerance_consecutive_iteration_threshold = 15
- progress_norm = L1
- protect_actual_reduction_against_roundoff = yes
- residual_norm = INF
- scale_functions = yes
- sparse_format = COO
- subproblem = primal_dual_interior_point
- switch_to_optimality_requires_linearized_feasibility = no
- switching_delta = 1
- tolerance = 1e-8

┌───────┬─────────┬────────────────┬─────────────┬───────┬────────────────┬──────────────┬─────────────┬──────────────┬─────────────────┬────────────────────────┐
│ iter  │ LS iter │ barrier param. │ step length │ phase │ regularization │ step norm    │ objective   │ stationarity │ complementarity │ status                 │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 0---           │ OPT   │ --120               │ initial point          │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 110.11           │ OPT   │ 01100--               │ rejected (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -2-0.5--0.56.5--               │ rejected (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -3-0.25--0.250.95312512.50               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 210.11           │ OPT   │ 00.09027780.4832061.011660               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 310.11           │ OPT   │ 00.4293893.46968--               │ rejected (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -2-0.5--0.2146950.4570889.52740               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 410.11           │ OPT   │ 00.09505420.1889420.4153530               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 510.021           │ OPT   │ 00.3492230.901785--               │ rejected (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -2-0.5--0.1746120.1391876.50510               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 610.021           │ OPT   │ 00.0928730.0549410.4510430               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 710.021           │ OPT   │ 00.2488020.0720927--               │ rejected (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ -2-0.5--0.1244010.02914462.266140               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 810.021           │ OPT   │ 00.110470.009858651.154670               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 910.021           │ OPT   │ 00.1000210.002323751.003730               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ iter  │ LS iter │ barrier param. │ step length │ phase │ regularization │ step norm    │ objective   │ stationarity │ complementarity │ status                 │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 1010.021           │ OPT   │ 00.05092670.0002379720.2189840               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 1110.021           │ OPT   │ 00.02532474.92674e-060.05951690               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 1210.002828431           │ OPT   │ 00.003196842.81895e-090.0008314550               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 1311.84491e-061           │ OPT   │ 09.78057e-058.88178e-168.67623e-070               │ accepted (f-type)      │
├───────┼─────────┼────────────────┼─────────────┼───────┼────────────────┼──────────────┼─────────────┼──────────────┼─────────────────┼────────────────────────┤
│ 1412.5059e-091           │ OPT   │ 04.65423e-0802.46136e-130               │ accepted (f-type)      │
└───────┴─────────┴────────────────┴─────────────┴───────┴────────────────┴──────────────┴─────────────┴──────────────┴─────────────────┴────────────────────────┘

Uno 1.1.0 (LS feasibility_restoration waechter_filter_method primal_dual_interior_point)
Mon Oct 28 19:21:41 2024
────────────────────────────────────────
Status:					Converged with feasible KKT point
Objective value:			0
Primal feasibility:			0
┌ Stationarity residual:		2.461364e-13
└ Complementarity residual:		0
┌ Feasibility stationarity residual:	2.461364e-13
└ Feasibility complementarity residual:	0
┌ Infeasibility measure:		0
│ Objective measure:			0
└ Auxiliary measure:			0
Primal solution:			1 1 
┌ Constraint multipliers:		
│ Lower bound multipliers:		0 0 
└ Upper bound multipliers:		0 0 
┌ Constraint feasibility multipliers:	
│ Lower bound feasibility multipliers:	0 0 
└ Upper bound feasibility multipliers:	0 0 
Objective multiplier:			1
CPU time:				0.00863s
Iterations:				14
Objective evaluations:			20
Constraints evaluations:		0
Objective gradient evaluations:		16
Jacobian evaluations:			0
Hessian evaluations:			14
Number of subproblems solved:		14

julia> solution_summary(model)
* Solver : AmplNLWriter

* Status
  Result count       : 1
  Termination status : LOCALLY_SOLVED
  Message from the solver:
  "Uno 1.1.0: Converged with feasible KKT point"

* Candidate solution (result #1)
  Primal status      : FEASIBLE_POINT
  Dual status        : NO_SOLUTION
  Objective value    : 4.43734e-29
  Dual objective value : 4.43734e-29

* Work counters
  Solve time (sec)   : 3.24550e-01

I'll be in touch when we have a proper Julia interface ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal dev Modification to the code is requested and should not affect user experiment
Projects
None yet
Development

No branches or pull requests

4 participants