Documentation of objfletwell
Global Index (all files) (short | long)
| Local contents
| Local Index (files in subdir) (short | long)
Function Synopsis
ObjVal = objfletwell(Chrom, P1, P2)
Help text
OBJective function after FLETcher and PoWELL
This function implements the function after Fletcher and Powell
and a discretization of this objective function. The function
after Fletcher and Powell is highly multimodal and a
representative of nonlinear parameter estimation.
For the computation of this objective function two random matrices
A, B and a random vector alpha are used. Therefore the function is
not symmetric and the extrema are randomly distributed over the
search space. The random values of A, B and alpha are retrieved
by the private function getFletwellData.
This function was first introduced by Fletcher and Powell in:
Fletcher, R. and Powell, M.J.D., A rapidly convergent descent
method for minimization. Computer Journal, 6:163-168, 1963.
In connection with Evolution Strategies the function was used in:
Schwefel, H.-P., Numerische Optimierung von Computer-Modellen
mittels der Evolutionsstrategie, volume 26 of Interdisciplinary
Systems Research. Basel: Birkhaeuser, 1977, pp. 327-328.
Baeck, T., Evolutionary Algorithms in Theory and Practice.
New York-Oxford: Oxford University Press, 1996, pp. 143-144.
Syntax: ObjVal = objfletwell(Chrom, P1, P2)
Input parameters:
Chrom - Matrix containing the chromosomes of the current
population. Each row corresponds to one individual's
string representation.
If Chrom == [NaN xxx] or
Chrom == [NaN xxx yyy],
then special values will be returned, see Output parameters
xxx == 1 (or []) return boundaries
xxx == 2 return title
yyy == 0 return title of continuous variant
yyy == 1 return title of discrete variant
xxx == 3 return value of global minimum
P1 - (Optional) Number indicating which variant is used,
if Chrom is not NaN or [].
P1 = 1 use discrete version
P1 = 0 use continuous version
If P1 is omitted or P1 = [] the discrete version
is used (P1 = 1).
P2 - Additional parameter
Output parameters:
ObjVal - Column vector containing the objective values of the
individuals in the current population.
if called with
Chrom == [NaN xxx] or Chrom == [NaN xxx yyy],
then ObjVal contains
xxx == 1 (or []), matrix with the boundaries of
the varaibles
xxx == 2, text with the title of the function
yyy omitted: title of continuous variant
yyy = 0 title of continuous variant
yyy = 1 title of discrete variant
xxx == 3, value of global minimum
Examples:
% continuous variant of the function after Fletcher and Powell
>> objfletwell(Chrom)
% discrete variant of the function after Fletcher and Powell
>> objfletwell(Chrom, 1)
Author: Hartmut Pohlheim
History: 08.11.99 file created
Cross-Reference Information
|
This function is called by |
|
|
Listing of function objfletwell
function ObjVal = objfletwell(Chrom, P1, P2)
% Compute population parameters
[Nind, Nvar] = size(Chrom);
% check dimension
if Nvar > 20,
error('Number of variables must be equal or less than 20.');
end
% Define default values
doDiscr = 0; % use discrete variant
% Check size of Chrom and do the appropriate thing
% if Chrom is [], then reset to [NaN P1], P2
if isempty(Chrom),
if nargin < 2, P1 = []; end, if isempty(P1), P1 = 1; end
if nargin < 3, P2 = []; end, if isempty(P2), P2 = doDiscr; end
Chrom = [NaN, P1]; P1 = P2; Nind = 1;
end
% check the additional parameters
if nargin < 2, P1 = []; end, if isempty(P1), P1 = doDiscr; end, if P1 == 0, doDiscr = 0; end
% if Chrom is [NaN xxx] define size of boundary-matrix and others
if all([Nind == 1, isnan(Chrom(1))]),
% If only NaN is provided
if length(Chrom) == 1, option = 1;
else option = Chrom(2); end
% Default dimension of objective function
Dim = 10;
% return text of title for graphic output
if option == 2,
ObjVal = ['Fletcher/Powell function'];
if doDiscr == 1, ObjVal = [ObjVal, ' (discrete)']; end
% return value of global minimum
elseif option == 3, ObjVal = 0;
% define size of boundary-matrix and values
else
% lower and upper bound, identical for all n variables
ObjVal = repmat([-500; 500], [1 Dim]);
end
% compute values of function
else
% retrieve data
% A = (a_ij), B = (b_ij) are random matrices with
% -100 <= a_ij, b_ij <= 100 for i,j = 1:Nvar
% alpha = (alpha_i) is a random vector with
% -pi <= alpha_i <= pi for i = 1:Nvar
[A,B,alpha] = getFletwellData(Nvar);
% Fletcher and Powell:
% f: R^n --> N, x -> f(x)
% let yi = ceil(xi) for all i = 1:Nvar (ceil only for discrete variant)
% let beta_i = ceil(alpha_i) for all i = 1:Nvar (ceil only for discrete variant)
% for all i = 1:Nvar let
% Ai = sum of ( a_ij * sin(beta_j) + b_ij * cos(beta_j) ) for j = 1:Nvar
% Bi = sum of ( a_ij * sin(y_j) + b_ij * cos(y_j) ) for j = 1:Nvar
% let z = sum of (Ai - Bi)^2 for i = 1:Nvar
% f = ceil(z) (ceil only for discrete variant)
% n = Nvar, -500 <= xi <= 500
% global minimum at (xi) = (alpha) ; fmin = 0
if doDiscr == 1, Chrom = ceil(Chrom); alpha = ceil(alpha); end
Ai = A*sin(alpha)' + B*cos(alpha)';
Bi = zeros(Nind, Nvar);
for k = 1:Nind, Bi(k,:) = (A*sin(Chrom(k,:)') + B*cos(Chrom(k,:)'))'; end
ObjVal = sum((repmat(Ai,1,Nind)-Bi').^2)';
if doDiscr == 1, ObjVal = ceil(ObjVal); end
end
% End of function
% Private function
%
% GET DATA for FLETcher and PoWELL objective function
%
% This function retrieves the data for the function after
% Fletcher and Powell.
%
% Syntax: [A,B,alpha] = getFletwellData(Dim)
%
% Input Parameter:
% Dim - Number containg the dimension of the function. Default
% dimension is 20.
%
% Output Parameter:
% A - random matrix A of the function after Fletcher and Powell
% B - random matrix B of the function after Fletcher and Powell
% alpha - random vector alpha of the function after Fletcher and Powell
% Author: Hartmut Pohlheim
% History: 08.11.99 file created
function [A,B,alpha] = getFletwellData(Dim)
A = [
-79 56 -62 -9 92 48 -22 -34 -39 -40 -95 -69 -20 -66 -98 -66 -67 37 -83 -45;
91 -9 -18 -59 99 -45 88 -14 -29 26 71 -65 19 45 88 18 -11 -81 -10 42;
-38 8 -12 -73 40 26 -64 29 -82 -32 -89 -3 88 98 53 58 45 -39 34 -23;
-78 -18 -49 65 66 -40 88 -95 -57 10 -98 -11 -16 -55 33 84 21 -43 45 100;
-1 -43 93 -18 -76 -68 -42 22 46 -14 69 27 -12 -26 57 -13 0 1 56 17;
34 -96 26 -56 -36 -85 -62 13 93 78 -43 96 77 65 -34 -52 82 18 -59 -55;
52 -46 -69 99 -47 -72 -11 55 -55 91 -30 7 -35 23 -20 55 61 -39 -58 13;
81 47 35 55 67 -13 33 14 83 -42 8 -45 -44 12 100 -9 -33 -11 21 14;
5 -43 -45 46 56 -94 -62 52 66 55 -86 -29 -52 -71 -91 -46 27 -27 6 67;
-50 66 -47 -75 89 -16 82 6 -85 -62 -30 31 -7 -75 -26 -24 46 -95 -71 -57;
24 98 -50 68 -97 -64 -24 81 -59 -7 85 -92 2 61 52 -59 -91 74 -99 -95;
-30 -63 -32 -90 -35 44 -64 57 27 87 -70 -39 -18 -89 99 40 14 -58 -5 -42;
56 3 88 38 -14 -15 84 -9 65 -20 -75 -37 74 66 -44 72 74 90 -83 -40;
84 1 73 43 84 -99 -35 24 -78 -58 47 -83 94 -86 -65 63 -22 65 50 -40;
-21 -8 -48 68 -91 17 -52 -99 -23 43 -8 -5 -98 -17 -62 -79 60 -18 54 74;
35 93 -98 -88 -8 64 15 69 -65 -86 58 -44 -9 -94 68 -27 -79 -67 -35 -56;
-91 73 51 68 96 49 10 -13 -6 -23 50 -89 19 -67 36 -97 0 3 1 39;
53 66 23 10 -33 62 -73 22 -65 37 -83 -65 59 -51 -56 98 -57 -11 -48 88;
83 48 67 27 91 -33 -90 -34 39 -36 -68 17 -7 14 11 -10 96 98 -32 56;
52 -52 -5 19 -25 15 -1 -11 8 -70 -4 -7 -4 -6 48 88 13 -56 85 -65
];
B = [
-65 -11 76 78 30 93 -86 -99 -37 52 -20 -10 -97 -71 16 9 -99 -84 90 -18 -94;
59 67 49 -45 52 -33 -34 29 -39 -80 22 7 3 -19 -15 7 -83 -4 84 -60 -4;
21 -23 -80 86 86 -30 39 -73 -91 5 83 -2 -45 -54 -81 -8 14 83 73 45 32;
-91 -75 20 -64 -15 17 -89 36 -49 -2 56 -6 76 56 2 -68 -59 -70 48 2 24;
-79 99 -31 -8 -67 -72 -43 -55 76 -57 1 -58 3 -59 30 32 57 29 66 50 -80;
-89 -35 -55 75 15 -6 -53 -56 -96 87 -90 -93 52 -86 -38 -55 -53 94 98 4 -79;
-76 45 74 12 -12 -69 2 71 75 -60 -50 23 0 6 44 -82 37 91 84 -15 -63;
-50 -88 93 68 10 -13 84 -21 65 14 4 92 11 67 -18 -51 4 21 -38 75 -59;
-23 -95 99 62 -37 96 27 69 -64 -92 -12 87 93 -19 -99 -92 -34 -77 17 -72 29;
-5 -57 -30 -6 -96 75 25 -6 96 77 -35 -10 82 82 97 -39 -65 -8 34 72 65;
85 -9 -14 27 -45 70 55 26 -87 -98 -25 -12 60 -45 -24 -42 -88 -46 -95 53 28;
80 -47 38 -6 43 -59 91 -41 90 -63 11 -54 33 -61 74 96 21 -77 -58 -75 -9;
-66 -98 -4 96 -11 88 -99 5 5 58 -53 52 -98 -97 50 49 97 -62 79 -10 -80;
80 -95 82 5 -68 -54 64 -2 5 10 85 -33 -54 -30 -65 58 40 -21 -84 -66 -11;
94 85 -31 37 -25 60 55 -13 48 -23 -50 84 -71 54 47 18 -67 -30 5 -46 53;
-29 54 -10 -68 -54 -24 -16 21 32 33 -27 48 37 -61 97 45 -90 87 -95 85 67;
76 -11 -48 38 -7 86 -55 51 26 8 -96 99 69 -84 41 78 -53 4 29 38 16;
-8 48 95 47 39 -11 -72 -95 -17 33 65 96 -52 -17 -22 -15 -91 -41 -16 23 14;
92 87 63 -63 -80 96 -62 71 -58 17 -89 -35 -96 -79 7 46 -74 88 93 -44 52;
-21 35 16 -17 54 -22 -93 27 88 0 -67 94 -24 -30 -90 -5 -48 45 -90 32 -81;
-86 31 -80 -79 -5 11 -20 9 52 -38 67 64 -49 23 -86 39 -97 76 10 81 20
];
alpha = [ -2.7910, 2.5623, -1.0429, 0.5097, -2.8096, 1.1883, 2.0771, -2.9926, 0.0715, 0.4142, ...
-2.5010, 1.7731, 1.6473, 0.4934, 2.1038, -1.9930, 0.3813, -2.2144, -2.5572, 2.9449];
if isempty(Dim), Dim = 20; end
if any([Dim < 1, Dim > 20]), Dim = 20; end
A = A(1:Dim,1:Dim);
B = B(1:Dim,1:Dim);
alpha = alpha(1:Dim);
% End of private function
This document is part of
version 3.7 of the
GEATbx: Genetic and Evolutionary Algorithm Toolbox for use with Matlab -
www.geatbx.com.
The Genetic and Evolutionary Algorithm Toolbox is
not public domain.
© 1994-2005 Hartmut Pohlheim, All Rights Reserved,
(support@geatbx.com).