% Created by Dr. Nishant Malik for Math 233, Fall Semester 2012 at UNC-Chapel Hill.
% Graph of Cobb-Douglas Production function and its contour curves. Filename : prg5.m
% Ref: Chapter 14 Section 14.1 in Calculus Early Transcendentals 6E by James Stewart


% Generate a meshgrid for variable K = Capital and L=Labour per person


[K,L]=meshgrid(0:10.0:300);


% Equation for P=production; in terms of K and L

P=1.01.*L.^0.75.*K.^0.25;

% Plot the surface for P in 3-D
surf(L,K,P)


% Improving the visualization :
% Change the colourmap from default "jet" to "spring"

colormap(spring)

% Change the shading to interpolated
shading interp

% Putting the graph into a box
box on

% Set the viewing angle

view(60,20)

% Generate another figure with contour curves of the above Cobb-Douglas Production function
% New figure
figure()

% Contour curves for the production function
[c,h]=contour(L,K,P);

% Labeling the contour curves
clabel(c,h);
% Created by Dr. Nishant Malik for Math 233, Fall Semester 2012 at UNC-Chapel Hill.
% Graph and Contour curves. Filename : prg6.m
% Ref: Chapter 14 Section 14.1 in Calculus Early Transcendentals 6E by James Stewart


% Generate a meshgrid for variable x and y

[x,y]=meshgrid(-1.0*pi:0.1:pi);

% Equation of the graph to be plotted

z=(x.^2+3*y.^2).*exp(-1.0.*x.^2-y.^2);

% Plot the surface for z in 3-D
surf(x,y,z)


% Improving the visualization :
% Change the colourmap from default "jet" to "winter"

colormap(winter)

% Change the shading to interpolated
shading interp

% Putting the graph into a box
box on

% Set the viewing angle

view(60,20)

% Generate another figure with contour curves of the above Cobb-Douglas Production function
% New figure
figure()

% Contour curves for the production function
[c,h]=contour(x,y,z);

% Labeling the contour curves
clabel(c,h);
% Created by Dr. Nishant Malik for Math 233, Fall Semester 2012 at UNC-Chapel Hill.
% Graph and Contour curves. Filename : prg7.m
% Ref: Chapter 14 Section 14.1 in Calculus Early Transcendentals 6E by James Stewart


% Generate a meshgrid for variable x and y

[x,y]=meshgrid(-2.5*pi:0.5:2.5*pi);

% Equation of the graph to be plotted

z=(sin(x).*sin(y))./(x.*y);;

% Plot the surface for z in 3-D
surf(x,y,z)


% Improving the visualization :
% Change the colourmap from default "jet" to "hsv"

colormap(hsv)

% Change the shading to interpolated
shading interp

% Putting the graph into a box
box on

% Set the viewing angle

view(60,20)

% Generate another figure with contour curves of the above Cobb-Douglas Production function
% New figure
figure()

% Contour curves for the production function
[c,h]=contour(x,y,z);

% Labeling the contour curves
clabel(c,h);
% Created by Dr. Nishant Malik for Math 233, Fall Semester 2012 at UNC-Chapel Hill.
% Graph and Contour curves. Filename : prg8.m
% Ref: Chapter 14 Section 14.1 in Calculus Early Transcendentals 6E by James Stewart


% Generate a meshgrid for variable x and y

[x,y]=meshgrid(-3.0:0.1:3.0);

% Equation of the graph to be plotted

z=1.0-(x.^2.0+y.^2.0);

% Plot the surface for z in 3-D with its contour curves included in the same figure
surfc(x,y,z)


% Improving the visualization :
% Change the colourmap from default "jet" to "copper"

colormap(copper)

% Change the shading to interpolated
shading interp

% Putting the graph into a box
box on

% Set the viewing angle

view(60,20)

% Generate another figure with contour curves of the above Cobb-Douglas Production function
% New figure
figure()

% Contour curves for the production function
[c,h]=contour(x,y,z);

% Labeling the contour curves
clabel(c,h);