Question: a ) Take ( x 0 , y 0 ) = ( - 0 . 2 , 1 ) and find ( x 1 ,

a) Take (x0,y0)=(-0.2,1) and find (x1,y1) using the following formula:
(x1y1)=(x0y0)+hgradf(x0,y0),
where h is a small number, say h=0.1.
b) Use the same formula and find (x2,y2).
If we repeat the procedure, we will find a curve that leads us to the maximum. The graph
is khrown helow
In physics and engineering, we call these curves the gradient flow lines.
c) To find minimum, we should take steps in the opposite direction of gradf. This means that h is a
negative number. The following code in Matlab, gives the minimum point starting at (1,0.5).
f=a(x,y)(x-y.~2)**exp(-x.^2-y.~2);
fx=m(x,y)(1-22+2y*2)-}-2);
fy=a(x,y)-2(1+x-\mp@subsup{y}{}{\operatorname{exp}(-\mp@subsup{x}{}{-2}2-\mp@subsup{y}{}{-2});
x0=1;y0=0.5; h=-0.1;x=[x0,y0];
wh1le abs (fx(x0,y0))+aba(fy(x0,y0))>0.0001
x0=x0+b*fx(x0,y0);
y0=y0+t**y(x0,y0);
end
x=-2:0.1:2;
y=x';
inagesc(x,y,f(x,y),'alptadata',0.5)
bold on
plot(X(:,1),X(:,2),'color','r','LiseH1dth',1.5)
[X (end,1), X (end,2)]
Run the code and attach the graph to your solution. What is the minimum point of this
procedure?
a ) Take ( x 0 , y 0 ) = ( - 0 . 2 , 1 ) and find

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!