Escolar Documentos
Profissional Documentos
Cultura Documentos
edu
1.a
The computation for eigen vector and values are shown as follows
The corresponding contour plot is shown as
% script to plot the mesh plot and the contour plot for the function
% f(x) = +5*x1^2+10*x2^2
close all;
[x1,x2] = meshgrid(-10:0.2:10,-10:0.2:10);
f = 5*x1.^2+10*x2.^2;
figure;
meshc(x1,x2,f);
xlabel('x_1','FontSize',12);
ylabel('x_2','FontSize',12);
zlabel('f(x)','FontSize',12);
title('Mesh and Contour Plot of f(x) = 5*x1^2+10*x2^2',...
'FontSize',12);
legend('mesh plot');
hold on;
text(.1,-.1, 'The function has a minima at (x1,x2)=(0,0)', ...
'Units', 'normalized', ...
% Not depending on the data
'HorizontalAlignment', 'left', ...
'VerticalAlignment', 'bottom');%Remarks and Observation
plot(0,0,'k*');
%
figure;
contour(x1,x2,f,25);
hold on;
1b::
The computation for eigen vector and values are shown as follows
The corresponding contour plot is shown as
% script to plot the mesh plot and the contour plot for the function
% f(x) = +5*x1^2-10*x2^2
close all;
[x1,x2] = meshgrid(-10:0.2:10,-10:0.2:10);
f = 5*x1.^2-10*x2.^2;
figure;
meshc(x1,x2,f);
xlabel('x_1','FontSize',12);
ylabel('x_2','FontSize',12);
zlabel('f(x)','FontSize',12);
title('Mesh and Contour Plot of f(x) = 5*x1^2-10*x2^2',...
'FontSize',12);
legend('mesh plot');
hold on;
text(.1,-.1, 'The function has a minima at (x1,x2)=(0,0)', ...
'Units', 'normalized', ...
% Not depending on the data
'HorizontalAlignment', 'left', ...
'VerticalAlignment', 'bottom');%Remarks and Observation
plot(0,0,'k*');
%
figure;
contour(x1,x2,f,25);
hold on;
1 C.
The computation for eigen vector and values are shown as follows
The corresponding contour plot is shown as
% script to plot the mesh plot and the contour plot for the function
% f(x) = -5*x1^2-10*x2^2
close all;
[x1,x2] = meshgrid(-10:0.2:10,-10:0.2:10);
f = -5*x1.^2-10*x2.^2;
figure;
meshc(x1,x2,f);
xlabel('x_1','FontSize',12);
ylabel('x_2','FontSize',12);
zlabel('f(x)','FontSize',12);
title('Mesh and Contour Plot of f(x) = -5*x1^2-10*x2^2',...
'FontSize',12);
legend('mesh plot');
hold on;
text(.1,-.1, 'The function has a minima at (x1,x2)=(0,0)', ...
'Units', 'normalized', ...
% Not depending on the data
'HorizontalAlignment', 'left', ...
'VerticalAlignment', 'bottom');%Remarks and Observation
plot(0,0,'k*');
%
figure;
contour(x1,x2,f,25);
hold on;
% script to plot the mesh plot and the contour plot for the function
% f(x) = 5*x1^2
close all;
[x1,x2] = meshgrid(-10:0.2:10,-10:0.2:10);
f = 5*x1.^2;
figure;
meshc(x1,x2,f);
xlabel('x_1','FontSize',12);
ylabel('x_2','FontSize',12);
zlabel('f(x)','FontSize',12);
title('Mesh and Contour Plot of f(x) =5*x1^2',...
'FontSize',12);
legend('mesh plot');
hold on;
text(.1,-.1, 'The function has a Minima along x1=0 plane', ...
'Units', 'normalized', ...
% Not depending on the data
'HorizontalAlignment', 'left', ...
'VerticalAlignment', 'bottom');%Remarks and Observation
plot(0,0,'k*');
%
figure;
contour(x1,x2,f,25);
hold on;
Problem 2:
Here the upper surface represents the first function given f(x1,x2)=5*x1^2+10*x2^2 and the lower
surface represents the constraint surface 1-x1^2-x2^2. The solution lies in the bounded intersection of
these two surfaces. For lamda=0 corresponds to minimal point (0,0) which lies inside the boundry and
along the boundary the solution is given by eigen vector corresponding to minimal negative eigenvalue.
The same process can be generalized for the remaining cases
Problem 3.3
Problem 3.6