View Full Version : ¿fmincon in IMSL?

Peter

06-13-2012, 10:15 AM

Hello,

I would like to solve the following problem with the IMSL library:

Min F(x)

Subject to:

A1 X = B1

A2 X < B2

c(x) <0

ceq(x)=0

It's just the same that "fmincon" of Matlab. I know that I can do the first part with LCONF

Min F(x)

Subject to:

A1 X = B1

A2 X < B2

but not the last constraines. I can do

Min F(x)

Subject to:

c(x) <0

ceq(x)=0

with NNLPF, but it don't accept the matrix equalities/inequalities.

Do you know another function to use both?

Thank you very much.

Kind Regards

mecej4

06-15-2012, 05:13 PM

with NNLPF, but it don't accept the matrix equalities/inequalities.

It certainly will, but you have to cast the linear constraints into the same form as the nonlinear constraints, possibly at the cost of some loss of efficiency. You regain some control over the efficiency if you use NNLPG -- the gradient of the linear constraints is a constant matrix. Note that we are not considering large scale problems with sparse gradient matrices.

Routines that allow you specify the linear and nonlinear parts separately, and in addition specify box constraints as yet another group of constraints, exist outside of IMSL. Examples are the SOL routines such as NPSOL from SOL (Stanford Optimization Laboratory) and the equivalents of those in the NAG Fortran Library.

Richard Hanson

06-16-2012, 07:45 AM

As suggested, this formulation will allow combining linear and non-linear constraints. Call the combined constraints non-linear but take advantage of the linear parts during gradient evaluation. Use NNLPG and not NNLPF. This will require computing partials of c(x) and ceq(x). Scaling of the partials may have to be considered.

NPSOL from SOL requires a license. The terms are on their web page. Same with NAG.

If the number of variables is very large, these comments will have to be modified accordingly.

Peter

06-18-2012, 06:14 AM

Thank you for your replies.

I have been using NNLPF, but the problem is that the amount of data that I have to use is much greater than the data that the function can handle(TERMINAL ERROR 13). I could handle that amount of data with the function LCONF.

I don't know if using NNLPG is a good idea because the constraints that I am using are just data, they are not functions so the gradient does not make sense.

"If the number of variables is very large, these comments will have to be modified accordingly. "

Actually the number of variables is huge so, Should I take care in anything else?

Thank you again

mecej4

06-18-2012, 06:36 AM

If the number variables is "huge", you have a large scale optimization problem. You should look for a suitable optimization package; specifically, you need one that exploits sparseness in the matrices. An excellent guide are the Web pages of Prof. Hans Mittelmann, http://plato.asu.edu/guide.html.

Peter

06-19-2012, 12:58 AM

Would be LANCELOT B a good tool for my problem?

mecej4

06-19-2012, 05:38 AM

Possibly. It is a large and complex package, and can be difficult to build if you do not have one of the supported compiler/OS combinations. It is licensed, but free if you qualify.

All that we know about your problem is that it is "huge". That hardly gives enough information to select an algorithm or package. There are several commercial packages (Knitro, Mosek, ...) that you may want to try; most of them provide you with a time-limited trial.

IMSL itself has a good large scale linear/quadratic programming capability. Perhaps you can use it in combination with some other algorithm.

Peter

06-20-2012, 01:11 AM

Thank you mecej4 for your answer. I have written to the webpage of LANCELOT B and they have told me that if I have a big number of constraints I sholud try with Ipopt. Would you recommend it? It's true that I have not given enough information.

Basically I am trying to solve an optimization problem related to antennas like:

Min F(x)

Subject to:

A X < B

ceq(x)=0

I have computed a function which depends on the direction of the space that you are evaluating (that's why I have a "huge" number of constraints, I have a lot of "possible directions").

Depending of the direction, I want to minimize the power radiated on that direction:

a1 X < Alfa

a2 X < Alfa

...

The function to be minimized is Alfa, so I am saying to the method that in all the directions that I have selected the power has to be less than Alfa, and I want to find x that minimize that value.

The ceq(x)=0 is because the x that I am looking for is complex, in some cases it's interesting that x has abs(x) =1 so the function ceq(x)

ceq(x)=0---> abs(x)-1=0

Thanks again

mecej4

06-20-2012, 02:23 AM

You may profit from trying out different packages on a smaller problem of the same characteristics as the full problem.

There is a simple way of handling the constraint that the x should be complex valued quantities with unit modulus. In place of each x, use a real variable θ with x = cos θ + i sin θ. If you have n such variables, you reduce the number of real equality constraints by 2n by using this transformation.

Peter

06-20-2012, 02:53 AM

I have tried that too, the problem is that if I want to use nonlinear constraints, I can not use the functions of IMSL that I was used to (LCONF cause it can not handle nonlinear constraints, and NNLPF cause it can not handle too many constaints) that's why I am looking for a new function of minmization.

Thanks again

Powered by vBulletin® Version 4.2.3 Copyright © 2019 vBulletin Solutions, Inc. All rights reserved.