Created
September 23, 2015 23:18
-
-
Save odow/66998c7aab1137e196f7 to your computer and use it in GitHub Desktop.
.nl min function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# uncomment lines 9, 79 in nl_params.jl | |
using JuMP, AmplNLWriter | |
m = Model(solver=IpoptNLSolver()) | |
@defVar(m, -1 <= x <= 1) | |
@setNLObjective(m, Max, min( x, -x, 0.5x-0.25 )) | |
solve(m) | |
@show getObjectiveValue(m) # should be -0.1666666666 | |
@show getValue(x) # should be 0.1666666666 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g3 1 1 0 | |
1 0 1 0 0 0 | |
0 1 | |
0 0 | |
0 1 0 | |
0 0 0 0 | |
0 0 0 0 0 | |
0 1 | |
0 0 | |
0 0 0 0 0 | |
O0 1 | |
o11 | |
3 | |
v0 | |
o16 | |
v0 | |
o1 | |
o2 | |
n0.5 | |
v0 | |
n0.25 | |
x1 | |
0 0.0 | |
b | |
0 -1.0 1.0 | |
G0 1 | |
0 0.0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment