Consider the function f R2 rightarrow R fx y 2e x22 y24 e

Consider the function f: R^2 rightarrow R, f(x, y) = -2e^- x^2/2 - y^2/4 - e^- (x - 4)^2/2 - (y - 3)^2/4. Create a Matlab function function y = f(x, y) that computes the function f. Draw the function in 3D and a contour plot of this function. Find the minimum point x* by using f mining, unconstrained minimization. The initial point of the algorithm is x0 = [0, 3]. Draw the optimal point x* on the contour plot. Repeat (ii) with x0 = [4, 6]. What can you observe? Provide an argument. Consider equality constraints, y - x/2 + 1 = 0. Plot the line y = x/2 - 1 and find the minimum point of the function f(x, y) by using minion. The initial point of the algorithm is x0 = [0, -3]. Draw this point on the contour plot. Repeat (iii) with different initial points. What can you observe? Provide an argument.

Solution

x=-10:0.5:10;

y=-10:0.5:10;

[X,Y]=meshgrid(x,y);

z=-2*exp(-(X.*X)/2-(Y.*Y)/4)-exp(-((X-4).*(X-4))/2-((Y-3).*(Y-3))/4);

surf(X,Y,z);

contour(X,Y,z);

 Consider the function f: R^2 rightarrow R, f(x, y) = -2e^- x^2/2 - y^2/4 - e^- (x - 4)^2/2 - (y - 3)^2/4. Create a Matlab function function y = f(x, y) that co

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site