MATLAB Script:
close all
clear
clc
% Part (a)
x = linspace(5,6,100);
y = linspace(-4,-2,100);
[X,Y] = meshgrid(x,y);
f = X.^2 - 4*X + 2*X.*Y + 2*Y.^2 + 2*Y + 14;
figure, surf(X,Y,f), title('Surface Plot')
xlabel('X'), ylabel('Y'), zlabel('f(x)')
% Part (b)
x = linspace(0,10,100);
y = linspace(-4,-2,100);
[X,Y] = meshgrid(x,y);
f = X.^2 - 4*X + 2*X.*Y + 2*Y.^2 + 2*Y + 14;
v = [1.0 1.25 1.5 2 2.5 3];
figure, contour(X,Y,f,v,'ShowText','on')
xlabel('X'), ylabel('Y'), title('Contour Plot')
% Part (c)
f = @(x) x(1)^2 - 4*x(1) + 2*x(1)*x(2) + 2*x(2)^2 + 2*x(2) + 14; %
x(1) => X, x(2) => Y
x0 = [4 -4];
x = fminunc(f, x0); % gradient search
fprintf('Solution: X = %.4f, Y = %.4f\n', x(1), x(2))
fprintf('Minimum value of f(x) = %.4f\n', f(x))
Plots:
Output (For Part (c)):
Solution: X = 5.0000, Y = -3.0000
Minimum value of f(x) = 1.0000
1). For the function, f(x) X-4X+2XY+2Y2+2Y+14 a. Plot the surface function for X over [5 61, and ...
Please use matlab for the following problem I. For the function. /(x) -X-4X+2XY+2Y+2Y+14 a. Plot the surface function for X over [5 6]. and Y over [-4, -2]. ecolour plot for X over [O 101 and Yover [43] and values for the contours of V [1 1.25 1.5 22.5 3] c. Write an m-file to find the minimum of the function using the gradient descent method Use a starting value of [4, -4]. I. For the function. /(x) -X-4X+2XY+2Y+2Y+14 a....
Create a surface plot and a contour plot of the function z=(x-2)^2+2xy+y^2. Using the matlab
Problem 2: Create a surface plot and a contour plot of the function f(x, y) = xe-I(x-y2)*+y?] Where -2 x 2 and -2 < y s 2. Use a step size of 0.1. Add labels to the axis Problem 2: Create a surface plot and a contour plot of the function f(x, y) = xe-I(x-y2)*+y?] Where -2 x 2 and -2
6. Plot the 3D surface and contour levels of the following function: z(x, y)cos(2y-x) sin(2x) such that-π x π and-r y < π [10 marks] 7. Create a 5 x 5 random matrix M6 with elements ranging from 10 to 33. Using indexing, define the following arrays: An array containing all elements of M6 that are greater than 3 and smaller 6 marks] An array containing all elements of M6 that are negative or between 29 and 33. 6 marks...
how to do all the questions? 10 6 2.4) 4 -2 -8 -10 -10 -8 -2 The contour plot above shows the level curves of some surface given by the function z-f(x, y). At (-8,2) the green vectors e and w are tangential to the contour there, and the blue vectors are perpendicular to the green ones. Moreover, at any point (in the frame above), we know that oflàx > 0 Which of the following vectors could represent Vf(-8, 2)...
Using ONLY the program Mathematica! please and thank you! 5. Consider the monkey saddle fix, y) -x-3xy. Find the critical points of this function and then draw a contour diagram for fnear the unique critical point. Identify which level curves are positive and which are negative. (Try using the commands: ContourLabels All Contour:Shading → None. Also, experiment with graphing particular contour values using Contours -2, -1, 0, 1, 2, 3.5 where we have chosen some particular contour values. You should...
Answer the following questions using the function -3y f(x,y) = 2y2 + 1 Plot fíx, y) using filled.contour) Please include code for ths Buestion Thanks Answer the following questions using the function -3y f(x,y) = 2y2 + 1 Plot fíx, y) using filled.contour) Please include code for ths Buestion Thanks
Problem 8. (1 point) For the function f(x,y) = 4x² + 6xy + 2y”, find and classify all critical points. O A. (0,0), Saddle O B. (4,6), Saddle O C. (4,6), Relative Minimum OD. (0,0), Relative Minimum OE. (0,0), Saddle |(4,6), Relative Maximum
(1 point) Find the linearization of the function f(x,y) = 72 - 4x² – 2y at the point (3, 4). L(x,y) Use the linear approximation to estimate the value of f(2.9, 4.1) f(2.9, 4.1)
1. (25 points) The figure below shows the contour plot of f(x,y)-3 -1 - 2y+y. (Credit for the figure is due to UMich instructors.) 6.00U 6.000 1.5 1.0 0.5 0.0 0.5 1.0 1.5 6.000 2.0-1.5-1.0-0.5 0.0 0.5 1.0 1.5 (a) Find all critical points of f. There should be six. Mark them on the contour plot. (Think, but don't write, about how to guess the critical points from the contour plot.) (b) Find f-,) v(,),and fp()-fy(, y) (c) Try to...