5 views

Uploaded by Alwin Anno Sastra

- Asian Catalouge
- MSCS Test Sample
- CFD
- hw2
- Group Tech
- Cal Spring 09 Final
- Ajantha S. Atukorale and P.N. Suganthan- Hierarchical overlapped neural gas network with application to pattern classification
- Binder 8
- Assignment Problem PDF
- State Space Design Continuous
- Bab 06 - Seq Mining - Part 1
- BCJR
- חישוב מבוזר- הרצאה 4 | 2012
- Chapter 21sdasda
- Covering Letter 2009 A
- Hsslive Higher Secondary XII Exam March 2019 Time Table
- Tutorial 01
- Understanding Linear Feedback Shift Registers – the Easy Way
- GUC Enrolled Students Midterm Schedule Winter 2012
- ch12-Query Processing.ppt

You are on page 1of 2

%---------------------------------------------------------------------------

%NELDER Nelder-Mead method to search for a minimum.

% Sample call

% [V0,y0,dV,dy,P,Q] = nelder('Fn',V,min1,max1,epsilon,1)

% Inputs

% Fn name of the vector function

% V starting simplex

% min1 minimum number of iterations

% max1 maximum number of iterations

% epsilon convergence tolerance

% show if show==1 the iterations are displayed

% Return

% V0 vertex V0 for the minimum

% y0 function value Fn(V0)

% dV size of the final simplex

% dy error bound for the minimum

% P matrix containing the vertices in the iterations

% Q array containing iterations for F(P)

%

% NUMERICAL METHODS: MATLAB Programs, (c) John H. Mathews 1995

% To accompany the text:

% NUMERICAL METHODS for Mathematics, Science and Engineering, 2nd Ed, 1992

% Prentice Hall, Englewood Cliffs, New Jersey, 07632, U.S.A.

% Prentice Hall, Inc.; USA, Canada, Mexico ISBN 0-13-624990-6

% Prentice Hall, International Editions: ISBN 0-13-625047-5

% This free software is compliments of the author.

% E-mail address: in%"mathews@fullerton.edu"

%

% Algorithm 8.2 (Nelder-Mead's Minimization Method).

% Section 8.1, Minimization of a Function, Page 414

%---------------------------------------------------------------------------

if nargin==5, show = 0; end

if show==1,

Mx1 = 'Nelder-Mead search iteration No. ';

Mx2 = ' p q f(p,q)';

clc;

diary output,disp(' '),disp(' '),....

disp(Mx1),disp(Mx2),disp(' '),diary off;

end

[mm n] = size(V);

for j =1:n+1,

Z = V(j,1:n);

Y(j) = feval(Fn,Z);

end

[mm lo] = min(Y); % Order the vertices:

[mm hi] = max(Y);

li = hi;

ho = lo;

for j = 1:n+1,

if (j~=lo & j~=hi & Y(j)<=Y(li)), li=j; end

if (j~=hi & j~=lo & Y(j)>=Y(ho)), ho=j; end

end % End of Order.

cnt = 0;

while (Y(hi)>Y(lo)+epsilon & cnt<max1) | cnt<min1

% The main while loop has started.

S = zeros(1,1:n); % Form the new points:

for j = 1:n+1,

S = S + V(j,1:n);

end

M = (S - V(hi,1:n))/n; % Construct vertex M:

R = 2*M - V(hi,1:n); % Construct vertex R:

yR = feval(Fn,R);

if (yR<Y(ho)),

if (Y(li)<yR),

V(hi,1:n) = R; % Replace a vertex:

Y(hi) = yR;

else

E = 2*R - M; % Construct vertex E:

yE = feval(Fn,E);

if (yE<Y(li)),

V(hi,1:n) = E; % Replace a vertex:

Y(hi) = yE;

else

V(hi,1:n) = R; % Replace a vertex:

Y(hi) = yR;

end

end

else

if (yR<Y(hi)),

V(hi,1:n) = R; % Replace a vertex:

Y(hi) = yR;

end

C = (V(hi,1:n)+M)/2; % Construct vertex C:

yC = feval(Fn,C);

C2 = (M+R)/2; % Construct vertex C2:

yC2 = feval(Fn,C2);

if (yC2<yC),

C = C2; % Replace a vertex:

yC = yC2;

end

if (yC<Y(hi)),

V(hi,1:n) = C; % Replace a vertex:

Y(hi) = yC;

else

for j = 1:n+1, % Shrink the simplex:

if (j~=lo),

V(j,1:n) = (V(j,1:n)+V(lo,1:n))/2;

Z = V(j,1:n);

Y(j) = feval(Fn,Z);

end

end % End of Shrink.

end

end % End of Improve.

[mm lo] = min(Y); % Order the vertices:

[mm hi] = max(Y);

li = hi;

ho = lo;

for j = 1:n+1,

if (j~=lo & j~=hi & Y(j)<=Y(li)), li=j; end

if (j~=hi & j~=lo & Y(j)>=Y(ho)), ho=j; end

end % End of Order.

cnt = cnt+1;

P(cnt,:) = V(lo,:);

Q(cnt) = Y(lo);

format long; % Print iteration and plot 2-dim case.

if show==1,

diary output,disp([V(lo,:),Y(lo)]),diary off;

XS = V(1:n+1,1)'; XSL = [XS,XS(1)];

YS = V(1:n+1,2)'; YSL = [YS,YS(1)];

hold on;

plot(XS,YS,'or',XSL,YSL,'-g');

hold off;

figure(gcf);

end;

end % End of the main while loop.

hold off;

snorm = 0; % Determine the size of the simplex:

for j = 1:n+1,

s = norm(V(j)-V(lo));

if (s>=snorm), snorm = s; end

end

Q = Q';

V0 = V(lo,1:n);

y0 = Y(lo);

dV = snorm;

dy = abs(Y(hi)-Y(lo));

- Asian CatalougeUploaded byarunscholar
- MSCS Test SampleUploaded byShan Shani
- CFDUploaded byAgung Kurniawan
- hw2Uploaded bykalaputra
- Group TechUploaded bybharathk_37
- Cal Spring 09 FinalUploaded byjoediola
- Ajantha S. Atukorale and P.N. Suganthan- Hierarchical overlapped neural gas network with application to pattern classificationUploaded byTuhma
- Binder 8Uploaded byJuan Carlos Lafuente
- Assignment Problem PDFUploaded byC V CHANDRASHEKARA
- State Space Design ContinuousUploaded byOscarPulido
- Bab 06 - Seq Mining - Part 1Uploaded byMochammad Adji Firmansyah
- BCJRUploaded bygemechu
- חישוב מבוזר- הרצאה 4 | 2012Uploaded byRon
- Chapter 21sdasdaUploaded byRashid Anzoom
- Covering Letter 2009 AUploaded bynadiayy
- Hsslive Higher Secondary XII Exam March 2019 Time TableUploaded byJohn Mac
- Tutorial 01Uploaded byAndrew Ip
- Understanding Linear Feedback Shift Registers – the Easy WayUploaded byrockymaxdeemann
- GUC Enrolled Students Midterm Schedule Winter 2012Uploaded bygucinsider
- ch12-Query Processing.pptUploaded byFirdous Kausar
- IRTUploaded byKanyapus Janthong
- B.Tech_4-1_R10Uploaded byBalaji Devireddy
- MAK539EChapter3Uploaded byGökhan Günay
- two_level_Q_MUploaded bykholdude
- A Solving Method of Two Economical Problems Using Linear Programming in Integer NumbersUploaded byCatalin
- OtsuUploaded byloko8585
- csUploaded byvinodraghu
- DKMP 2014Uploaded byCS & IT
- cspUploaded byEloy Vega
- INFMDPUploaded byAloke Chatterjee

- KAK 408 - TasikUploaded byAlwin Anno Sastra
- Ba PenjelasanAUploaded byAlwin Anno Sastra
- new1Uploaded byAlwin Anno Sastra
- GAMBAR INSTALASI LISTRIKUploaded byAlwin Anno Sastra
- Optimum Design of a Hybrid Renewable Energy SystemUploaded byAlwin Anno Sastra
- tugasakuUploaded byAlwin Anno Sastra
- GAUploaded bykarunamcs
- Mat Lab DemoUploaded byAlwin Anno Sastra
- Optimalisasi Jumlah Unit DG Terbarukan Pada Jaringan DistribusiUploaded byAlwin Anno Sastra
- BiL_AcakUploaded byVicky Malino
- mhUploaded byAlwin Anno Sastra
- 978-3-933146-19-9.volltext.freiUploaded byAlwin Anno Sastra
- 2Uploaded byAlwin Anno Sastra
- Suport Brones Contant LoadUploaded byAlwin Anno Sastra
- Tugas 3 Bagian DUploaded byAlwin Anno Sastra
- DAFTAR ISI.docxUploaded byAlwin Anno Sastra
- 2_KOESPIADIUploaded byAlwin Anno Sastra
- bahan1Uploaded byAlwin Anno Sastra
- Electrical Grounding and SafetyUploaded byAlwin Anno Sastra
- Cara Instal Ms.officeUploaded byAlwin Anno Sastra
- Paper 2Uploaded byKumarGovindan
- Cara Meng-uninstal ProgramUploaded byAlwin Anno Sastra
- Cara Install UlangUploaded byAlwin Anno Sastra
- Ref presentasi.docUploaded byAlwin Anno Sastra
- MaintenanceUploaded byAlwin Anno Sastra
- analisis 1Uploaded byAlwin Anno Sastra
- Cara Memback -Up RecoveryUploaded byAlwin Anno Sastra
- Abs TrakUploaded byAlwin Anno Sastra
- 3eeeb3875555614_ekUploaded byAhmadinijad
- lec1Uploaded byAlwin Anno Sastra

- Decision TreeUploaded byabdi
- Fuck you scribdUploaded byGeoffrey Liu
- eccodes.pdfUploaded byAli khan7
- intro-numbertheory-pretest.pdfUploaded byAshim Sinha
- BC Chapter 8Uploaded byaw aw
- Differential EquationsUploaded byRyan Mills
- 6 Algorithms NCITUploaded bySukhachandra Thakur Bhumihaar
- C3 Differentiation - Implicit DifferentiationUploaded byDwi Pradnyana
- 2009 CJCUploaded byLim Kew Chong
- Laboratory1 - Algorithm Pseudocode FlowchartUploaded byDivine Vine
- An Introduction to Numerical Methods for the Solutions of Partial Differential EquationsUploaded byeiro
- dialUploaded byCarlos Romero
- H6Uploaded bygroziol
- Learn More About Engineering MathematicsUploaded byCrystal King
- 5. Number Properties - FinalUploaded byAbhy Singh
- Assessing the Role of Network Topology in Transportation Network ResilienceUploaded bysatare
- a unified approach to boundary value problems - fokas.pdfUploaded byEdgar Alejandro
- Analyzing the Polynomial 'Shadow Function'Uploaded byRukmal Weerawarana
- POP.pdfUploaded byABC
- Topological Signal ProcessingUploaded byGeorge Rangnahahbilmangoyumdidahmgeh
- Math114-08-W12Uploaded byFebrianto Chow Mien
- functional_analysis_master.pdfUploaded byrapsjade
- Evaluating Double IntegralsUploaded byVinod Mogan
- VectorsUploaded bydebrichsz
- IntervalUploaded byJo Kont
- IJMTT-V54P519Uploaded byJose
- csialgebrastemprojectunittherealnumbersUploaded byapi-213793181
- IntroductionUploaded byAhmad Syukur AHmad
- Simplex Method for Fuzzy Variable Linear Programming ProblemsUploaded byNurroo Ainee
- Simple Fast Algorithms for the Editing Distance Between Tree and Related ProblemsUploaded byEmil Stenqvist