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

mytitle = '$dy/dt = y + t$'; 	% Title
xlab = '$t$'; 		% X-label
ylab = '$y(t)$'; 		% Y-label

tt = linspace(0,2,200);
yy = 4*exp(tt) - tt - 1;           % Actual solution
[t,y]=euler(@numeg,0.1,0,2,3);     % Euler solution
[t1,y1]=im_euler(@numeg,0.1,0,2,3);% Improved Euler solution
plot(tt,yy,'b-','LineWidth',1.5);  % Plot Actual solution
hold on                            % Plots Multiple graphs
plot(t,y,'r-o','LineWidth',1.0,'MarkerSize',6);  % Plot Euler
plot(t1,y1,'k-o','LineWidth',1.0,'MarkerSize',6);  % Plot Improved Euler
grid                                % Adds Gridlines
legend('Actual Solution','Euler Solution','Improved Euler','Location','Southeast');
xlim([0 2]);    % Defines limits of graph
ylim([0 30]);   % Defines limits of graph

fontlabs = 'Times New Roman';   % Font type used in labels
xlabel(xlab,'FontSize',14,'FontName',fontlabs,'interpreter','latex');  
        % x-Label size and font
ylabel(ylab,'FontSize',14,'FontName',fontlabs,'interpreter','latex');  
        % y-Label size and font
title(mytitle,'FontSize',16,'FontName','Times New Roman','interpreter','latex'); 
        % Title size/font
set(gca,'FontSize',12);         % Axis tick font size

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

