... hàm==− − +− 22 1 12 122 zf(x,y)x xx 4x x x lân cận [0 0] tadùng chương trìnhctneldermead.m:clearall,clcf=inline(ʹx(1)*x(1)‐x(1)*x (2) ‐4*x(1)+x (2) *x (2) ‐x (2) ʹ);x0=[00]; ... 384x=x(:).ʹ;I=eye(n);forn=1:ng(:,n)=(feval(f,x+I(n,:)*h)‐feval(f,x‐I(n,:)*h))ʹ/h2;endĐểtìmcựctiểucủahàmbằngphươngphápNewtonstadùng chương trìnhctnewtons.m:clearall,clcf=inline(ʹx(1). ^2 ‐x(1)*x (2) ‐4*x(1)+x (2) . ^2 ‐x (2) ʹ);g=inline(ʹ[ (2* x(1)‐x (2) ‐4)( 2* x (2) ‐x(1)‐1)]ʹ);x0=[0.10.1];tolx=1e‐4;maxiter=100;[xo,fo]=newtons(g,x0,tolx,maxiter)§7.PHƯƠNGPHÁPGRADIENTLIÊNHỢP1.Kháiniệmchung:Mộttrongcácphươngphápgiảibàitóntìmcựctiểucủahàmnhiềubiếnlàtìmcựctiểutheomộtbiếnliêntiếpđểđếngầnđiểmcựctiểu.Chiếnthuậtchunglà: ... •cậpnhật[xk]chođếnkhihộitụTaxâydựnghàmconjugate()đểthựchiệnthuậttoántrên:function[xo,fo]=conjugate(f,x0,tolx,tolfun,alpha0,maxiter,KC)%KC=1:PhuongphapgradientlienhopPolak–Ribiere%KC= 2: PhuongphapgradientlienhopFletcher–Reevesifnargin<7KC=0;endifnargin<6maxiter=100;endifnargin<5alpha0=10;endifnargin<4tolfun=1e‐8;endifnargin<3tolx=1e‐6;endn=length(x0);nmax1= 20 ;warning=0;h=1e‐4;x=x0;fx=feval(f,x0);fx0=fx;fork=1:maxiterxk0=x;fk0=fx; 370CHƯƠNG 8: TỐI ƯU HOÁ §1.KHÁINIỆMCHUNGVỀTỐI ƯU HOÁ...