I have also asked this question here in SO.
I'm trying to solve a system of DAEs with discrete conditions:
muk = 0.2;
mus = 0.3;
m1 = 1;
m2 = 2;
m3 = 3;
Fn12 = 3;
Fn23 = 2;
minvel = 0.1;
F1[x_] := 2*Sin[5*x];
F2[x_] := 2*Sin[7*x];
Fs12[x_] := (m2*F1[x] - m1*F2[x])/(m1 + m2);
Off[NDSolve::pdord]
s = NDSolve[{m1*x1''[t] == F1[t] - Ff12[t], x1'[0] == 0, x1[0] == 0,
m2*x2''[t] == F2[t] + Ff12[t], x2'[0] == 0, x2[0] == 0,
Ff12[t] ==
If[Abs[x1''[t] - x2''[t]] < 0.1 && Abs[Fs12[t]] < mus*Fn12 ,
Fs12[t], muk*Fn12*Sign[x1''[t] - x2''[t]]]}, {x1, x2, Ff12}, {t,
10}]
However when solving I get two weird errors:
NDSolve::tddisc
NDSolve cannot do a discontinuity replacement for event surfaces that depend only on time
NDSolve::nderr
Error test failure at t==...; unable to continue
which searching on google does not offer that much of the results!
I have found some relevant posts and documentations. It seems that I have to use a helper function or something like that using Piecewise and/or WhenEvent functions but I can't get my head around it!
I would appreciate if you could explain why this error happens and how I can modify my code to avoid it?