coin-or/Ipopt

How can I set start point with command line?

rlacjfjin opened this issue · 7 comments

As title,
now I have a problem file, named as my_model.nl
and I can know the initial (part) solution of the model, in julia I can use set_start_value() function to do it, but now I want to use command line in wondws powershell.
Is there any method to do it?

Thanks.

When running Ipopt on an .nl file, it reads the starting point from the .nl file. There is no mechanism to read a separate file.
So I would suggest you modify the program that created the .nl file to write a different starting point.

But if you don't mind changing the code, then this is the place where Ipopt's AMPL interface passes the starting point from the .nl file to Ipopt:

if( init_x )
for( Index i = 0; i < n; i++ )
{
x[i] = havex0[i] ? X0[i] : Max(LUv[2 * i], Min(LUv[2 * i + 1], 0.0));
}

You could modify this to read a point from a file, I suppose.

I don't really know much about the specification of the nl file, and I only know that the initial value information is included in the nl file through your reply!
My current nl file is exported from julia's JuMP;
Do you know how to convert an NL file to an MPS file? I know the model is bilinear model, and it can be written as mps or lp file.
Or can you suggest a relevant link to the NL file specification?
By the way, I try julia JuMP to convert nl file to mps file, such as :
model = read_from_file("my_model.nl")
write_to_file(model,"my_model.mps")
It has some errors:
MathOptInterface.UnsupportedAttribute{MathOptInterface.NLPBlock}: Attribute MathOptInterface.NLPBlock() is not supported by the model.

Thanks.

The standard reference for the nl file format is https://ampl.github.io/nlwrite.pdf

I would use SCIP to read an nl and write a MPS or LP file. It may have the same problem as Julia, though, where it doesn't immediately recognize that the nonlinear part is quadratic. Doing a presolve, with option presolving/maxrounds=0, and writing the presolved problem may work, though.

Ok,
Then I try to presolve using scip with option presolving/maxrounds=0, there are such informations:
image
is it means that my original problem is infeasible?

And I still write my presolved problem with mps file:
image
there are some warning, but it seems can solved, and the feasible solution is same as the orginal problem.

I think my original model has some numerical problems.
are you interested in this issue with my original problem?
I can share my problem.
Thanks

is it means that my original problem is infeasible?

No, it only means that the initial point in the .nl file is not feasible, but this is ok.

there are some warning, but it seems can solved, and the feasible solution is same as the orginal problem.

you may want to check the mps carefully. maybe it skipped printing some constraints

are you interested in this issue with my original problem?

not so much

Thanks for your help.