%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % doubletrapstep.m % Double trapstep.m %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function y = doubletrapstep(t,x,h, friction) %one step of the trapezoid method z1=doubleydot(t,x, friction); g=x+h*z1; z2=doubleydot(t+h,g, friction); y=x+h*(z1+z2)/2;