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

First working version of LDSDA #27

Open
wants to merge 3,610 commits into
base: main_backup
Choose a base branch
from
Open

First working version of LDSDA #27

wants to merge 3,610 commits into from

Conversation

ZedongPeng
Copy link
Owner

@ZedongPeng ZedongPeng commented Feb 5, 2024

Fixes # .

Summary/Motivation:

Succeed with small batch example.

Log:

Starting GDPopt version 22.5.13 using LDSDA algorithm
iterlim: None
time_limit: None
tee: true
logger: <Logger pyomo.contrib.gdpopt (INFO)>
mip_solver: gurobi
mip_solver_args:
nlp_solver: ipopt
nlp_solver_args:
minlp_solver: gams
minlp_solver_args:
local_minlp_solver: bonmin
local_minlp_solver_args:
small_dual_tolerance: 1.0e-08
integer_tolerance: 1.0e-05
constraint_tolerance: 1.0e-06
variable_tolerance: 1.0e-08
subproblem_initialization_method: <function restore_vars_to_original_values at 0x1049b1ab0>
call_before_subproblem_solve: !!python/name:pyomo.contrib.gdpopt.util._DoNothing ''
call_after_subproblem_solve: !!python/name:pyomo.contrib.gdpopt.util._DoNothing ''
call_after_subproblem_feasible: !!python/name:pyomo.contrib.gdpopt.util._DoNothing ''
force_subproblem_nlp: false
subproblem_presolve: true
tighten_nlp_var_bounds: false
round_discrete_vars: true
max_fbbt_iterations: 3
bound_tolerance: 1.0e-06
direction_norm: L2
starting_point: [3, 3, 3]
logical_constraint_list: ['lim[mixer]', 'lim[reactor]', 'lim[centrifuge]']

If you use this software, you may cite the following:
            - Implementation:
            Chen, Q; Johnson, ES; Bernal, DE; Valentin, R; Kale, S;
            Bates, J; Siirola, JD; Grossmann, IE.
            Pyomo.GDP: an ecosystem for logic based modeling and optimization
            development.
            Optimization and Engineering, 2021.

- LDSDA algorithm:
        Bernal DE, Ovalle D, Liñán DA, Ricardez-Sandoval LA, Gómez JM, Grossmann IE.
        Process Superstructure Optimization through Discrete Steepest Descent Optimization: a GDP Analysis and Applications in Process Intensification.
        Computer Aided Chemical Engineering 2022 Jan 1 (Vol. 49, pp. 1279-1284). Elsevier.
        https://doi.org/10.1016/B978-0-323-85159-6.50213-X
Original model has 34 constraints (1 nonlinear) and 9 disjunctions, with 37 variables, of which 18 are binary, 0 are integer, and 19 are continuous.
=============================================================================================
Iteration |   Search Type   | Lower Bound | Upper Bound |   Gap    | Time(s)

        0     Initial point          -inf   239960.01118       inf%      0.39  *
        1   Neighbor search          -inf   239960.01118       inf%      0.60  
        1   Neighbor search          -inf   239960.01118       inf%      0.81  
        1   Neighbor search          -inf   210580.83835       inf%      1.02  *
        1       Line search          -inf   181201.66551       inf%      1.25  *
Line search finished.
        2   Neighbor search          -inf   178545.19584       inf%      1.48  *
        2   Neighbor search          -inf   178545.19584       inf%      1.69  
Line search finished.
        3   Neighbor search          -inf   167427.65710       inf%      2.14  *
        3   Neighbor search          -inf   167427.65710       inf%      2.36  
Line search finished.
        4   Neighbor search          -inf   167427.65710       inf%      3.04  
Optimal solution (2, 2, 1)

Solved in 4 iterations and 3.04212 seconds
Optimal objective value 167427.6570965372
Relative optimality gap inf%

Problem: 
- Name: unknown
  Lower bound: -inf
  Upper bound: 167427.6570965372
  Number of objectives: 1
  Number of constraints: 34
  Number of variables: 37
  Number of binary variables: 18
  Number of integer variables: 0
  Number of continuous variables: 19
  Number of nonzeros: None
  Sense: 1
  Number of disjunctions: 9
Solver: 
- Name: GDPopt (22, 5, 13) - LDSDA
  Status: ok
  User time: 3.042007731000922
  Wallclock time: 3.042007731000922
  Termination condition: unknown
  Iterations: 4
  Timing: main_timer_start_time: 13558.79707101
total: 3.042007731000922

Changes proposed in this PR:

Legal Acknowledgement

By contributing to this software project, I have read the contribution guide and agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the BSD license.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

@ZedongPeng ZedongPeng requested a review from bernalde February 5, 2024 03:16
@ZedongPeng
Copy link
Owner Author

Updates:

  1. Add reformulation summary into the log.
  2. Report the value of external variables in each step.
Starting GDPopt version 22.5.13 using LDSDA algorithm
iterlim: None
time_limit: None
tee: true
logger: <Logger pyomo.contrib.gdpopt (INFO)>
mip_solver: gurobi
mip_solver_args:
nlp_solver: ipopt
nlp_solver_args:
minlp_solver: gams
minlp_solver_args:
local_minlp_solver: bonmin
local_minlp_solver_args:
small_dual_tolerance: 1.0e-08
integer_tolerance: 1.0e-05
constraint_tolerance: 1.0e-06
variable_tolerance: 1.0e-08
subproblem_initialization_method: <function restore_vars_to_original_values at 0x101f85ab0>
call_before_subproblem_solve: !!python/name:pyomo.contrib.gdpopt.util._DoNothing ''
call_after_subproblem_solve: !!python/name:pyomo.contrib.gdpopt.util._DoNothing ''
call_after_subproblem_feasible: !!python/name:pyomo.contrib.gdpopt.util._DoNothing ''
force_subproblem_nlp: false
subproblem_presolve: true
tighten_nlp_var_bounds: false
round_discrete_vars: true
max_fbbt_iterations: 3
bound_tolerance: 1.0e-06
direction_norm: L2
starting_point: [3, 3, 3]
logical_constraint_list: ['lim[mixer]', 'lim[reactor]', 'lim[centrifuge]']

If you use this software, you may cite the following:
            - Implementation:
            Chen, Q; Johnson, ES; Bernal, DE; Valentin, R; Kale, S;
            Bates, J; Siirola, JD; Grossmann, IE.
            Pyomo.GDP: an ecosystem for logic based modeling and optimization
            development.
            Optimization and Engineering, 2021.

- LDSDA algorithm:
        Bernal DE, Ovalle D, Liñán DA, Ricardez-Sandoval LA, Gómez JM, Grossmann IE.
        Process Superstructure Optimization through Discrete Steepest Descent Optimization: a GDP Analysis and Applications in Process Intensification.
        Computer Aided Chemical Engineering 2022 Jan 1 (Vol. 49, pp. 1279-1284). Elsevier.
        https://doi.org/10.1016/B978-0-323-85159-6.50213-X
Original model has 34 constraints (1 nonlinear) and 9 disjunctions, with 37 variables, of which 18 are binary, 0 are integer, and 19 are continuous.
Reformulation Summary:
┌─────────────────┬──────┬──────┬───────────────────────────────────────────────────────────┐
│   Ext Var Index │   LB │   UB │ Associated Boolean Vars                                   │
├─────────────────┼──────┼──────┼───────────────────────────────────────────────────────────┤
│               0 │    1 │    3 │ ['Y[1,mixer]', 'Y[2,mixer]', 'Y[3,mixer]']                │
│               1 │    1 │    3 │ ['Y[1,reactor]', 'Y[2,reactor]', 'Y[3,reactor]']          │
│               2 │    1 │    3 │ ['Y[1,centrifuge]', 'Y[2,centrifuge]', 'Y[3,centrifuge]'] │
└─────────────────┴──────┴──────┴───────────────────────────────────────────────────────────┘
=====================================================================================================
Iteration |   Search Type   |  External Variables  | Lower Bound | Upper Bound |   Gap    | Time(s)

        0     Initial point              (3, 3, 3)          -inf   239960.01118       inf%      0.69  *
        1   Neighbor search              (2, 3, 3)          -inf   239960.01118       inf%      1.03  
        1   Neighbor search              (3, 2, 3)          -inf   239960.01118       inf%      1.39  
        1   Neighbor search              (3, 3, 2)          -inf   210580.83835       inf%      1.74  *
        1       Line search              (3, 3, 1)          -inf   181201.66551       inf%      2.06  *
        2   Neighbor search              (2, 3, 1)          -inf   178545.19584       inf%      2.39  *
        2   Neighbor search              (3, 2, 1)          -inf   178545.19584       inf%      2.95  
        3   Neighbor search              (2, 2, 1)          -inf   167427.65710       inf%      4.07  *
        3   Neighbor search              (2, 3, 2)          -inf   167427.65710       inf%      4.63  
        4   Neighbor search              (2, 2, 2)          -inf   167427.65710       inf%      6.23  

Solved in 4 iterations and 6.22624 seconds
Optimal objective value 167427.6570965372
Relative optimality gap inf%

Problem: 
- Name: unknown
  Lower bound: -inf
  Upper bound: 167427.6570965372
  Number of objectives: 1
  Number of constraints: 34
  Number of variables: 37
  Number of binary variables: 18
  Number of integer variables: 0
  Number of continuous variables: 19
  Number of nonzeros: None
  Sense: 1
  Number of disjunctions: 9
Solver: 
- Name: GDPopt (22, 5, 13) - LDSDA
  Status: ok
  User time: 6.2260024060014985
  Wallclock time: 6.2260024060014985
  Termination condition: unknown
  Iterations: 4
  Timing: main_timer_start_time: 53578.926211638
total: 6.2260024060014985

ZedongPeng pushed a commit that referenced this pull request Mar 11, 2024
pyomo.solver.ipopt: account for presolve when loading results
jsiirola and others added 27 commits October 31, 2024 11:53
Co-authored-by: Emma Johnson <[email protected]>
Update `common.timing` to make tests more deterministic
Defer processing `ConfigValue`/`ConfigList` default value until first use
Fixing spelling found by new typos release (v1.27.0)
blnicho and others added 30 commits November 18, 2024 12:18
Resolve errors in mapping ScalarVar to numpy ndarray
Remove (unused) legacy test drivers
Resetting main for development (6.9.0.dev0)
Co-authored-by: Bethany Nicholson <[email protected]>
New Typo Corrections - Nov 2024
Verify we are testing all NEOS solvers
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants