How to solve this error? Error:"Nonlinear iteration is not converging with step size reduced to hmin (9.59393e-15) at time 2.70045. Try reducing the minimum step size and/or relax the relative error tolerance."
138 次查看(过去 30 天)
显示 更早的评论
How to solve this error?
Error:"Nonlinear iteration is not converging with step size reduced to hmin (9.59393e-15) at time 2.70045. Try reducing the minimum step size and/or relax the relative error tolerance."
i have already tried and reduced the minimum step size and incresedRelaxed the tolerance and still the error persists for ode15s solver.
0 个评论
回答(1 个)
Swetha Polemoni
2021-3-1
Hi,
This may occur when one of your signals is either diverging to +infinity or -infinity or changing too rapidly based on solver settings
2 个评论
Manish Varma Raathimiddi
2021-11-21
Is there any other way that we can rectify this error as I still couldn't able to figure it out. Can you please help me out.
Walter Roberson
2021-11-21
NO, there is no other way to rectify that error. There are only a small number of possibilities:
- The system and its first 2 derivatives are continuous over the entire domain of integration, and there are no numeric problems -- in which case the problem just doesn't happen
- The system and its first 2 derivatives are theoretically continuous over the entire domain of integration, but there are numeric issues, such as if you had (x-1)^2/(x-1) and x needs to pass through 1, then in theory this is continuous but if you are not careful in how you write the code then you get a division by 0 -- in which case the code needs to be written more carefully to avoid the numeric problems
- If the system is piecewise continuous, and there is well-defined behaviour at the discontinuities, and the discontinuities are at predictable times -- in which case you need to carefully control the tspan of each call so that each call is within a continuous section, and then when the call returns, adjust the system from outside the ode* funciton and restart from the time boundary. For example a system that has an injection of drug or energy at periodic intervals
- If the system is piecewise continuous, and there is well-defined behaviour at the discontinuities -- in which case you need to write event functions to terminate the ode*() call, adjust the system from outside of the ode* function, and restart from the event boundary; for example a bouncing ball
- In all other cases, the system is not suitable for use with the variable-step ode* functions.
In particular, the ode functions are not suitable if the code uses randomness. They are also not suitable in most cases where the code has if statements or interp*() calls with default interpolation methods. (There are some cases in which it is safe to use if or interp1(), if you know what you are doing.)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Configure Simulation Conditions 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!