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

mytitle = 'Duffing''s Equation'; 	% Title
xlab = '$t$'; 		                % X-label
ylab = '$u$'; 	                    % Y-label
tt = linspace(0,8*pi,500);
[te,ue] = ode23(@duffDE,tt,[1;0]);
ep = 0.2;
u0 = cos(tt);
plot(te,ue(:,1),'b-','LineWidth',1.5);  
hold on                           
plot(tt,u0,'r-','LineWidth',1.5);
grid                                % Adds Gridlines
h =legend('Exact, $u_e$', 'Approx $u_0$',...
    'Location','southeast');
set(h,'Interpreter','latex')
text(6,-1.25,'$\varepsilon = 0.2$','FontSize',14,...
    'interpreter','latex');
xlim([0 25]);
ylim([-1.5 1.2]);
fontlabs = 'Times New Roman';   % Font in labels
xlabel(xlab,'FontSize',14,'FontName',fontlabs,...
    'interpreter','latex');  
ylabel(ylab,'FontSize',14,'FontName',fontlabs,...
    'interpreter','latex');  
title(mytitle,'FontSize',16,'FontName',...
    'Times New Roman','interpreter','latex'); 
set(gca,'FontSize',12);         % Axis tick font size
print -depsc duff_tsplot.eps		% Create figure as EPS file

