Re: Numerical Recipes (Fortran) Usenet ??
- From: monir <monirg@xxxxxxxxxxxx>
- Date: Sun, 16 Aug 2009 17:58:33 -0700 (PDT)
On Aug 14, 8:53 pm, Terence <tbwri...@xxxxxxxxx> wrote:
When there are boundary limitations on starting points for an
algorithm, see if you can multiply all input cooefficients and values
by a factor that brings the solution space within the boundary limits
where the algorithm is valid, yet still maintaining the direct
equivalence to the original functions and problem..
To: Arjen Markus;
=================
1) I've looked at different optimization libraries (netlib, Neumaier,
Miller, Burkardt, and others) with no luck in identifying a Fortran
routine that could be applied to the problem.
This doesn't necessarily mean that there's none there that could
easily (directly or indirectly) handle the problem. I just couldn't
identify a specific library/routine from the lists that satisfies the
following requirements:
a. Fortran optimization in multidimensions (n=3), global or local
b. uses both function and gradient information
c. restricts the search on the 3 independent variables to within
specified ranges of the variables
d. runs on Win XP OS, with g95 compiler
2) I had thought someone might have used a specific Fortran
optimization algorithm (satisfying a to d above) in solving a similar
problem and is willing to provide a direct reference.
To:David Duffy & Beliavsky;
===========================
2) The Fortran bobyqa optimization algorithm is a derivative-free
method and, from what I know, can not handle linear of nonlinear
constraints.
3) Not using the derivative information in this specific problem is a
disadvantage in my opinion. The 3D real function being considered is
ONLY defined on narrow and varying ranges of its 3 variables:
....x1:: X1L=-0.09 to X1U=-0.01
....x2:: X2L= 0.9595 to X2U= 1.0000
....x3:: X3L=-0.2503 to X3U=-0.1745
Hence I've to use everything I've got, i.e.; function and derivative.
4) In addition, there is the general consensus that in
multidimensional optimization, routines using the derivative are more
reliable than those using only the function. Some might disagree!
To: Terence;
============
5) Normalizing is a good and valid idea when dealing with out-of-range
single variable.
In a multi-variable multi-range case, there's no single factor that
could be applied and still be able to "maintain the direct equivalence
to the original functions and problem".
To: ALL;
========
6) I'm still of the opinion that the NR (Fortran) conjugate method sub
FRPRMN() is the way to go. I used the routine in the past on
unconstrained optimization problem and it worked perfectly.
The difficulty here is that the routine assumes the function (and
gradient) can be evaluated everywhere.
My attempts so far to restrict the value of:
....xx in sub LINMIN()
....xt() in f1dim() and df1dim()
....ulimit in mnbrak()
....other minor changes
have not been successful
It would be very appreciative and extremely helpful if one of the NR
(Fortran) 4 authors to suggest/approve any changes to their original
code. Something like: "... replace xt() with ..., change glimit
to ..., add common ..., replace statement ... by ..., and you're
done."
Here's an idea that should work; I think!
7) Let us leave the NR conjugate method sub FRPRMN() and its
subsidiary routines unchanged.
8) Since the goal is to locate a minimum within a specified space
(box), let us assume the function and derivative have the same values
outside the box as those values on the box boundaries.
9) This proposed approach SHOULD not interfere with locating the
minimum within the 3D restricted domain. There is a risk however.
The referenced method uses 1D inverse parabolic interpolation to
bracket the min. before isolating it, and hence the risk that 2 of the
3 abscissas might be identical (at the boundary of the interval). The
bracketing method would then (I suspect) fail. But it seems that this
scenario could only happen if the function has no minimum within the
interval in the search direction. If this turns out to be the case,
then one shouldn't be bracketing a minimum in the first place, and the
case is mute.
10) The implementation of the idea is rather straightforward.
a--> The function to be optimized is evaluated by, say:
.....value = FUNC(x1,x2,x3)
where x1,x2,x3 are the independent variables
b--> The limits on the variables are expressed as per 3. above:
....x1:: X1L=-0.09 to X1U=-0.01
....x2:: X2L= 0.9595 to X2U= 1.0000
....x3:: X3L=-0.2503 to X3U=-0.1745
c-->In both fixed-name user-supplied routines fun FUNC() and sub DFUNC
(,), one could introduce the following tests:
{keep in mind that one, two or all the 3 variables could be outside
the box}
If a variable is outside the box, DO NOT evaluate FUNC() and DFUNC(,)
at that point, and DO NOT re-assign the input out-of-range value of
the variable, but evaluate the function at the corresponding boundary.
For example:
....common /VarLmtRng/ X1L,X1U,X2L,X2U,X3L,X3U
....xa = x1
....xb = x2
....xc = x3
....if (x1 .LT. X1L) xa = X1L
....if (x1 .GT. X1U) xa = X1U
....if (x2 .LT. X2L) xb = X2L
....if (x2 .GT. X2U) xb = X2U
....if (x3 .LT. X3L) xb = X3L
....if (x3 .GT. X3U) xb = X3U
.....value = FUNC(xa,xb,xc)
d-->In theory, the above simple adjustments would also be valid in
cases where the function is defined everywhere but the optimization is
desired on specific ranges of the function variables.
Will try it and report back, if there is still interest.
Regards.
Monir
.
- Follow-Ups:
- Re: Numerical Recipes (Fortran) Usenet ??
- From: JB
- Re: Numerical Recipes (Fortran) Usenet ??
- From: Colin Paul Gloster
- Re: Numerical Recipes (Fortran) Usenet ??
- From: Eli Osherovich
- Re: Numerical Recipes (Fortran) Usenet ??
- From: Eli Osherovich
- Re: Numerical Recipes (Fortran) Usenet ??
- References:
- Numerical Recipes (Fortran) Usenet ??
- From: monir
- Re: Numerical Recipes (Fortran) Usenet ??
- From: e p chandler
- Re: Numerical Recipes (Fortran) Usenet ??
- From: monir
- Re: Numerical Recipes (Fortran) Usenet ??
- From: e p chandler
- Re: Numerical Recipes (Fortran) Usenet ??
- From: monir
- Re: Numerical Recipes (Fortran) Usenet ??
- From: David Duffy
- Re: Numerical Recipes (Fortran) Usenet ??
- From: Beliavsky
- Re: Numerical Recipes (Fortran) Usenet ??
- From: Terence
- Numerical Recipes (Fortran) Usenet ??
- Prev by Date: C by reference screws up character strings
- Next by Date: Re: Numerical Recipes (Fortran) Usenet ??
- Previous by thread: Re: Numerical Recipes (Fortran) Usenet ??
- Next by thread: Re: Numerical Recipes (Fortran) Usenet ??
- Index(es):
Relevant Pages
|
Loading