Graphics Programs Reference
In-Depth Information
to linear dependence.As aresult of the change, the search directionscease to be
mutually conjugate,sothat a quadraticform is not minimizedin n cycles any more.
This is not a significant loss since in practice F ( x ) is seldomaquadratic anyway.
Powell suggestedafew otherrefinements to speedupconvergence.Since they
complicate the bookkeeping considerably, we did not implement them.
powell
The algorithm for Powell's methodislistedbelow. It utilizes two arrays: df contains
the decreases of the meritfunctioninthe first n moves of a cycle, and the matrix u
stores the corresponding directionvectors v i (one vectorper column).
function [xMin,fMin,nCyc] = powell(h,tol)
% Powell's method for minimizing f(x1,x2,...,xn).
% USAGE: [xMin,fMin,nCyc] = powell(h,tol)
% INPUT:
% h = initial search increment (default = 0.1).
% tol = error tolerance (default = 1.0e-6).
% GLOBALS (must be declared GLOBAL in calling program):
%X=startingpoint
% FUNC = handle of function that returns f.
% OUTPUT:
% xMin = minimum point
% fMin = miminum value of f
% nCyc = number of cycles to convergence
global X FUNC V
if nargin < 2; tol = 1.0e-6; end
ifnargin<1;h=0.1;end
if size(X,2) > 1; X = X'; end % X must be column vector
n = length(X); % Number of design variables
df = zeros(n,1); % Decreases of f stored here
u = eye(n);
% Columns of u store search directions V
forj=1:30
%Allowupto30cycles
xOld = X;
fOld = feval(FUNC,xOld);
% First n line searches record the decrease of f
fori=1:n
V = u(1:n,i);
[a,b] = goldBracket(@fLine,0.0,h);
Search WWH ::




Custom Search