# Instability in system with low abstol and "Larger maxiters is needed" DifferentialEquations.jl; DynamicalSystems.jl

**URL:** <https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741>\
**Category:** Modelling & Simulations\
**Created:** [July 4, 2022, 2:00pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741 "2022-07-04T14:00:29Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [July 4, 2022, 2:00pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/1 "2022-07-04T14:00:29Z")

</div>

![image](https://global.discourse-cdn.com/julialang/original/3X/5/9/59e3dc738c023d424842a6f38c7edd134c932c8d.png)

I have system Lienard with fixed parametres. I use alpha 0.20 and w = 0.7315 with t = 500000, when using default algorithm result is uncorrect. I use Feagin12 with abstol 20 and have problem with Instability, if i take abstol 25 i have another problem with Larger maxiters is needed. How can i fixed this? I have article with correctl result, but i need more t for my task with extreme events. I tryed anothers algorithms and this problems is saved or i hads uncorrect results.

When i use t = 100000 or 200000 i don’t have this problems, but i need more t

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [July 4, 2022, 2:07pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/2 "2022-07-04T14:07:12Z")

</div>

Have you tried increasing `maxiters`…?

---

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [July 4, 2022, 2:21pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/3 "2022-07-04T14:21:05Z")

</div>

I tried, it’s not helped

---

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [July 4, 2022, 2:33pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/4 "2022-07-04T14:33:08Z")

</div>

In article use RK4 with step 0.01 but it is give uncorrect result in Julia. I also have result in python with method RK45 and rtol = 13, atol = 13, with it i have correct result

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [July 4, 2022, 2:48pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/5 "2022-07-04T14:48:00Z")

</div>

> [@Sergey\_Novak](#):
>
> In article use RK4 with step 0.01 but it is give uncorrect result in Julia

But what does this mean though? Did you use the RK4 solver in Julia **also with non-adaptive time stepping** , and set a fixed time step to 0.01 and it didn’t work? And you also used **the same initial conditions**? And what does “didn’t work” mean? Can you be as precise as possible?

I find this hard to believe, because the DiffEq solvers are very well tested. So it simply sounds unlikely that an RK4 implementation in another code would give “correct” results, and the one in Julia wouldn’t. Actually, if anything, I’d trust the Julia version more 😃

---

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [July 4, 2022, 2:59pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/6 "2022-07-04T14:59:37Z")

</div>

I have same fixed initial condition in all research. I need get this results, that is extreme events (events \> red line, dashed cyan line) but i have different result.

RK4 with fixed time step 0.01 and with t 500000 have warning “Larger maxiters is needed”

![image](https://global.discourse-cdn.com/julialang/original/3X/e/b/eba5464acebea12f58d3aa72f50f44ebce45cef8.png)  
 ![image](https://global.discourse-cdn.com/julialang/original/3X/d/5/d5a1396e10d180ee7cce475fe1e030fc3e5fc613.png)

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [July 4, 2022, 3:13pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/7 "2022-07-04T15:13:22Z")

</div>

This seems completely correct to me though? If first image is paper and second image is Julia, this is completely correct.

You can’t expect to have **exactly the same time evolution, even if you use exactly the same initial condition and solver algorithm**. You have an extremely chaotic system in your hands. Even the fact that you simulate this system in a different computer will lead to different time evolution.

What you should be looking at instead is whether you get the same **dynamical characteristics**. For example, are the Lyapunov exponents the same in both cases? The fractal dimension of the chaotic attractors? If the system is multistable, do both cases show the same number of attractors?

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [July 4, 2022, 3:14pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/8 "2022-07-04T15:14:12Z")

</div>

> [@Sergey\_Novak](#):
>
> RK4 with fixed time step 0.01 and with t 500000 have warning “Larger maxiters is needed”

The resolution of this warning is trivial: increase `maxiters`. So we can stop discussing about this case for now and focus on whether any _substantial_ differences exist.

---

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [July 4, 2022, 3:16pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/9 "2022-07-04T15:16:57Z")

</div>

This two images from articles. This image is Julia

 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/a/faa98923f591711b0d20eea07d0a7a5ea9d9d11a.png)

---

<div class="post-metadata">

**Author:** ![Datseris](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/datseris/32/13406_2.png) [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Post date:** [July 4, 2022, 3:17pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/10 "2022-07-04T15:17:51Z")

</div>

tomato tomato 😃

---

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [July 4, 2022, 3:20pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/11 "2022-07-04T15:20:26Z")

</div>

Spectre lyapunov exponents the same in both case, attractor one

---

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [July 4, 2022, 3:25pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/12 "2022-07-04T15:25:42Z")

</div>

Increase maxiters before 10 000 000 helped.Thank you. Before this i increae below this value.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [July 4, 2022, 4:59pm UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/13 "2022-07-04T16:59:56Z")

</div>

> [@Sergey\_Novak](#):
>
> RK4 with fixed time step 0.01 and with t 500000 have warning “Larger maxiters is needed”

Did you set `adaptive=false`? If you don’t do `adaptive=false` then it is using adaptivity as documented.

> - `RK4` - The canonical Runge-Kutta Order 4 method. Uses a defect control for adaptive stepping using maximum error over the whole interval.

[https://diffeq.sciml.ai/dev/solvers/ode\_solve/](https://diffeq.sciml.ai/dev/solvers/ode_solve/)

---

<div class="post-metadata">

**Author:** ![Sergey\_Novak](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sergey_novak/32/37716_2.png) [@Sergey\_Novak](https://discourse.julialang.org/u/Sergey_Novak)\
**Post date:** [July 5, 2022, 7:54am UTC](https://discourse.julialang.org/t/instability-in-system-with-low-abstol-and-larger-maxiters-is-needed-differentialequations-jl-dynamicalsystems-jl/83741/14 "2022-07-05T07:54:40Z")

</div>

No, don’t use. I now tried with him. Thank you.
