ode
def sliding_friction():
from numpy import tanh, sign
f = lambda v: mu*m*g*sign(v)
alpha = 60.0
s = lambda u: k/alpha*tanh(alpha*u)
#s = lambda u: k*u
F = lambda t: 0
g = 9.81
mu = 0.4
m = 1
k = 1000
U_0 = 0.1
V_0 = 0
T = 1
dt = T/100.
methods = [odespy.EulerCromer, odespy.ForwardEuler]
compare(methods, f=f, s=s, F=F, m=1, U_0=U_0, V_0=V_0,
T=T, dt=dt, start_of_plot=0)