Skip to content

LoadError: MethodError: no method matching Optim.IPNewtonState #1019

@dhathri-auburn

Description

@dhathri-auburn

Hello,
I am new to Optim.jl and Julia in general. But, I am trying to implement an NLP program for a collocation scheme using this package and the IPNewton solver within this package. I get this error complaining about IPNewtonState method not being matched/found.

Here is the full error:
ERROR: LoadError: MethodError: no method matching Optim.IPNewtonState(::Matrix{Real}, ::Int64, ::Matrix{Real}, ::Matrix{Real}, ::Float64, ::Matrix{Real}, ::Int64, ::Vector{Int8}, ::Matrix{Real}, ::Int64, ::Int64, ::Float64, ::Float64, ::Optim.BarrierStateVars{Float64}, ::Optim.BarrierStateVars{Float64}, ::Optim.BarrierStateVars{Float64}, ::Vector{Float64}, ::Matrix{Float64}, ::Float64, ::Matrix{Real}, ::Int64, ::Optim.BarrierLineSearchGrad{Float64}, ::Matrix{Real}, ::Int64) Closest candidates are: Optim.IPNewtonState(::Tx, ::T, ::Tx, ::Tx, ::T, ::Matrix{T}, ::Any, ::Vector{Int8}, ::Tx, ::T, ::T, ::T, ::T, ::Optim.BarrierStateVars{T}, ::Optim.BarrierStateVars{T}, ::Optim.BarrierStateVars{T}, ::Vector{T}, ::Matrix{T}, ::T, ::Tx, ::T, ::Optim.BarrierLineSearchGrad{T}, ::Tx, ::Any) where {T, Tx} at C:\Users\dhs0020\.julia\packages\Optim\Zq1jM\src\multivariate\solvers\constrained\ipnewton\ipnewton.jl:53
And here is the code snippet that invokes the IPNewton solver:

`using Optimization, OptimizationMOI, OptimizationOptimJL, Ipopt
using ForwardDiff, ModelingToolkit

function optimizer(X0, params, lb, ub, lcons, ucons)
objective = OptimizationFunction(cost, Optimization.AutoForwardDiff(), cons = constraints)
collocation_params = create_common_parameters_for_collocation()
merge!(params, collocation_params)
problem = Optimization.OptimizationProblem(objective, X0, params, lb = lb, ub = ub, lcons = lcons, ucons = ucons)

# sol = solve(problem, IPNewton(), maxiters = 1; show_trace = true, show_every = 1)
sol = solve(problem, IPNewton())

return sol

end`

I appreciate any help provided to get past this issue.

Thanks,
Dhathri

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions