Reaktoro 
A unified framework for modeling chemically reactive systems
OptimumOptions.hpp
1 // Reaktoro is a unified framework for modeling chemically reactive systems.
2 //
3 // Copyright (C) 2014-2015 Allan Leal
4 //
5 // This program is free software: you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation, either version 3 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18 #pragma once
19 
20 // Reaktoro includes
21 #include <Reaktoro/Common/Outputter.hpp>
22 #include <Reaktoro/Math/LU.hpp>
23 #include <Reaktoro/Optimization/KktSolver.hpp>
24 #include <Reaktoro/Optimization/Regularizer.hpp>
25 
26 namespace Reaktoro {
27 
30 {
33 
36 };
37 
39 {
41  double threshold = 1.0e-14;
42 };
43 
45 {
47  double mu = 1.0e-20;
48 
53  double tau = 0.99;
54 
57 };
58 
60 {
62  double mu = 1.0e-20;
63 
68  double tau = 0.99;
69 
72 };
73 
75 {
78  double epsilon = 1e-20;
79 
83  double tau = 1e-5;
84 };
85 
87 {
89  std::vector<double> mu = std::vector<double>({1e-8, 1e-16}); // need explicit initialization list to compile in MSVC 2013
90 
91  double delta = 1.0;
92  double eta_phi = 1.0e-4;
93  double gamma_alpha = 0.05;
94  double gamma_phi = 1.0e-5;
95  double gamma_theta = 1.0e-5;
96  double kappa_epsilon = 10.0;
97  double kappa_mu = 0.2;
98  double kappa_sigma = 1.0e+10;
99  double kappa_soc = 0.99;
100  double s_phi = 2.3;
101  double s_theta = 1.1;
102  double tau_min = 0.9999;
103  double theta_mu = 2.0;
104  unsigned max_iters_soc = 4;
105  bool soc = true;
106 
108  double mux = 1.0e-5;
109 
111  bool scaling = true;
112 };
113 
115 {
117  double line_search_max_iterations = 3;
118 
120  double line_search_wolfe = 1.0e-4;
121 
122  // The fraction-to-the-boundary factor used in the feasible step
123  double tau_feasible = 0.99;
124 
125  // The fraction-to-the-boundary factor used in the descent step
126  double tau_descent = 0.9999;
127 
129  double feasibility_tolerance = 1.0e-13;
130 
132  double negative_dual_tolerance = -1.0e-2;
133 
136  double active_to_inactive = 1.0e-6;
137 
139  bool use_kkt_solver = false;
140 };
141 
143 {
144  bool use_lma_setup = true;
145 };
146 
149 {
151  std::string xprefix = "x";
152 
154  std::string yprefix = "y";
155 
157  std::string zprefix = "z";
158 
161  std::vector<std::string> xnames;
162 
165  std::vector<std::string> ynames;
166 
169  std::vector<std::string> znames;
170 
172  auto operator=(bool active) -> OptimumOutputOptions&;
173 };
174 
177 {
179  double delta = 0.0;
180 
182  double gamma = 0.0;
183 };
184 
187 {
189  double tolerance = 1.0e-6;
190 
195  double tolerancex = 0.0;
196 
201  double tolerancef = 0.0;
202 
204  unsigned max_iterations = 200;
205 
208 
211 
214 
217 
220 
223 
226 
229 
232 
235 };
236 
237 } // namespace Reaktoro
Use aggressive step that results in faster approach of variables to the bounds.
Definition: OptimumOptions.hpp:35
std::vector< std::string > znames
The names of the dual variables z.
Definition: OptimumOptions.hpp:169
A type that describes the regularization options for the optimisation calculation.
Definition: OptimumOptions.hpp:176
OptimumParamsActNewton actnewton
The parameters for the ActNewton algorithm.
Definition: OptimumOptions.hpp:210
OptimumParamsIpActive ipactive
The parameters for the IpActive algorithm.
Definition: OptimumOptions.hpp:222
KktOptions kkt
The options for the KKT calculations.
Definition: OptimumOptions.hpp:234
std::vector< std::string > ynames
The names of the dual variables y.
Definition: OptimumOptions.hpp:165
A type to describe the options for the KKT calculation.
Definition: KktSolver.hpp:71
OptimumParamsRefiner refiner
The parameters for the Refiner algorithm.
Definition: OptimumOptions.hpp:228
std::vector< std::string > xnames
The names of the primal variables x.
Definition: OptimumOptions.hpp:161
OptimumOutputOptions output
The options for the output of the optimisation calculations.
Definition: OptimumOptions.hpp:207
OptimumParamsIpAction ipaction
The parameters for the IpAction algorithm.
Definition: OptimumOptions.hpp:213
OptimumParamsIpOpt ipopt
The parameters for the IpOpt algorithm.
Definition: OptimumOptions.hpp:216
OptimumParamsIpNewton ipnewton
The parameters for the IpNewton algorithm.
Definition: OptimumOptions.hpp:219
A type that describes the options of a optimisation calculation.
Definition: OptimumOptions.hpp:186
Definition: Outputter.hpp:31
OptimumParamsKarpov karpov
The parameters for the Karpov algorithm.
Definition: OptimumOptions.hpp:225
Definition: OptimumOptions.hpp:142
Definition: OptimumOptions.hpp:38
Definition: OptimumOptions.hpp:74
Use convervative step in which its direction is not changed.
Definition: OptimumOptions.hpp:32
double threshold
The threshold for which primal variables lower than it is updated explicitly.
Definition: OptimumOptions.hpp:41
Definition: OptimumOptions.hpp:86
A type that describes the options for regularizing linear constraints.
Definition: Regularizer.hpp:34
The namespace containing all components of the Reaktoro library.
Definition: ChemicalScalar.hpp:24
Definition: OptimumOptions.hpp:59
StepMode
The available stepping modes for some optimization algorithms.
Definition: OptimumOptions.hpp:29
OptimumParamsRegularization regularization
The regularization options for the optimisation calculation.
Definition: OptimumOptions.hpp:231
Definition: OptimumOptions.hpp:44
A type that describes the options for the output of a optimisation calculation.
Definition: OptimumOptions.hpp:148
Definition: OptimumOptions.hpp:114