desdeo 1.2__py3-none-any.whl → 2.1.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- desdeo/__init__.py +8 -8
- desdeo/adm/ADMAfsar.py +551 -0
- desdeo/adm/ADMChen.py +414 -0
- desdeo/adm/BaseADM.py +119 -0
- desdeo/adm/__init__.py +11 -0
- desdeo/api/README.md +73 -0
- desdeo/api/__init__.py +15 -0
- desdeo/api/app.py +50 -0
- desdeo/api/config.py +90 -0
- desdeo/api/config.toml +64 -0
- desdeo/api/db.py +27 -0
- desdeo/api/db_init.py +85 -0
- desdeo/api/db_models.py +164 -0
- desdeo/api/malaga_db_init.py +27 -0
- desdeo/api/models/__init__.py +266 -0
- desdeo/api/models/archive.py +23 -0
- desdeo/api/models/emo.py +128 -0
- desdeo/api/models/enautilus.py +69 -0
- desdeo/api/models/gdm/gdm_aggregate.py +139 -0
- desdeo/api/models/gdm/gdm_base.py +69 -0
- desdeo/api/models/gdm/gdm_score_bands.py +114 -0
- desdeo/api/models/gdm/gnimbus.py +138 -0
- desdeo/api/models/generic.py +104 -0
- desdeo/api/models/generic_states.py +401 -0
- desdeo/api/models/nimbus.py +158 -0
- desdeo/api/models/preference.py +128 -0
- desdeo/api/models/problem.py +717 -0
- desdeo/api/models/reference_point_method.py +18 -0
- desdeo/api/models/session.py +49 -0
- desdeo/api/models/state.py +463 -0
- desdeo/api/models/user.py +52 -0
- desdeo/api/models/utopia.py +25 -0
- desdeo/api/routers/_EMO.backup +309 -0
- desdeo/api/routers/_NAUTILUS.py +245 -0
- desdeo/api/routers/_NAUTILUS_navigator.py +233 -0
- desdeo/api/routers/_NIMBUS.py +765 -0
- desdeo/api/routers/__init__.py +5 -0
- desdeo/api/routers/emo.py +497 -0
- desdeo/api/routers/enautilus.py +237 -0
- desdeo/api/routers/gdm/gdm_aggregate.py +234 -0
- desdeo/api/routers/gdm/gdm_base.py +420 -0
- desdeo/api/routers/gdm/gdm_score_bands/gdm_score_bands_manager.py +398 -0
- desdeo/api/routers/gdm/gdm_score_bands/gdm_score_bands_routers.py +377 -0
- desdeo/api/routers/gdm/gnimbus/gnimbus_manager.py +698 -0
- desdeo/api/routers/gdm/gnimbus/gnimbus_routers.py +591 -0
- desdeo/api/routers/generic.py +233 -0
- desdeo/api/routers/nimbus.py +705 -0
- desdeo/api/routers/problem.py +307 -0
- desdeo/api/routers/reference_point_method.py +93 -0
- desdeo/api/routers/session.py +100 -0
- desdeo/api/routers/test.py +16 -0
- desdeo/api/routers/user_authentication.py +520 -0
- desdeo/api/routers/utils.py +187 -0
- desdeo/api/routers/utopia.py +230 -0
- desdeo/api/schema.py +100 -0
- desdeo/api/tests/__init__.py +0 -0
- desdeo/api/tests/conftest.py +151 -0
- desdeo/api/tests/test_enautilus.py +330 -0
- desdeo/api/tests/test_models.py +1179 -0
- desdeo/api/tests/test_routes.py +1075 -0
- desdeo/api/utils/_database.py +263 -0
- desdeo/api/utils/_logger.py +29 -0
- desdeo/api/utils/database.py +36 -0
- desdeo/api/utils/emo_database.py +40 -0
- desdeo/core.py +34 -0
- desdeo/emo/__init__.py +159 -0
- desdeo/emo/hooks/archivers.py +188 -0
- desdeo/emo/methods/EAs.py +541 -0
- desdeo/emo/methods/__init__.py +0 -0
- desdeo/emo/methods/bases.py +12 -0
- desdeo/emo/methods/templates.py +111 -0
- desdeo/emo/operators/__init__.py +1 -0
- desdeo/emo/operators/crossover.py +1282 -0
- desdeo/emo/operators/evaluator.py +114 -0
- desdeo/emo/operators/generator.py +459 -0
- desdeo/emo/operators/mutation.py +1224 -0
- desdeo/emo/operators/scalar_selection.py +202 -0
- desdeo/emo/operators/selection.py +1778 -0
- desdeo/emo/operators/termination.py +286 -0
- desdeo/emo/options/__init__.py +108 -0
- desdeo/emo/options/algorithms.py +435 -0
- desdeo/emo/options/crossover.py +164 -0
- desdeo/emo/options/generator.py +131 -0
- desdeo/emo/options/mutation.py +260 -0
- desdeo/emo/options/repair.py +61 -0
- desdeo/emo/options/scalar_selection.py +66 -0
- desdeo/emo/options/selection.py +127 -0
- desdeo/emo/options/templates.py +383 -0
- desdeo/emo/options/termination.py +143 -0
- desdeo/explanations/__init__.py +6 -0
- desdeo/explanations/explainer.py +100 -0
- desdeo/explanations/utils.py +90 -0
- desdeo/gdm/__init__.py +22 -0
- desdeo/gdm/gdmtools.py +45 -0
- desdeo/gdm/score_bands.py +114 -0
- desdeo/gdm/voting_rules.py +50 -0
- desdeo/mcdm/__init__.py +41 -0
- desdeo/mcdm/enautilus.py +338 -0
- desdeo/mcdm/gnimbus.py +484 -0
- desdeo/mcdm/nautili.py +345 -0
- desdeo/mcdm/nautilus.py +477 -0
- desdeo/mcdm/nautilus_navigator.py +656 -0
- desdeo/mcdm/nimbus.py +417 -0
- desdeo/mcdm/pareto_navigator.py +269 -0
- desdeo/mcdm/reference_point_method.py +186 -0
- desdeo/problem/__init__.py +83 -0
- desdeo/problem/evaluator.py +561 -0
- desdeo/problem/external/__init__.py +18 -0
- desdeo/problem/external/core.py +356 -0
- desdeo/problem/external/pymoo_provider.py +266 -0
- desdeo/problem/external/runtime.py +44 -0
- desdeo/problem/gurobipy_evaluator.py +562 -0
- desdeo/problem/infix_parser.py +341 -0
- desdeo/problem/json_parser.py +944 -0
- desdeo/problem/pyomo_evaluator.py +487 -0
- desdeo/problem/schema.py +1829 -0
- desdeo/problem/simulator_evaluator.py +348 -0
- desdeo/problem/sympy_evaluator.py +244 -0
- desdeo/problem/testproblems/__init__.py +88 -0
- desdeo/problem/testproblems/benchmarks_server.py +120 -0
- desdeo/problem/testproblems/binh_and_korn_problem.py +88 -0
- desdeo/problem/testproblems/cake_problem.py +185 -0
- desdeo/problem/testproblems/dmitry_forest_problem_discrete.py +71 -0
- desdeo/problem/testproblems/dtlz2_problem.py +102 -0
- desdeo/problem/testproblems/forest_problem.py +283 -0
- desdeo/problem/testproblems/knapsack_problem.py +163 -0
- desdeo/problem/testproblems/mcwb_problem.py +831 -0
- desdeo/problem/testproblems/mixed_variable_dimenrions_problem.py +83 -0
- desdeo/problem/testproblems/momip_problem.py +172 -0
- desdeo/problem/testproblems/multi_valued_constraints.py +119 -0
- desdeo/problem/testproblems/nimbus_problem.py +143 -0
- desdeo/problem/testproblems/pareto_navigator_problem.py +89 -0
- desdeo/problem/testproblems/re_problem.py +492 -0
- desdeo/problem/testproblems/river_pollution_problems.py +440 -0
- desdeo/problem/testproblems/rocket_injector_design_problem.py +140 -0
- desdeo/problem/testproblems/simple_problem.py +351 -0
- desdeo/problem/testproblems/simulator_problem.py +92 -0
- desdeo/problem/testproblems/single_objective.py +289 -0
- desdeo/problem/testproblems/spanish_sustainability_problem.py +945 -0
- desdeo/problem/testproblems/zdt_problem.py +274 -0
- desdeo/problem/utils.py +245 -0
- desdeo/tools/GenerateReferencePoints.py +181 -0
- desdeo/tools/__init__.py +120 -0
- desdeo/tools/desc_gen.py +22 -0
- desdeo/tools/generics.py +165 -0
- desdeo/tools/group_scalarization.py +3090 -0
- desdeo/tools/gurobipy_solver_interfaces.py +258 -0
- desdeo/tools/indicators_binary.py +117 -0
- desdeo/tools/indicators_unary.py +362 -0
- desdeo/tools/interaction_schema.py +38 -0
- desdeo/tools/intersection.py +54 -0
- desdeo/tools/iterative_pareto_representer.py +99 -0
- desdeo/tools/message.py +265 -0
- desdeo/tools/ng_solver_interfaces.py +199 -0
- desdeo/tools/non_dominated_sorting.py +134 -0
- desdeo/tools/patterns.py +283 -0
- desdeo/tools/proximal_solver.py +99 -0
- desdeo/tools/pyomo_solver_interfaces.py +477 -0
- desdeo/tools/reference_vectors.py +229 -0
- desdeo/tools/scalarization.py +2065 -0
- desdeo/tools/scipy_solver_interfaces.py +454 -0
- desdeo/tools/score_bands.py +627 -0
- desdeo/tools/utils.py +388 -0
- desdeo/tools/visualizations.py +67 -0
- desdeo/utopia_stuff/__init__.py +0 -0
- desdeo/utopia_stuff/data/1.json +15 -0
- desdeo/utopia_stuff/data/2.json +13 -0
- desdeo/utopia_stuff/data/3.json +15 -0
- desdeo/utopia_stuff/data/4.json +17 -0
- desdeo/utopia_stuff/data/5.json +15 -0
- desdeo/utopia_stuff/from_json.py +40 -0
- desdeo/utopia_stuff/reinit_user.py +38 -0
- desdeo/utopia_stuff/utopia_db_init.py +212 -0
- desdeo/utopia_stuff/utopia_problem.py +403 -0
- desdeo/utopia_stuff/utopia_problem_old.py +415 -0
- desdeo/utopia_stuff/utopia_reference_solutions.py +79 -0
- desdeo-2.1.0.dist-info/METADATA +186 -0
- desdeo-2.1.0.dist-info/RECORD +180 -0
- {desdeo-1.2.dist-info → desdeo-2.1.0.dist-info}/WHEEL +1 -1
- desdeo-2.1.0.dist-info/licenses/LICENSE +21 -0
- desdeo-1.2.dist-info/METADATA +0 -16
- desdeo-1.2.dist-info/RECORD +0 -4
|
@@ -0,0 +1,289 @@
|
|
|
1
|
+
"""Here a variety of single-objective optimization problems are defined."""
|
|
2
|
+
|
|
3
|
+
import math
|
|
4
|
+
|
|
5
|
+
from desdeo.problem import (
|
|
6
|
+
Constant,
|
|
7
|
+
Constraint,
|
|
8
|
+
ConstraintTypeEnum,
|
|
9
|
+
ExtraFunction,
|
|
10
|
+
Objective,
|
|
11
|
+
Problem,
|
|
12
|
+
Variable,
|
|
13
|
+
VariableTypeEnum,
|
|
14
|
+
)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def mystery_function() -> Problem:
|
|
18
|
+
r"""Add the constrained mystery function as defined in Sasena 2002.
|
|
19
|
+
|
|
20
|
+
Global solution's value (constrained): -1.174261 at x = [2.5044, 2.5778].
|
|
21
|
+
|
|
22
|
+
Returns:
|
|
23
|
+
Problem: the problem model.
|
|
24
|
+
|
|
25
|
+
References:
|
|
26
|
+
Michael Sasena. 2002. Flexibility and Eiciency Enhancements For
|
|
27
|
+
Constrained Global Design Optimization with Kriging Approximations. Ph.D. Dissertation.
|
|
28
|
+
"""
|
|
29
|
+
pi = Constant(name="Pi", symbol="PI", value=math.pi)
|
|
30
|
+
x_1 = Variable(
|
|
31
|
+
name="x_1", symbol="x_1", variable_type=VariableTypeEnum.real, lowerbound=0.0, upperbound=5.0, initial_value=0.1
|
|
32
|
+
)
|
|
33
|
+
x_2 = Variable(
|
|
34
|
+
name="x_2", symbol="x_2", variable_type=VariableTypeEnum.real, lowerbound=0.0, upperbound=5.0, initial_value=0.1
|
|
35
|
+
)
|
|
36
|
+
|
|
37
|
+
f_1_def = "2 + 0.01*(x_2 - x_1**2)**2 + (1 - x_1)**2 + 2*(2 - x_2)**2 + 7*Sin(0.5*x_1)*Sin(0.7*x_1*x_2)"
|
|
38
|
+
f_1 = Objective(
|
|
39
|
+
name="f_1",
|
|
40
|
+
symbol="f_1",
|
|
41
|
+
func=f_1_def,
|
|
42
|
+
maximize=False,
|
|
43
|
+
is_linear=False,
|
|
44
|
+
is_convex=False,
|
|
45
|
+
is_twice_differentiable=True,
|
|
46
|
+
)
|
|
47
|
+
|
|
48
|
+
c_1_def = "-Sin(x_1 - x_2 - PI/8.0)"
|
|
49
|
+
c_1 = Constraint(
|
|
50
|
+
name="c_1",
|
|
51
|
+
symbol="c_1",
|
|
52
|
+
cons_type=ConstraintTypeEnum.LTE,
|
|
53
|
+
func=c_1_def,
|
|
54
|
+
is_linear=False,
|
|
55
|
+
is_convex=False,
|
|
56
|
+
is_twice_differentiable=True,
|
|
57
|
+
)
|
|
58
|
+
|
|
59
|
+
return Problem(
|
|
60
|
+
name="Mystery function",
|
|
61
|
+
description="The single-objective mystery function.",
|
|
62
|
+
constants=[pi],
|
|
63
|
+
variables=[x_1, x_2],
|
|
64
|
+
objectives=[f_1],
|
|
65
|
+
constraints=[c_1],
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
def new_branin_function() -> Problem:
|
|
70
|
+
"""Implements the new Branin function.
|
|
71
|
+
|
|
72
|
+
Global optimal -268.78792 at x = [3.2730, 0.0489].
|
|
73
|
+
"""
|
|
74
|
+
pi = Constant(name="Pi", symbol="PI", value=math.pi)
|
|
75
|
+
x_1 = Variable(
|
|
76
|
+
name="x_1",
|
|
77
|
+
symbol="x_1",
|
|
78
|
+
variable_type=VariableTypeEnum.real,
|
|
79
|
+
lowerbound=-5.0,
|
|
80
|
+
upperbound=10.0,
|
|
81
|
+
initial_value=0.1,
|
|
82
|
+
)
|
|
83
|
+
x_2 = Variable(
|
|
84
|
+
name="x_2",
|
|
85
|
+
symbol="x_2",
|
|
86
|
+
variable_type=VariableTypeEnum.real,
|
|
87
|
+
lowerbound=0.0,
|
|
88
|
+
upperbound=15.0,
|
|
89
|
+
initial_value=0.1,
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
f_1_def = "-(x_1 - 10)**2 - (x_2 - 15)**2"
|
|
93
|
+
f_1 = Objective(
|
|
94
|
+
name="f_1",
|
|
95
|
+
symbol="f_1",
|
|
96
|
+
func=f_1_def,
|
|
97
|
+
maximize=False,
|
|
98
|
+
is_linear=False,
|
|
99
|
+
is_convex=False,
|
|
100
|
+
is_twice_differentiable=True,
|
|
101
|
+
)
|
|
102
|
+
|
|
103
|
+
c_1_def = "(x_2 - (5.1 / (4*PI**2)) * x_1**2 + (5 / PI)*x_1 - 6)**2 + 10*(1 - 1/(8*PI))*Cos(x_1) + 5"
|
|
104
|
+
c_1 = Constraint(
|
|
105
|
+
name="c_1",
|
|
106
|
+
symbol="c_1",
|
|
107
|
+
cons_type=ConstraintTypeEnum.LTE,
|
|
108
|
+
func=c_1_def,
|
|
109
|
+
is_linear=False,
|
|
110
|
+
is_convex=False,
|
|
111
|
+
is_twice_differentiable=True,
|
|
112
|
+
)
|
|
113
|
+
|
|
114
|
+
return Problem(
|
|
115
|
+
name="New Branin function",
|
|
116
|
+
description="The single-objective mystery function.",
|
|
117
|
+
constants=[pi],
|
|
118
|
+
variables=[x_1, x_2],
|
|
119
|
+
objectives=[f_1],
|
|
120
|
+
constraints=[c_1],
|
|
121
|
+
)
|
|
122
|
+
|
|
123
|
+
|
|
124
|
+
def mishras_bird_constrained() -> Problem:
|
|
125
|
+
"""Implements the constrained variant of Mishra's bird function.
|
|
126
|
+
|
|
127
|
+
Global optima: -106.7645367 at [-3.1302468, -1.5821422]
|
|
128
|
+
"""
|
|
129
|
+
x_1 = Variable(
|
|
130
|
+
name="x_1",
|
|
131
|
+
symbol="x_1",
|
|
132
|
+
variable_type=VariableTypeEnum.real,
|
|
133
|
+
lowerbound=-10.0,
|
|
134
|
+
upperbound=0.0,
|
|
135
|
+
initial_value=-0.1,
|
|
136
|
+
)
|
|
137
|
+
x_2 = Variable(
|
|
138
|
+
name="x_2",
|
|
139
|
+
symbol="x_2",
|
|
140
|
+
variable_type=VariableTypeEnum.real,
|
|
141
|
+
lowerbound=-6.5,
|
|
142
|
+
upperbound=0.0,
|
|
143
|
+
initial_value=-0.1,
|
|
144
|
+
)
|
|
145
|
+
|
|
146
|
+
f_1_def = "Sin(x_2)*Exp((1 - Cos(x_1))**2) + Cos(x_1)*Exp((1 - Sin(x_2))**2) + (x_1 - x_2)**2"
|
|
147
|
+
f_1 = Objective(
|
|
148
|
+
name="f_1",
|
|
149
|
+
symbol="f_1",
|
|
150
|
+
func=f_1_def,
|
|
151
|
+
maximize=False,
|
|
152
|
+
is_linear=False,
|
|
153
|
+
is_convex=False,
|
|
154
|
+
is_twice_differentiable=True,
|
|
155
|
+
)
|
|
156
|
+
|
|
157
|
+
c_1_def = "(x_1 + 5)**2 + (x_2 + 5)**2 - 25"
|
|
158
|
+
c_1 = Constraint(
|
|
159
|
+
name="c_1",
|
|
160
|
+
symbol="c_1",
|
|
161
|
+
cons_type=ConstraintTypeEnum.LTE,
|
|
162
|
+
func=c_1_def,
|
|
163
|
+
is_linear=False,
|
|
164
|
+
is_convex=False,
|
|
165
|
+
is_twice_differentiable=True,
|
|
166
|
+
)
|
|
167
|
+
|
|
168
|
+
return Problem(
|
|
169
|
+
name="Mishra's bird function",
|
|
170
|
+
description="The constrained variant of Mishra's bird function",
|
|
171
|
+
variables=[x_1, x_2],
|
|
172
|
+
objectives=[f_1],
|
|
173
|
+
constraints=[c_1],
|
|
174
|
+
)
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
def rosenbrock_disk() -> Problem:
|
|
178
|
+
"""Defines the Rosenbrock test functions constrained to a disk.
|
|
179
|
+
|
|
180
|
+
Global optima is 0 at [1.0, 1.0].
|
|
181
|
+
"""
|
|
182
|
+
x = Variable(
|
|
183
|
+
name="x",
|
|
184
|
+
symbol="x",
|
|
185
|
+
variable_type=VariableTypeEnum.real,
|
|
186
|
+
lowerbound=-1.5,
|
|
187
|
+
upperbound=1.5,
|
|
188
|
+
initial_value=0.1,
|
|
189
|
+
)
|
|
190
|
+
y = Variable(
|
|
191
|
+
name="y",
|
|
192
|
+
symbol="y",
|
|
193
|
+
variable_type=VariableTypeEnum.real,
|
|
194
|
+
lowerbound=-1.5,
|
|
195
|
+
upperbound=1.5,
|
|
196
|
+
initial_value=0.1,
|
|
197
|
+
)
|
|
198
|
+
|
|
199
|
+
f_1_def = "(1 - x)**2 + 100*(y - x**2)**2"
|
|
200
|
+
f_1 = Objective(
|
|
201
|
+
name="f_1",
|
|
202
|
+
symbol="f_1",
|
|
203
|
+
func=f_1_def,
|
|
204
|
+
maximize=False,
|
|
205
|
+
is_linear=False,
|
|
206
|
+
is_convex=False,
|
|
207
|
+
is_twice_differentiable=True,
|
|
208
|
+
)
|
|
209
|
+
|
|
210
|
+
c_1_def = "x**2 + y**2 - 2.0"
|
|
211
|
+
c_1 = Constraint(
|
|
212
|
+
name="c_1",
|
|
213
|
+
symbol="c_1",
|
|
214
|
+
cons_type=ConstraintTypeEnum.LTE,
|
|
215
|
+
func=c_1_def,
|
|
216
|
+
is_linear=False,
|
|
217
|
+
is_convex=False,
|
|
218
|
+
is_twice_differentiable=True,
|
|
219
|
+
)
|
|
220
|
+
|
|
221
|
+
return Problem(
|
|
222
|
+
name="Rosenbrock test function",
|
|
223
|
+
description="The Rosenbrock test function constrained to a disk.",
|
|
224
|
+
variables=[x, y],
|
|
225
|
+
objectives=[f_1],
|
|
226
|
+
constraints=[c_1],
|
|
227
|
+
)
|
|
228
|
+
|
|
229
|
+
|
|
230
|
+
def townsend_modified() -> Problem:
|
|
231
|
+
"""Implements the modified Townsend function.
|
|
232
|
+
|
|
233
|
+
Global optima is -2.0239884 at [2.0052938, 1.1944509].
|
|
234
|
+
"""
|
|
235
|
+
x = Variable(
|
|
236
|
+
name="x",
|
|
237
|
+
symbol="x",
|
|
238
|
+
variable_type=VariableTypeEnum.real,
|
|
239
|
+
lowerbound=-2.25,
|
|
240
|
+
upperbound=2.25,
|
|
241
|
+
initial_value=0.1,
|
|
242
|
+
)
|
|
243
|
+
y = Variable(
|
|
244
|
+
name="y",
|
|
245
|
+
symbol="y",
|
|
246
|
+
variable_type=VariableTypeEnum.real,
|
|
247
|
+
lowerbound=-2.5,
|
|
248
|
+
upperbound=1.75,
|
|
249
|
+
initial_value=0.1,
|
|
250
|
+
)
|
|
251
|
+
|
|
252
|
+
f_1_def = "-1.0 * (Cos((x - 0.1)*y))**2 - x*Sin(3.0*x + y)"
|
|
253
|
+
f_1 = Objective(
|
|
254
|
+
name="f_1",
|
|
255
|
+
symbol="f_1",
|
|
256
|
+
func=f_1_def,
|
|
257
|
+
maximize=False,
|
|
258
|
+
is_linear=False,
|
|
259
|
+
is_convex=False,
|
|
260
|
+
is_twice_differentiable=True,
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
# define the atan2 functions as the double of the arctangent of the half tangent
|
|
264
|
+
# Obs! Risk of dividing by zero!
|
|
265
|
+
t_symbol = "t"
|
|
266
|
+
t_def = "2.0*Arctan(x / (Sqrt(y**2 + x**2) + y))"
|
|
267
|
+
t = ExtraFunction(
|
|
268
|
+
name="Atan2", symbol=t_symbol, func=t_def, is_convex=False, is_linear=False, is_twice_differentiable=True
|
|
269
|
+
)
|
|
270
|
+
|
|
271
|
+
c_1_def = "x**2 + y**2 - (2.0*Cos(t) - 0.5*Cos(2.0*t) - 0.25*Cos(3.0*t) - 0.125*Cos(4.0*t))**2 - (2.0*Sin(t))**2"
|
|
272
|
+
c_1 = Constraint(
|
|
273
|
+
name="c_1",
|
|
274
|
+
symbol="c_1",
|
|
275
|
+
cons_type=ConstraintTypeEnum.LTE,
|
|
276
|
+
func=c_1_def,
|
|
277
|
+
is_linear=False,
|
|
278
|
+
is_convex=False,
|
|
279
|
+
is_twice_differentiable=True,
|
|
280
|
+
)
|
|
281
|
+
|
|
282
|
+
return Problem(
|
|
283
|
+
name="Townsend function",
|
|
284
|
+
description="The modified Townsend function.",
|
|
285
|
+
variables=[x, y],
|
|
286
|
+
objectives=[f_1],
|
|
287
|
+
constraints=[c_1],
|
|
288
|
+
extra_funcs=[t],
|
|
289
|
+
)
|