Skip to content

Instantly share code, notes, and snippets.

@tkelman
Created July 16, 2015 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkelman/69cb6d9632e41a9c6a88 to your computer and use it in GitHub Desktop.
Save tkelman/69cb6d9632e41a9c6a88 to your computer and use it in GitHub Desktop.
Pkg.add("JuMP")
Pkg.add("CoinOptServices")
Pkg.add("AmplNLWriter")
using JuMP, AmplNLWriter
# Solve test problem 1 (Synthesis of processing system) in
# M. Duran & I.E. Grossmann, "An outer approximation algorithm for
# a class of mixed integer nonlinear programs", Mathematical
# Programming 36, pp. 307-339, 1986.
m = Model(solver = BonminNLSolver())
x_U = [2,2,1]
@defVar(m, x_U[i] >= x[i=1:3] >= 0)
@defVar(m, y[4:6], Bin)
@setNLObjective(m, Min, 10 + 10*x[1] - 7*x[3] + 5*y[4] + 6*y[5] +
8*y[6] - 18*log(x[2]+1) - 19.2*log(x[1]-x[2]+1))
@addNLConstraints(m, begin
0.8*log(x[2] + 1) + 0.96*log(x[1] - x[2] + 1) - 0.8*x[3] >= 0
log(x[2] + 1) + 1.2*log(x[1] - x[2] + 1) - x[3] - 2*y[6] >= -2
x[2] - x[1] <= 0
x[2] - 2*y[4] <= 0
x[1] - x[2] - 2*y[5] <= 0
y[4] + y[5] <= 1
end)
status = solve(m)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment