Reference

Contents

Index

LinearOperators.reset!Method
solver = reset!(solver::IpoptSolver, nlp::AbstractNLPModel)

Reset the solver with the new model nlp.

If nlp has different bounds on the variables/constraints or a different number of nonzeros elements in the Jacobian/Hessian, then you need to create a new IpoptSolver.

source
NLPModelsIpopt.ipoptMethod
output = ipopt(nlp; kwargs...)

Solves the NLPModel problem nlp using IpOpt.

For advanced usage, first define a IpoptSolver to preallocate the memory used in the algorithm, and then call solve!: solver = IpoptSolver(nlp) solve!(solver, nlp; kwargs...) solve!(solver, nlp, stats; kwargs...)

Optional keyword arguments

  • x0: a vector of size nlp.meta.nvar to specify an initial primal guess
  • y0: a vector of size nlp.meta.ncon to specify an initial dual guess for the general constraints
  • zL: a vector of size nlp.meta.nvar to specify initial multipliers for the lower bound constraints
  • zU: a vector of size nlp.meta.nvar to specify initial multipliers for the upper bound constraints

All other keyword arguments will be passed to Ipopt as an option. See https://coin-or.github.io/Ipopt/OPTIONS.html for the list of options accepted.

Output

The returned value is a GenericExecutionStats, see SolverCore.jl.

Examples

using NLPModelsIpopt, ADNLPModels
nlp = ADNLPModel(x -> sum(x.^2), ones(3));
stats = ipopt(nlp, print_level = 0)
using NLPModelsIpopt, ADNLPModels
nlp = ADNLPModel(x -> sum(x.^2), ones(3));
solver = IpoptSolver(nlp);
stats = solve!(solver, nlp, print_level = 0)
source
NLPModelsIpopt.ipoptMethod
ipopt(nls::AbstractNLSModel; kwargs...)

Solve the least-squares problem nls using IPOPT by moving the nonlinear residual to the constraints.

Arguments

  • nls::AbstractNLSModel: The least-squares problem to solve.

For advanced usage, first define an IpoptSolver to preallocate the memory used in the algorithm, and then call solve!: solver = IpoptSolver(nls) solve!(solver, nls; kwargs...)

Examples

using NLPModelsIpopt, ADNLPModels
nls = ADNLSModel(x -> [x[1] - 1, x[2] - 2], [0.0, 0.0], 2)
stats = ipopt(nls, print_level = 0)
source