
clear				% Clear previous definitions
figure(1)           % Assign figure number
clf                 % Clear previous figures
hold off            % Start with fresh graph

fontlabs = 'Times New Roman';   % Font type used in labels

set(gca,'FontSize',12);

xx = linspace(-5,5,51);
yy = linspace(-5,5,51);

for i=1:51
    for j=1:51
        J(j,i)=xx(i)^2 + 2*yy(j)^2 + sin(xx(i)*yy(j));
    end
end
surf(xx,yy,J);
% contour(xx,yy,J);
colormap(jet);
% set(gca,'ZScale','log');

hold on;
axis([-4 4 -4 4 0 80]); 

title('Potential','Fontsize',16);
xlabel('$x$','Fontsize',12,'interpreter','latex'); 
ylabel('$y$','Fontsize',12,'interpreter','latex'); 
zlabel('Potential','Fontsize',12);
colorbar;

% xpt = [4.018 3.9669]; 
% ypt = [0.3364 0.3416]; 
% zpt= [0.0241, 0.0449];

% plot3(xpt,ypt,zpt,'o','MarkerSize',10, 'MarkerFaceColor', 'y'); 

set(gca,'FontSize',12);         % Axis tick font size

print -depsc potential.eps		% Create figure as EPS file

% print -depsc potential2.eps