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