!! Method 3: Vm gradually change from Vrest to Vstim using fixed tangent angle 

       IF (tresidue .GE. t_V_stim_start .AND. tresidue .LE. t_V_stim_end + ramp_time) THEN
          IF (tresidue .LE. t_V_stim_start + ramp_time) THEN
             Vm = Vm + dt * (V_stim-Vm)/ramp_time
             INCLUDE "Vm_dependent.inc"  !!kva,kvi
             INCLUDE "dp_args.inc"  !! dp_arg1, dp_arg2
          ELSE IF (tresidue .LE. t_V_stim_end .AND. (.NOT. is_being_clamped)) THEN
             Vm = V_stim
             is_being_clamped = .TRUE.
             INCLUDE "Vm_dependent.inc"  !!kva,kvi
             INCLUDE "dp_args.inc"  !! dp_arg1, dp_arg2
          ELSE IF (tresidue .GT. t_V_stim_end-ramp_time) THEN
             Vm = Vm + dt * (V_rest-Vm)/ramp_time
             INCLUDE "Vm_dependent.inc"  !!kva,kvi
             INCLUDE "dp_args.inc"  !! dp_arg1, dp_arg2
          END IF
       ELSE IF (is_being_clamped .EQ. .TRUE.) THEN
          Vm = V_rest          
          is_being_clamped = .FALSE.
          INCLUDE "Vm_dependent.inc"  !!kva,kvi
          INCLUDE "dp_args.inc"  !! dp_arg1, dp_arg2
       END IF
          


          
