Skip to content

Commit fef171c

Browse files
committed
Kernel updates and minor updates to syntax
1 parent 5017807 commit fef171c

File tree

3 files changed

+501
-30
lines changed

3 files changed

+501
-30
lines changed

notebooks/nlpopt_explicit_kinetic.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@
166166
" x = explicit_euler_integration(p)\n",
167167
" SSE = 0.0\n",
168168
" for i=1:200\n",
169-
" SSE += (intensity(x[5i-4],x[5i-3],x[5i-2]) - data[:intensity][i])^2\n",
169+
" SSE += (intensity(x[5i-4],x[5i-3],x[5i-2]) - data[!, :intensity][i])^2\n",
170170
" end\n",
171171
" return SSE\n",
172172
"end"

notebooks/nlpopt_interval_bnb.ipynb

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
},
6565
{
6666
"cell_type": "code",
67-
"execution_count": 7,
67+
"execution_count": 3,
6868
"metadata": {},
6969
"outputs": [
7070
{
@@ -73,7 +73,7 @@
7373
"lower_problem! (generic function with 3 methods)"
7474
]
7575
},
76-
"execution_count": 7,
76+
"execution_count": 3,
7777
"metadata": {},
7878
"output_type": "execute_result"
7979
}
@@ -92,7 +92,7 @@
9292
" F = sin(x_value[1])x_value[2]^2-cos(x_value[3])/x_value[4]\n",
9393
" \n",
9494
" x._lower_objective_value = F.lo\n",
95-
" x._lower_solution = mid.(x_value)\n",
95+
" x._lower_solution = IntervalArithmetic.mid.(x_value)\n",
9696
" x._lower_feasibility = true\n",
9797
" x._cut_add_flag = false\n",
9898
" \n",
@@ -112,18 +112,7 @@
112112
"cell_type": "code",
113113
"execution_count": 4,
114114
"metadata": {},
115-
"outputs": [
116-
{
117-
"data": {
118-
"text/plain": [
119-
"upper_problem! (generic function with 1 method)"
120-
]
121-
},
122-
"execution_count": 4,
123-
"metadata": {},
124-
"output_type": "execute_result"
125-
}
126-
],
115+
"outputs": [],
127116
"source": [
128117
"import EAGO.upper_problem!\n",
129118
"function EAGO.upper_problem!(t::IntervalExt, x::EAGO.Optimizer)\n",
@@ -148,7 +137,7 @@
148137
"cell_type": "markdown",
149138
"metadata": {},
150139
"source": [
151-
"### Disable unecessary routines.\n",
140+
"### Disable unnecessary routines.\n",
152141
"It is entirely possible to disable domain reduction by manipulating keyword arguments supplied to the optimizer. However, for simplicity sake we'll simply overload the default preprocessing and postprocessing methods,"
153142
]
154143
},
@@ -180,9 +169,26 @@
180169
},
181170
{
182171
"cell_type": "code",
183-
"execution_count": null,
172+
"execution_count": 6,
184173
"metadata": {},
185-
"outputs": [],
174+
"outputs": [
175+
{
176+
"name": "stdout",
177+
"output_type": "stream",
178+
"text": [
179+
"-------------------------------------------------------------------------------------------------------\n",
180+
"| Iteration # | Nodes | Lower Bound | Upper Bound | Gap | Ratio | Time | Time Left |\n",
181+
"-------------------------------------------------------------------------------------------------------\n",
182+
"First Solution Found at Node 1107\n",
183+
"UBD = -1.4989611040367379\n",
184+
"Solution is :\n",
185+
" X[1] = -1.56982421875\n",
186+
" X[2] = -0.999755859375\n",
187+
" X[3] = -0.00244140625\n",
188+
" X[4] = 2.002197265625\n"
189+
]
190+
}
191+
],
186192
"source": [
187193
"# Creates a JuMP model with the the lower_problem, upper_problem, and absolute tolerance set by keyword arguments\n",
188194
"m = JuMP.Model(with_optimizer(EAGO.Optimizer, absolute_tolerance = 0.001, obbt_depth = 0, dbbt_depth = 0, cp_depth = 0,\n",
@@ -215,18 +221,18 @@
215221
"### Get information from the JuMP Model object\n",
216222
"The objective value, solution, termination status, and primal status can then be accessed via the standard JuMP interface."
217223
]
218-
}
224+
},
219225
{
220226
"cell_type": "code",
221-
"execution_count": 6,
227+
"execution_count": 7,
222228
"metadata": {},
223229
"outputs": [
224230
{
225231
"name": "stdout",
226232
"output_type": "stream",
227233
"text": [
228234
"EAGO terminated with a status of OPTIMAL and a result code of FEASIBLE_POINT\n",
229-
"The optimal value is: -1.691376119161244, the solution found is [0.3125, 0.03125, 0.3125, 0.5625].\n"
235+
"The optimal value is: -1.4989611040367379, the solution found is [-1.56982421875, -0.999755859375, -0.00244140625, 2.002197265625].\n"
230236
]
231237
}
232238
],
@@ -256,16 +262,20 @@
256262
}
257263
],
258264
"metadata": {
265+
"@webio": {
266+
"lastCommId": null,
267+
"lastKernelId": null
268+
},
259269
"kernelspec": {
260-
"display_name": "Julia 1.1.0",
270+
"display_name": "Julia 1.3.1",
261271
"language": "julia",
262-
"name": "julia-1.1"
272+
"name": "julia-1.3"
263273
},
264274
"language_info": {
265275
"file_extension": ".jl",
266276
"mimetype": "application/julia",
267277
"name": "julia",
268-
"version": "1.1.0"
278+
"version": "1.3.1"
269279
}
270280
},
271281
"nbformat": 4,

0 commit comments

Comments
 (0)