[SciPy-User] lsoda vs. Coulomb friction

Ryan Krauss ryanlists@gmail....
Wed Feb 3 10:28:49 CST 2010


I am trying to use odeint (i.e. lsoda) on a mechanical system that
involves a mass and friction modeled as a viscous term plus Coulomb
friction.  The discontinuity near 0 velocity makes lsoda mad.  It
complains that it has to do excess work (lazy algorithm :).  In spite
of its complaining, the result leads to fairly good agreement between
model and experiment.  But is there a better way to handle this?

This is the func I am passing to odeint (see attached example script
for the details):

def ydot_ol(x, t, u, C):
    m = C[0]
    b1 = C[1]
    b2 = C[2]
    y1 = x[0]
    y2 = x[1]
    ydot = zeros(2,)
    ydot[0] = y2
    ydot[1] = (u - b1*y2 - b2*sign(y2))/m
    return ydot

u is an external input.

lsoda doesn't complain until the system is essentially stopping.

Thanks,

Ryan
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lsoda_vs_coulomb_friction.py
Type: text/x-python
Size: 853 bytes
Desc: not available
Url : http://mail.scipy.org/pipermail/scipy-user/attachments/20100203/fe4123b0/attachment.py 


More information about the SciPy-User mailing list