ver_kh
November 8, 2021, 9:29am
1
Hello!
I’m trying to use GalacticOptim.jl with AmplNLWriter.jl optimizer but it’s not working.
using GalacticOptim, AmplNLWriter, Ipopt_jll
rosenbrock(x,p) = (p[1] - x[1])^2 + p[2] * (x[2] - x[1]^2)^2
x0 = zeros(2)
p = [1.0,100.0]
prob = OptimizationProblem(rosenbrock,x0,p)
optimizer = GalacticOptim.MOI.OptimizerWithAttributes(AmplNLWriter.Optimizer(Ipopt_jll.amplexe))
sol = solve(prob, optimizer)
println(sol)
Here I use Ipopt_jll just for example, but it’s not working even with it. Could you please help me to find an error?
Thank you
Can you open this as an issue on the repo?
odow
November 8, 2021, 5:52pm
4
AmplNLWriter requires the expression graph, which galacticoptim probably doesn’t provide.
Why not just use Ipopt directly via ipopt.jl?
ver_kh
November 8, 2021, 6:18pm
5
I used Ipopt here only as an example, to check whether it will work. But I’d like to use AmplNLWriter later with another local solver on my laptop.
1 Like
odow
November 8, 2021, 6:19pm
6
Use JuMP instead of galacticoptim
ver_kh
November 8, 2021, 6:39pm
7
Thank you for this recommendation. JuMP is very good but I thought that GalacticOptim and ModelingToolkit will be easier to use with nonlinearities.
odow
November 8, 2021, 6:44pm
8
We can just do it through MTK though
I remember MTK can find minima and maxima, but how is this combination for non-linear optimisation in general? I’m going to be taking an econ class, with a lot of optimisation of Cartesian planes.
odow
November 9, 2021, 1:33am
11
It might be best to start a new post for this. It’s unrelated to the ExprGraph problem.
1 Like