Warm starting Ipopt with higher discretization points

Hi @Dhormir,

A couple of points:

  1. I don’t think your set_initial_guess! function is correct. x is a matrix as input, but you are indexing only x[i]. And u_docp is a vector, but you are indexing u_docp[i, :].
  2. Your objective is @objective(docp_II, Max, x[end, 6]), but you haven’t set a start value for x[end, 6]. Ipopt uses the lower bound, which is 0.0, perturbed slightly into the interior of the domain, to give 1.0000000e-02 as the first iteration.

If I write your function as

function set_initial_guess!(model::GenericModel, u::Vector, x::Matrix)
    for i in 1:size(x, 1), j in 1:size(x, 2)
        set_start_value(model[:x][i, j], x[i, j])
    end
    for i in 1:length(u)
        set_start_value(model[:u][i], u[i])
    end
    return
end

Then Ipopt takes 201 iterations to solve the first problem, and 117 to solve the second.

1 Like