Advertisement
brospresident

Untitled

Feb 28th, 2022
2,905
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Julia 0.29 KB | None | 0 0
  1. using JuMP, GLPK
  2. m = Model(GLPK.Optimizer)
  3. @variable(m, 0 <= x <=2)
  4. @variable(m, 0 <= y <= 30)
  5. @objective(m, Max, 5x + 3y)
  6. @constraint(m, 1x + 5y <= 3.0)
  7. JuMP.optimize!(m)
  8. println("Objectivevalue:", JuMP.objective_value(m))
  9. println("x = ", JuMP.value(x))
  10. println("y = ", JuMP.value(y))
  11.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement