%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % forcetrapstep.m % Forced trapstep.m %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function y = forcetrapstep(t,x,h,d, force) %one step of the trapezoid method z1=forceydot(t,x,d, force); g=x+h*z1; z2=forceydot(t+h,g,d, force); y=x+h*(z1+z2)/2;