Hey there,

I am trying to optimize the welfare in MimiDICE2016 using the mitigation rate with OptiMimi and stayed closely to the description of OptiMimi here:

This is the code I used (m_opti is the DICE2016 model):

using OptiMimi

# setting up the optimization problem

function objective(model::Model)

m_opti[:welfare, :CUMCEMUTOTPER]

end

constraint = [model → sum(model.components[:emissions].Parameters.MIU) - 1]

optprob = problem(m_opti, [:emissions], [:MIU], [0.], [1.], objective, constraints=constraint)

# solving the optimization problem

(maxf, maxx) = solution(optprob, () → [0. for i in 1:100])

println(maxf)

println(maxx)

I get an error about the constraint that I am unsure how to solve:

TypeError: in keyword argument constraints, expected Array{Function,1}, got a value of type Array{var"#83#84",1}

And when I leave out the constraint, I get this error:

Cannot set parameter :MIU, the model already has an external parameter with this name. Use `update_param(m, param_name, value)`

to change the value, or use `set_param(m, comp_name, param_name, unique_param_name, value)`

to set a value for only this component.

I would be glad if you could help me with this, probably it’s just a minor problem.

Or could you guide me to a paper or so where you optimized a Mimi Model possibly also with another package than OptiMimi?

Thanks again for your awesome work on making these models open source usable!