Hi, I am trying to maximize a very simple function in JuMP which I can solve analytically. I am getting an optimal solution which is different from what I should get. I was hoping someone could point me to my error.
Here you can find a MWE
using JuMP, Ipopt, Optim, LinearAlgebra C1 = 50 K1 = 1 K2 = 0 K3 = 0 σ = 5 problem_test = Model(Ipopt.Optimizer) #set_silent(primal_capacity) @variable(problem_test, Q[1:3] >= 0) @NLobjective(problem_test, Max, Q^((σ-1)/σ)*K1 + Q^((σ-1)/σ)*K2 + Q^((σ-1)/σ)*K3 - 1.0*Q - 1.1*Q - 1.1*Q ) @constraint(problem_test, c1, 1.0*Q + 1.1*Q + 1.1*Q<= C1) optimize!(problem_test) objective_value(problem_test) sol = value.(Q) sum(sol) dual(c1) soltrue1 = ((σ-1)/σ)^σ*(K1/1.0)^σ soltrue2 = ((σ-1)/σ)^σ*(K2/1.1)^σ soltrue3 = ((σ-1)/σ)^σ*(K3/1.1)^σ
The variables soltrue correspond to the optimizer computed by paper and pencil.