1. Suppose f(x, y)-sin(r -y +2)+cos(y -3x) Write an M-file that will produce a l
ID: 3210262 • Letter: 1
Question
1. Suppose f(x, y)-sin(r -y +2)+cos(y -3x) Write an M-file that will produce a labeled contour plot for f(x,y) over the region a. b. Based on the contour plot you found in a. estimate the coordinates of one saddle point of the function in the region S defined in a. Mark the point using the Data Cursor 2. Let f(x,y)=sin(2x+y)-2cos(y-x). Write an M-file that will produce 15 labeled contour curves for f(x, y) over the square S= {(x,y) /0 Based on the contour plot you found in a. determine whether the function has any critical point in the square S defined in a. If there are any such points, provide estimates from the graph for their x and y coordinates and provide a justification from the graph as to whether these are relative maxima, minima or saddle points. Indicate your reasons as comments on the M-file and publish the contour plot and M-file. a. x 2.0 yS2) b.Explanation / Answer
% MATLAB code for part 1 a)
[X Y] = meshgrid(linspace(-2,2,100),linspace(-1,1,100));
fxy = sin(X-Y.^2+2)+cos(Y.^2-3*X);
contour3(X,Y,fxy);
% MATLAB code for part 2 a)
[X Y] = meshgrid(linspace(0,2,100),linspace(0,2,100));
fxy = sin(2*X+Y)-2*cos(Y-X);
contour3(X,Y,fxy,15);
2 b) From the contour plot we can observe that:
1. Function has a local minimum of -2.8 at x = 1.394, y = 1.293
2. Function has a local maximum of 1.46 at x = 0.06, y= 1.919
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.