vyrjana / DearEIS

A GUI program for analyzing, simulating, and visualizing impedance spectra.
https://vyrjana.github.io/DearEIS/
GNU General Public License v3.0
52 stars 9 forks source link

Error when calculating DRT (TR-RBF method) with low Lambda values #17

Closed BetonK closed 1 month ago

BetonK commented 5 months ago

Desktop (please complete the following information):

Describe the bug Calculation of the DRT with TR-RBF method only works when Lambda is exactly or greater than 0.001 when using Complex mode. On Real or Imaginary mode, the lowest working Lambda value is 0.0001.

To Reproduce Steps to reproduce the behavior:

  1. Go to 'DRT Analysis'
  2. Choose TR-RBF as method
  3. Use a low Lambda value (e.g. 0.0001 in complex mode)
  4. See error

Expected behavior Calculation of DRT with TR-RBF with lower lambda values

Screenshots/videos/tracebacks Parameters: DRT parameters Error message: DRT error

Thank you so much for this Tool! The batch function of DRT calculation is very convenient and timesaving. I also have a feature request: Would it be possible to display the frequency instead of the time constant on the x-axis of DRT plots? Maybe an option to toggle between time constant or frequency?

vyrjana commented 5 months ago

I'm working on an update to the pyimpspec package, which is where Kramers-Kronig tests, circuit fitting, DRT analysis, etc. are all implemented. That update includes changes to the TR-RBF implementation to bring it up to date with the implementation currently found in the pyDRTtools repository (e.g., a non-negativity constraint and optimization of lambda using cross-validation methods have been added). This updated implementation seems to be better at handling low lambda values.

However, updating the implementation required some changes to function signatures and those changes are not backwards compatible. The upcoming pyimpspec update makes several other changes that are backwards incompatible so I cannot simply release that update right now as version 4.2.0. It will have to be version 5.0.0 and there may still be some other changes that I might want to make that are not backwards compatible. I would rather do those changes now, if possible, instead of releasing version 6.0.0 a few months later. There are also quite a few things to do before the update is finished (e.g., the documentation requires some updating).

I also need to update DearEIS to be compatible with the upcoming version of pyimpspec.

Regarding the feature request; I will add it to the list of changes to consider. It would most likely be in the form of a checkbox for toggling between the two different x-axes.

BetonK commented 5 months ago

Sounds good, thank you again for all your efforts. I'm looking forward for the next update!

vyrjana commented 1 month ago

I've been busy working on the next version of pyimpspec and a related article, but both of those have now been released and I'm now working on finishing up version 5.0.0 of DearEIS.

The upcoming update includes support for automatically determining the value of lambda using one of several cross-validation methods as I mentioned previously. I've also added a checkbox for toggling between time constant (s) and frequency (Hz) as the x-axis in the DRT analysis tab.

vyrjana commented 1 month ago

Version 5.0.0 is now available and it seems like this issue should now be resolved as well.

BetonK commented 1 month ago

Thank you! I'm going to test V5.0.0 in the next days. I will report back if there are any persisting issues

BetonK commented 1 month ago

there are no errors anymore when using low lambda values!

One little thing to add: Right now it is only possible to display the DRT-Plot with frequency as x-axis in the "DRT analysis" tab. It would be nice to have this option in the "Plotting" tab as well.

vyrjana commented 1 month ago

I'll add it to the list, but it will also require some changes to some plotting functions in pyimpspec.