Question: -3y 3 4 Exercise 2: consider the function f(x,y)=- x2 + y2 +1 The following MATLAB code finds the minimum of the function 1 f=@

 -3y 3 4 Exercise 2: consider the function f(x,y)=- x2 +

-3y 3 4 Exercise 2: consider the function f(x,y)=- x2 + y2 +1 The following MATLAB code finds the minimum of the function 1 f=@ (x,y) 5*y./(x.^2+y.^2+1); 2 fsurf (f, (-4,4), 'ShowContours','on'); fun = @(x) f(x(1),X (2)); x0 - [1; 1); 5 options = optimoptions ('fminunc', 'Algorithm', 'quasi-newton'); 6 options.Display = 'iter'; 7x, fval, exitflag, output) = fminunc(fun, x0, options); 8 fprintf("The solution is: ');fprintf("ig ',x); fprintf(' '); Line 1: defines the function (abstract definition) Line 2: plot 3D contour of the function Line 4: defines the starting point for the optimization algorithm Line 5: specifies the optimization options Line 7: run the function (minimization, unconstrained) a) Run the code in MATLAB. Show the graph and the results. b) Was the choice of the starting point a good choice? Discuss. c) What was the stopping criterion? d) Was the solution similar to what you found in Exercise 1? Discuss. Directives: Part 2 should be submitted as a word document. Answers should be clear and well commented. Deliverable: One word document

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 Databases Questions!