I am trying to solve a first order ODE using ParametricNDSolve for getting particle trajectory in a flow around an obstacle. I got an error message that "At t == 221.96028149270003`, step size is effectively zero; singularity or stiff system suspected". And then it extrapolates beyond that time and returns bad data*.

I am using explicit method by applying Method -> {"EquationSimplification" -> "Solve"}. I also tried with "Residual" and some other methods, submethods, and worked with accuracy and precision as well but the problem still exists. I actually don't understand what is going wrong and how systematically I can address the problem. The RHS of ODE is very complicated though.

*By bad data I meant the gap between the particle and obstacle becomes complex. Even before that, the gap seems to rapidly drop to zero which makes no sense as particle can not touch the obstacle at any event. I don't understand

  1. how the solver is making the gap to exponentially go to zero?
  2. how the problem becomes stiff? I understand that the particle tangential velocity becomes very small when it gets very close to the obstacle but it is not supposed to get stuck there (since the repulsive normal force beomes infinity as written in the equation of motion) rather take an infinitely long time for the excursion.

Any help is well appreciated. Thank you in advance.

  • 1
    $\begingroup$ Welcome to Mathematica.SE! I hope you will become a regular contributor. Please show the code that you are using in a form that can be copied from your question and pasted into Mathematica. Without that information it will be difficult for readers to help you. $\endgroup$
    – bbgodfrey
    Commented Oct 25, 2023 at 12:45


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.