dgbowl / yadg

yadg: yet another datagram
https://dgbowl.github.io/yadg
GNU General Public License v3.0
36 stars 13 forks source link

loss of <I> column in the converted json from the mpr file in GCPL technique using yadg 4 #122

Closed NukP closed 11 months ago

NukP commented 1 year ago

Background When using yadg 4 to convert mpr file to json file, serveral data columns went missing although these columns are present in the mpt file generated from Biologic. Unfortunately, these missing data column, <I>/mA, in particular is crucial for plotting the data from GCPL experiment. The user has requested that this column is included in the json file.

Investigation done so far

My suspision so far

  • From the investigation I have done earlier, I now think that Biologic may have derive and generate the data from <I>/mA to cycle number (in the mpt file) during mpr to mpt conversion. These data columns may not have present in the original mpr file.
  • <I>/mA, for example, can be derived from dq/mA.h. Nevertheless, I have not yet verified this speculation with the user whoes have experince with battery electrochemistry.
  • This speculation is in line with the issue reported earlier (https://github.com/dgbowl/yadg/issues/41) that there will be more column stored in the mpr file after the user perform the conversion to mpt.

Corresponding files https://drive.switch.ch/index.php/s/AGzUx3wPHscdWnq

PeterKraus commented 1 year ago

Thanks for bringing this issue up to github. Maybe @vetschn can chime in.

I seem to recall that <I> might be an optional column for some techniques, at least remembering there was an option somewhere in the EC-Lab interface. However, it seems strange that a current would not get recorded during the run at all.

Unfortunately, the headers from the mpt file have been stripped. Could you please re-export the mpt file so that the header (describing the technique "steps") is retained? I had a look in the mps file, and the only 15-minute interval seems to be Ns 1 of Technique 1, but I guess the cycling data are from Ns 3 and 4 in Technique 2.

As a measure of last resort, the <I> can be generated from the dq data and timestamps; it is simply <I> = dq / dt. I think the current implementation in dgpost expects the total Q, not dq, but this should be a simple fix.

PeterKraus commented 1 year ago

I have attached a plot illustrating the issue, this was generated using yadg-5.0a5 from the above mpr file: plot Here, red is Ewe, green is control_I, blue is (Q-Qo) and orange is Ns.

We can see that the spike in control_I conicides with Ewe reaching its limit value, which happens in the last few minutes of each step (i.e. before Ns change, not after).

This means:

  • control_I is not really control_I at all the times. The "limiting property" during constant current steps in GCPL may not be current but voltage, if applying the full requested current would break the voltage limit I imagine.
  • we can use (Q-Qo) as Q in the dgpost.transform.electrochemistry.average_current() function to get <I> that way.
vetschn commented 1 year ago

Yep, I think @NukP's initial suspicion is completely correct, the mpr file does not contain the <I> column.

From the "variables description" section in the EC-Lab User's Manual:

\, average current over the potential step (calculated from I = dQ/dt)

so the dgpost.transform.electrochemistry.average_current() function is the way to go :+1:

NukP commented 1 year ago

@PeterKraus Here is the mpt file with the header. https://drive.switch.ch/index.php/s/Mc0XZCDeOK3BkLl

So does this mean that during the mpr to json conversion, I should first call yadg to do the conversion and then use dgpost to convert Q-Qo to <I> ?

PeterKraus commented 1 year ago

Well, yadg is not meant to do any postprocessing, so any output file (json in v4 and netcdf in v5) will not have <I> in them, if it's not in the "source" files.

You will have to calculate the current somehow in a postprocessing step. The dgpost function is just a convenient way to do it...