Graphics Programs Reference
In-Depth Information
[s,fMin] = goldSearch(@fLine,a,b);
df(i) = fOld - fMin;
fOld = fMin;
X=X+s*V;
end
%Lastlinesearchinthecycle
V=X-xOld;
[a,b] = goldBracket(@fLine,0.0,h);
[s,fMin] = goldSearch(@fLine,a,b);
X=X+s*V;
% Check for convergence
if sqrt(dot(X-xOld,X-xOld)/n) < tol
xMin=X;nCyc=j;return
end
%Identifybiggestdecreaseoff&updatesearch
% directions
iMax=1;dfMax=df(1);
fori=2:n
if df(i) > dfMax
iMax = i; dfMax = df(i);
end
end
fori=iMax:n-1
u(1:n,i) = u(1:n,i+1);
end
u(1:n,n) = V;
end
error('Powell method did not converge')
functionz=fLine(s)%FinthesearchdirectionV
global X FUNC V
z = feval(FUNC,X+s*V);
EXAMPLE 10.3
Find the minimum of the function 22
x 2 ) 2
x ) 2
F
=
100( y
+
(1
22
FromShoup,T.E., and Mistree, F. , OptimizationMethodswithApplications for Personal Computers ,
Prentice-Hall, 1987.
Search WWH ::




Custom Search