Optimization in Julia

The next example is from the web page https://jump.readthedocs.io/en/release-0.2/jump.html. The code is given here:

using JuMP 
using ECOS 
m= Model(solver =ECOSSolver()) 
@variable(m, 0 <= x <= 2 ) 
@variable(m, 0 <= y <= 30 ) 
@setObjective(m, Max, 5x + 3*y ) 
@addConstraint(m, 1x + 5y <= 3.0 ) 
print(m) 
status = solve(m) 
println("Objective value: ", getObjectiveValue(m)) 
println("x = ", getValue(x)) 
println("y = ", getValue(y)) 

First, the objective function is shown here:

The output is given in the following screenshot:

For the code of m=Model(solver=ECOSSolver()) in the preceding program, the solver contained in the package ...

Get Hands-On Data Science with Anaconda now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.