Skip to content

Commit

Permalink
Kernel updates and minor updates to syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
mewilhel committed Mar 23, 2020
1 parent 5017807 commit fef171c
Show file tree
Hide file tree
Showing 3 changed files with 501 additions and 30 deletions.
2 changes: 1 addition & 1 deletion notebooks/nlpopt_explicit_kinetic.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
" x = explicit_euler_integration(p)\n",
" SSE = 0.0\n",
" for i=1:200\n",
" SSE += (intensity(x[5i-4],x[5i-3],x[5i-2]) - data[:intensity][i])^2\n",
" SSE += (intensity(x[5i-4],x[5i-3],x[5i-2]) - data[!, :intensity][i])^2\n",
" end\n",
" return SSE\n",
"end"
Expand Down
58 changes: 34 additions & 24 deletions notebooks/nlpopt_interval_bnb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 3,
"metadata": {},
"outputs": [
{
Expand All @@ -73,7 +73,7 @@
"lower_problem! (generic function with 3 methods)"
]
},
"execution_count": 7,
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -92,7 +92,7 @@
" F = sin(x_value[1])x_value[2]^2-cos(x_value[3])/x_value[4]\n",
" \n",
" x._lower_objective_value = F.lo\n",
" x._lower_solution = mid.(x_value)\n",
" x._lower_solution = IntervalArithmetic.mid.(x_value)\n",
" x._lower_feasibility = true\n",
" x._cut_add_flag = false\n",
" \n",
Expand All @@ -112,18 +112,7 @@
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"upper_problem! (generic function with 1 method)"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"import EAGO.upper_problem!\n",
"function EAGO.upper_problem!(t::IntervalExt, x::EAGO.Optimizer)\n",
Expand All @@ -148,7 +137,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"### Disable unecessary routines.\n",
"### Disable unnecessary routines.\n",
"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,"
]
},
Expand Down Expand Up @@ -180,9 +169,26 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"metadata": {},
"outputs": [],
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"-------------------------------------------------------------------------------------------------------\n",
"| Iteration # | Nodes | Lower Bound | Upper Bound | Gap | Ratio | Time | Time Left |\n",
"-------------------------------------------------------------------------------------------------------\n",
"First Solution Found at Node 1107\n",
"UBD = -1.4989611040367379\n",
"Solution is :\n",
" X[1] = -1.56982421875\n",
" X[2] = -0.999755859375\n",
" X[3] = -0.00244140625\n",
" X[4] = 2.002197265625\n"
]
}
],
"source": [
"# Creates a JuMP model with the the lower_problem, upper_problem, and absolute tolerance set by keyword arguments\n",
"m = JuMP.Model(with_optimizer(EAGO.Optimizer, absolute_tolerance = 0.001, obbt_depth = 0, dbbt_depth = 0, cp_depth = 0,\n",
Expand Down Expand Up @@ -215,18 +221,18 @@
"### Get information from the JuMP Model object\n",
"The objective value, solution, termination status, and primal status can then be accessed via the standard JuMP interface."
]
}
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 7,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"EAGO terminated with a status of OPTIMAL and a result code of FEASIBLE_POINT\n",
"The optimal value is: -1.691376119161244, the solution found is [0.3125, 0.03125, 0.3125, 0.5625].\n"
"The optimal value is: -1.4989611040367379, the solution found is [-1.56982421875, -0.999755859375, -0.00244140625, 2.002197265625].\n"
]
}
],
Expand Down Expand Up @@ -256,16 +262,20 @@
}
],
"metadata": {
"@webio": {
"lastCommId": null,
"lastKernelId": null
},
"kernelspec": {
"display_name": "Julia 1.1.0",
"display_name": "Julia 1.3.1",
"language": "julia",
"name": "julia-1.1"
"name": "julia-1.3"
},
"language_info": {
"file_extension": ".jl",
"mimetype": "application/julia",
"name": "julia",
"version": "1.1.0"
"version": "1.3.1"
}
},
"nbformat": 4,
Expand Down
Loading

0 comments on commit fef171c

Please sign in to comment.