******************************************************************* * * Derivative Function Vector Calculation JAJ 10/00 * DeVries 5.55 and 5.56 * in general, derivatives could depend on * time and all x-vector components * Modified 10/16/2006 to allow for driven oscillations * new parameters alpha=Fo and omega are now used * and are read in by the revised int.for program * SUBROUTINE derivs(time,xin,F) double precision time,xin(2),F(2) double precision drag, drive ! drag and drive terms double precision vtol double precision m, k, g, gamma, alpha, omega common /params/ m, k, g, gamma, alpha, omega parameter (vtol = 1.0d-10) * F(i) are the output derivatives F(1) = xin(2) ! velocity drag = 2*gamma*xin(2) ! damping term drive = alpha*dcos(omega*time)/m ! driving force F(2) = - k*xin(1)/m - drag - drive ! acceleration 500 format ('# frict=0 ',1PE14.6,' > ',1PE14.6,' xin(2)=',1PE14.6) return end *************************************************************