Electa-Git / PowerModelsACDC.jl

A hybrid AC/DC OPF package based on PowerModels.jl
BSD 3-Clause "New" or "Revised" License
52 stars 20 forks source link

Update to JuMP's new NL interface #83

Open matteorossini opened 7 months ago

matteorossini commented 7 months ago

JuMP v1.15 introduced a new interface for nonlinear optimization. This update improves the optimization process by eliminating the need for @NL macros and making the composition of objectives and constraints simpler. It is no longer necessary to separate them into linear and nonlinear versions.

PowerModels v0.21 has been updated to this new interface. See https://github.com/lanl-ansi/PowerModels.jl/pull/901.

Such a change should also be applied to PowerModelsACDC.

  1. Edit JuMP and PowerModels lines in Project.toml to

    JuMP = "1.15"
    PowerModels = "0.21"
  2. Rename the @NL macros:

    • @NLobjective --> @objective;
    • @NLconstraint --> @constraint;
    • @NLexpression --> @expression.

    While making these changes, review the code for any sections that differentiate between NL and non-NL models, and simplify them. Examples: https://github.com/lanl-ansi/PowerModels.jl/pull/901/files.