sundials-codes / analysis-utilities

General utility routines for analyzing RK and LMM methods
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

Bug for Nonconnected Stability Regions #1

Open Steven-Roberts opened 1 year ago

Steven-Roberts commented 1 year ago

The stab_region function only returns the first contour detected by contourc: https://github.com/sundials-codes/analysis-utilities/blob/85d730a48818734be63f900bc1e9ad6e2bab2fc8/RungeKutta/stab_region.m#L56 If a method has multiple disconnected regions of stability like https://github.com/LLNL/sundials/blob/54d9c4a6a73ba52c8adb010f1ed0ec66b169c7dc/doc/shared/figs/arkode/sofroniou_spaletta_erk_stab_region.png this code would only show one region and leave out the others. I'm not sure if stability plots in the SUNDIALS docs are affected. A simple fix is to directly call contour with the x-y grid and stability functions values.

drreynolds commented 1 year ago

Given that it's essentially impossible to leverage separate stability "islands" in an adaptive solver, I don't see any issues with displaying only the main region. However, if you'd like then I would be fine with a PR to update the script in this utilities repository, and then regenerating the stability region plots for the ARKODE documentation.

Steven-Roberts commented 1 year ago

I agree that the islands are not particularly useful, but it can display one island and not the primary region. I'll put this as a low priority item on my todo list