function [t,y] = holmes % M.H. Holmes, Introduction to Perturbation Methods, % Springer, New York, 1995, solves the ODE % % y'' + epsilon*lambda*y' + y + ... % epsilon*kappa*y^3 = epsilon*cos((1+epsilon*omega)t) % % with parameter values that results in a highly oscillatory % solution with slowly increasing magnitude. Here the solution % is compared to the RMS average computed with ODEAVG. clc tempavg = load('holmes.dat','-ascii'); tempode = load('holmesode.dat','-ascii'); tempd = load('holmesd.dat','-ascii'); delta = tempd(1); navg = tempd(2); tode = tempode(:,1); yode = tempode(:,2); tavg = tempavg(:,1); % Compute the RMS average. R = sqrt(tempavg(:,2)); plot(tavg,R,'r',tode,yode,'k') %legend('Averaged RMS solution','Computed solution',... % 'Location','SouthWest') %title(['Using \Delta = ',num2str(delta),' and average = ',... % int2str(navg),'.']) xlabel('t')