Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Lineaarinen optimointi
- # "Advanced Engineering Mathematics", Sec 21.4 probl 5,s 1129
- # Juhani Kaukoranta 1.3.2021
- # Julia-ohjelma
- using GLPK, JuMP;
- model = Model(GLPK.Optimizer);
- #set_optimizer_attribute(model, "msg_lev", GLPK.MSG_OFF)
- @variables model begin
- x1 >= 0
- x2 >= 0
- x3 >= 0
- end;
- @constraints model begin
- 3x1 + x2 <= 450
- 2x2 + 3x3 <= 900
- 2x1 + x2 <= 350
- end;
- @objective model Max begin
- 10x1 + 8x2 + 5x3
- end;
- print(model);
- optimize!(model);
- @show value(x1);
- @show value(x2);
- @show value(x3);
- @show objective_value(model);
- termination_status(model)
Add Comment
Please, Sign In to add comment