GITT Diffusion Coefficient Errors Tested with Known-D PyBaMM Data
GITT Diffusion Coefficient Errors Tested with Known-D PyBaMM Data
Search
Ask the AI

GITT Diffusion Coefficient Errors Tested with Known-D PyBaMM Data

Kang and Chueh open their critical review of GITT with a chart of published diffusivities for one material, LiNi1/3Mn1/3Co1/3O2. The values differ by orders of magnitude, and the reports do not even agree on how D changes with lithium content. A single experiment shows the local version of the same problem: D jumps between neighbouring pulses, the plot of voltage against \(\sqrt{t}\) is a straight line, and nothing says which number to believe.

A simulation with a prescribed diffusivity provides a controlled test of the analysis. Here PyBaMM uses constant D = 1×10⁻¹⁵ m²/s for the NMC811-OCP case, and the resulting voltage is analyzed with the textbook formula and the site’s GITT analyser. Deviations from the input quantify combined numerical-generation and analysis errors under this model. The reported textbook estimates span 0.25–3.1 times the input for NMC811 and 0.014–3.9 for the separate graphite case; 18 of 20 NMC811 pulses have R² above 0.99 in the square-root-time plot.

PyBaMM battery modelling series · Silent failures, measured (part 8 of 8): Previous: Fitting PyBaMM Parameters: PyBOP Versions, Identifiability and Validation · Series hub: Data pipeline (5) + Silent failures, measured (8) · RSS feed.

1. A titration with the answer built in

The model is PyBaMM’s single particle model as a half cell against lithium metal. I start from the Xu2019 half-cell set and swap in the NMC811 OCP of the Chen2020 set (Chen et al. 2020), because that curve has the bends a real layered oxide has. The particle radius is 5 µm and D is constant. Twenty 600 s pulses, each followed by a 2 h rest, walk the stoichiometry x from 0.27 to 0.87 in steps of 0.03.

"""GITT in PyBaMM with a diffusivity you choose. Writes gitt.csv."""
import sys
import numpy as np
import pybamm
from scipy.special import erf

pybamm.set_logging_level("ERROR")
F = 96485.33212

CASES = {   # slot name in Chen2020, R [m], D [m2/s], step in x, start x
    "nmc811":   ("Positive electrode OCP [V]", 5e-6, 1e-15, 0.030, 0.27),
    "graphite": ("Negative electrode OCP [V]", 6e-6, 2e-15, 0.035, 0.05),
}
ocp_name, R, D, dx, x0 = CASES[sys.argv[1] if len(sys.argv) > 1 else "nmc811"]
tau, rest, n = 600, 7200, 20

p = pybamm.ParameterValues("Xu2019")            # half cell against Li metal
cmax = p["Maximum concentration in positive electrode [mol.m-3]"]
Qx = (F * cmax * p["Positive electrode active material volume fraction"]
      * p["Electrode width [m]"] * p["Electrode height [m]"]
      * p["Positive electrode thickness [m]"])  # C per unit stoichiometry
p.update({
    "Positive electrode OCP [V]": pybamm.ParameterValues("Chen2020")[ocp_name],
    "Positive particle radius [m]": R,
    "Positive particle diffusivity [m2.s-1]": D,
    "Initial concentration in positive electrode [mol.m-3]": x0 * cmax,
    "Lower voltage cut-off [V]": -1.0,
    "Upper voltage cut-off [V]": 6.0,
})

I = dx * Qx / tau                               # A, lithiation is a PyBaMM discharge
steps = ["Rest for 600 seconds (10 second period)"]
for _ in range(n):
    steps += [f"Discharge at {I!r} A for {tau} seconds (1 second period)",
              "Rest for 30 seconds (1 second period)",
              f"Rest for {rest - 30} seconds (10 second period)"]

model = pybamm.lithium_ion.SPM({"working electrode": "positive"})
var_pts = dict(model.default_var_pts)
var_pts["r_p"] = 480                            # the default of 20 biases D by 10 %
submesh = dict(model.default_submesh_types)
submesh["positive particle"] = pybamm.MeshGenerator(
    pybamm.Exponential1DSubMesh, submesh_params={"side": "right", "stretch": 10})

sim = pybamm.Simulation(model, parameter_values=p, experiment=pybamm.Experiment(steps),
                        var_pts=var_pts, submesh_types=submesh,
                        solver=pybamm.IDAKLUSolver(rtol=1e-9, atol=1e-11))
sol = sim.solve()

rows, xs = [], []
for k, ss in enumerate(sol.sub_solutions):
    keep = slice(None) if k == 0 else slice(1, None)    # steps share their end points
    rows.append(np.column_stack([ss["Time [s]"].entries[keep],
                                 ss["Current [A]"].entries[keep],
                                 ss["Voltage [V]"].entries[keep]]))
    xs.append(ss["X-averaged positive particle surface stoichiometry"].entries[keep])
data, xs = np.vstack(rows), np.concatenate(xs)
data[np.abs(data[:, 1]) < 1e-12, 1] = 0.0
np.savetxt("gitt.csv", data, delimiter=",", fmt=["%.3f", "%.9f", "%.7f"],
           header="time_s,current_A,voltage_V", comments="")

tp = D * tau / R**2
exact = (np.exp(tp) * (1 + erf(np.sqrt(tp))) - 1) / (3 * tp)
first_pulse_end = np.searchsorted(data[:, 0], 600 + tau)
print(f"{len(data)} rows; R = {R*1e6:g} um, D = {D:.3g} m2/s, x_start = {x0}, "
      f"Q_x = {Qx/3.6:.3f} mAh, I = {I*1e3:.4f} mA")
print(f"surface moved {(xs[first_pulse_end] - x0)/dx:.4f} x the bulk step, "
      f"exact {exact:.4f}")
27001 rows; R = 5 um, D = 1e-15 m2/s, x_start = 0.27, Q_x = 4.331 mAh, I = 0.7796 mA
surface moved 2.8045 x the bulk step, exact 2.8045

The second output line is the check I trust most. For constant D, the change in surface stoichiometry is a known multiple of the change in bulk-average stoichiometry, \(h(\hat\tau)/(3\hat\tau)\), with \(h(\hat\tau)=e^{\hat\tau}(1+\mathrm{erf}\sqrt{\hat\tau})-1\) at short times and \(\hat\tau=D\tau/R^2\). PyBaMM and the short-time sphere response agree to four decimals.

In this test, default 20-point radial discretization leaves a measurable generation error: pulses marked ok return 0.89–0.93 of input D, with 12 of 16 more than 10% low. Increasing to 100 uniform points gives 0.99–1.02, and the stated graded 480-point grid gives 1.00–1.03. Refine the generating model before using it as a reference for this analysis.

2. The textbook formula and what it assumes

The Weppner–Huggins expression takes one pulse of duration \(\tau\). Nickol et al. give it for spheres as their Eq. 11, and with a general volume-to-surface ratio it reads:

$$D=\frac{4}{\pi\tau}\left(\frac{V}{S}\right)^{2}\left(\frac{\Delta E_s}{\Delta E_t}\right)^{2}$$

Here \(\Delta E_s\) is the change between the relaxed voltages before and after the pulse, \(\Delta E_t\) is the voltage change while the current flows, and \(V/S\) is the active volume over its surface area. Kang and Chueh start from the planar semi-infinite solution behind this formula, which sets out what has to hold. The pulse must be short compared with the diffusion time, \(D\tau/L^2\ll 1\). Lithium must enter at the surface of a single-phase material. The total resistance must stay constant during the pulse. The formula also reduces \(\partial V_{eq}/\partial x\) to one number, measured from \(\Delta E_s\), so the equilibrium voltage has to be a straight line in composition over the full range of surface stoichiometry.

On this titration the formula needs twenty lines of NumPy:

"""Classic Weppner-Huggins on gitt.csv, pulse by pulse, against the true D."""
import numpy as np

R, D_TRUE = 5e-6, 1e-15                 # use 6e-6, 2e-15 for the graphite case
L = R / 3                               # V/S of a sphere

t, I, V = np.loadtxt("gitt.csv", delimiter=",", skiprows=1).T
on = np.abs(I) > 0.1 * np.abs(I).max()
starts = np.flatnonzero(on[1:] & ~on[:-1]) + 1      # first row with current
ends = np.flatnonzero(on[:-1] & ~on[1:])            # last row with current

print(" #  dEs/mV  dEt/mV   R2(sqrt t)  D_WH/D_true")
for k, (a, b) in enumerate(zip(starts, ends)):
    E0, E1, E2 = V[a - 1], V[a], V[b]
    E4 = V[starts[k + 1] - 1] if k + 1 < len(starts) else V[-1]
    dEs, dEt = E4 - E0, E2 - E1
    tau = t[b] - t[a - 1]
    D = 4 / (np.pi * tau) * L**2 * (dEs / dEt)**2

    s = t[a:b + 1] - t[a - 1]           # is the sqrt(t) plot a straight line?
    keep = s >= 0.1 * tau
    x, y = np.sqrt(s[keep]), V[a:b + 1][keep]
    fit = np.polyval(np.polyfit(x, y, 1), x)
    r2 = 1 - ((y - fit)**2).sum() / ((y - y.mean())**2).sum()
    print(f"{k + 1:2d} {dEs * 1e3:7.2f} {dEt * 1e3:7.2f}   {r2:.5f}     {D / D_TRUE:7.3f}")
 #  dEs/mV  dEt/mV   R2(sqrt t)  D_WH/D_true
 1  -67.63  -92.66   0.96790       3.139
 2  -19.16  -71.10   0.94711       0.428
 3  -21.26 -102.61   0.99575       0.253
 4  -43.96 -121.26   0.99988       0.775
 5  -47.49 -112.81   0.99986       1.045
 6  -41.00 -102.38   0.99927       0.945
 7  -36.22 -104.67   0.99549       0.706
 8  -37.32 -116.98   0.99666       0.600
 9  -44.14 -123.06   0.99987       0.758
10  -48.35 -112.58   0.99849       1.087
11  -42.01  -92.70   0.99936       1.211
12  -32.83  -77.38   0.99999       1.061
13  -27.55  -70.06   0.99972       0.911
14  -25.41  -67.30   0.99949       0.840
15  -24.66  -66.39   0.99938       0.813
16  -24.40  -66.13   0.99934       0.802
17  -24.31  -66.12   0.99932       0.797
18  -24.28  -66.23   0.99930       0.793
19  -24.27  -66.44   0.99928       0.787
20  -24.27  -66.84   0.99921       0.777

The true value of the last column is 1.000 on every line. Pulses 16 to 20, where this OCP is nearly straight, settle at 0.78 to 0.80, and that number has a clean origin. On a sphere the exact response gives \(D_{WH}/D=4\hat\tau/(\pi h^2)=0.75\) at \(\hat\tau=0.024\). Taking \(E_1\) from the first logged row, one second after switch-on, loses a little diffusion and raises the result by a factor of 1.07. The two errors partly cancel. Gümrükçüoğlu et al. examine the same slab approximation on the Chen et al. data and report errors above 5% across most stoichiometries. Further up the table the same formula gives 0.25 and 3.14, a factor of 12 across a material with one diffusivity.

The R² column explains why this goes unnoticed. Pulse 3 is four times too low with R² = 0.9958. Fitting the slope of that line, the other textbook form, gives 0.14 of the truth on pulse 3. Pulse 12 has the best line in the file, R² = 0.99999, and lands at 1.06 by coincidence. A straight \(\sqrt{t}\) plot tells you the voltage is smooth and says little about whether D is right.

The choice of \(E_1\) is another hidden knob. On pulse 16, moving \(E_1\) from 1 s to 10 s after switch-on takes the answer from 0.80 to 0.95, and 60 s gives 1.47. A cycler logging every 10 s therefore reports a better-looking D than one logging every second, for no physical reason.

3. V/S: one length, squared

For a sphere, \(V/S=(\tfrac{4}{3}\pi R^3)/(4\pi R^2)=R/3\). The length enters squared, so using the radius itself multiplies D by 9, and the diameter by 36. On pulses 15 to 18 the formula gives 0.79–0.81 with \(R/3\), 7.1–7.3 with \(R\), and 28.5–29.3 with \(2R\). Confusing a primary-particle radius of 0.25 µm with a secondary-particle radius of 5 µm moves D by a factor of 400, which is more than two orders of magnitude from one line of a methods section.

Within this fixed single-sphere diffusion model and charge-to-stoichiometry mapping, voltage constrains \(D/R^2\), so the supplied radius sets the diffusivity scale. In the recorded radius test, 10 µm, 15 µm and 0.25 µm give factors 4.0, 9.0 and 1/400, with 16 ok and 4 warn and unchanged \(\hat\tau\) = 0.024. The rescaling \(D^{\prime}=D\,(R^{\prime}/R)^2\) preserves this model’s diffusion timescale. Report the inferred (D, R) pair; changing a real particle size does not by itself change the material’s intrinsic diffusivity by this rule.

A particle population adds a choice of representative radius. The recorded 40-bin lognormal tests use an area-weighted mean of 5 µm before truncation. For spheres this Sauter radius is ΣnR³/ΣnR² and gives \(V/S=R/3\) for the population. With that input, median estimates are 1.005, 1.017 and 1.037 of the prescribed D for relative widths 0.15, 0.30 and 0.50. Using the number-mean radius gives 0.92, 0.72 and 0.42 with the same status counts; SEM measurements need a stated sampling and stereological convention to estimate either population moment. At width 0.50, 18 of 20 pulses are warned for either radius. This test supports the stated approximation, not an exact single-radius representation for every distribution.

4. OCV curvature, the largest error on NMC811

Replacing the textbook formula with the exact sphere solution fixes the finite-size bias and leaves the scatter. The reason is geometry. During pulse 3, the bulk-average stoichiometry x changes from 0.33 to 0.36, while the surface stoichiometry reaches 0.414, because a 600 s pulse at this \(\hat\tau\) changes the surface stoichiometry by 2.8 times the change in the bulk average. Any method that scales the voltage with \(\Delta E_s\) assumes the OCV between 0.33 and 0.414 has the slope it has between 0.33 and 0.36. On this curve \(\Delta E_s\) is 21 mV for pulse 3 and 44 mV for pulse 4, so that slope is wrong by a factor of about two.

The script below fits the relaxation after each pulse with the exact sphere response, twice. The first fit is linear in the OCV, with its amplitude tied to \(\Delta E_s\). The second maps the model’s surface state through the measured OCV, meaning the relaxed voltages at the end of the rests. Nothing else differs.

"""Sphere relaxation fit on gitt.csv: linear OCV against OCV mapped through the
rest-end voltages. Same model both ways, only the map from surface state to
voltage differs. Needs numpy and scipy."""
import numpy as np
from scipy.interpolate import PchipInterpolator
from scipy.optimize import brentq, minimize_scalar
from scipy.special import erf

R, D_TRUE = 5e-6, 1e-15                 # use 6e-6, 2e-15 for the graphite case

roots = np.array([brentq(lambda a: np.sin(a) - a * np.cos(a),
                         k * np.pi + 1e-9, k * np.pi + np.pi / 2 - 1e-9) for k in range(1, 200)])


def h(tp):
    """Surface response of a sphere to a constant flux, tp = D t / R^2."""
    tp = np.asarray(tp, float)
    short = np.exp(np.minimum(tp, 1)) * (1 + erf(np.sqrt(tp))) - 1
    terms = np.exp(-np.outer(tp, roots**2)) / roots**2
    return np.where(tp < 0.05, short, 3 * tp + 0.2 - 2 * terms.sum(axis=1))


t, I, V = np.loadtxt("gitt.csv", delimiter=",", skiprows=1).T
on = np.abs(I) > 0.1 * np.abs(I).max()
starts = np.flatnonzero(on[1:] & ~on[:-1]) + 1
ends = np.flatnonzero(on[:-1] & ~on[1:])
rest_ends = np.append(starts[1:] - 1, len(t) - 1)

# OCV table: relaxed voltage against charge passed
Q = np.cumsum(I * np.diff(t, prepend=t[0]))
q = np.concatenate([[Q[starts[0] - 1]], Q[ends]])
E = np.concatenate([[V[starts[0] - 1]], V[rest_ends]])
order = np.argsort(q)
ocv = PchipInterpolator(q[order], E[order], extrapolate=True)
span = q.max() - q.min()


def fit(model, v):
    """Best D by least squares, with a free voltage offset."""
    def sse(logD):
        g = model(10**logD)
        return np.inf if not np.isfinite(g).all() else ((v - g - (v - g).mean())**2).sum()
    grid = np.linspace(-19, -9, 121)
    i = int(np.argmin([sse(x) for x in grid]))
    return 10**minimize_scalar(sse, bounds=(grid[max(i - 1, 0)], grid[min(i + 1, 120)]),
                               method="bounded", options={"xatol": 1e-6}).x


lin, mapped = [], []
for k, (a, b, c) in enumerate(zip(starts, ends, rest_ends)):
    tau, Ip = t[b] - t[a - 1], I[b]
    dEs = V[c] - V[a - 1]
    tr, vr = t[b + 1:c + 1] - t[b], V[b + 1:c + 1]
    w = (tr >= max(tr[1], 0.05 * tau)) & (tr <= 3 * tau)
    tr, vr = tr[w], vr[w]

    def relax(D):
        return h(D * (tr + tau) / R**2) - h(D * tr / R**2)

    def surface(D):
        qs = Q[a - 1] + Ip * R**2 / (3 * D) * relax(D)
        return np.where((qs < q.min() - span) | (qs > q.max() + span), np.nan, qs)

    D_lin = fit(lambda D: dEs * R**2 / (3 * tau * D) * relax(D), vr)
    D_map = fit(lambda D: ocv(surface(D)), vr)
    qs0 = surface(D_map)[0]
    inside = q.min() - 0.02 * span <= qs0 <= q.max() + 0.02 * span
    print(f"{k + 1:2d}  linear {D_lin / D_TRUE:6.3f}   mapped {D_map / D_TRUE:6.3f}"
          + ("" if inside else "   (surface leaves the OCV table)"))
    if inside and abs(dEs) >= 1e-3:
        lin.append(D_lin / D_TRUE)
        mapped.append(D_map / D_TRUE)

print(f"{len(lin)} pulses  linear {min(lin):.2f}-{max(lin):.2f}"
      f"  mapped {min(mapped):.2f}-{max(mapped):.2f}")
 1  linear  4.754   mapped  1.193
 2  linear  0.751   mapped  0.941
 3  linear  0.258   mapped  1.024
 4  linear  0.886   mapped  1.012
 5  linear  1.276   mapped  0.999
 6  linear  1.221   mapped  0.994
 7  linear  0.941   mapped  0.995
 8  linear  0.740   mapped  1.000
 9  linear  0.859   mapped  1.008
10  linear  1.270   mapped  1.006
11  linear  1.482   mapped  0.997
12  linear  1.326   mapped  0.994
13  linear  1.141   mapped  0.996
14  linear  1.050   mapped  0.998
15  linear  1.016   mapped  0.998
16  linear  1.005   mapped  0.999
17  linear  1.001   mapped  0.999
18  linear  0.999   mapped  0.999
19  linear  0.999   mapped  0.999
20  linear  0.999   mapped  0.999   (surface leaves the OCV table)
19 pulses  linear 0.26-4.75  mapped 0.94-1.19

The linear-OCV column reproduces the 0.26–4.75 range that the analyser’s documentation quotes, this time on PyBaMM output: 0.258 to 4.754, the same numbers an independent finite-volume solver gave. The mapped column stays within 0.94–1.19. The analyser’s own linear mode gives 0.26–4.63 on this file, because it places the switching time half a logging interval later (see section 6), and that moves the worst pulse.

Both columns come from a good-looking fit. On pulse 3 the linear-OCV fit has a relative residual of 1.5%, inside the 2% the analyser accepts for that check, at a quarter of the true D. The analyser’s linear mode fails this pulse on three other checks: C3 (relaxation completeness, judged with the wrong D), C9 (OCV curvature) and C10 (D gradient between neighbours).

Ratio of found D to true D against stoichiometry for constant-D PyBaMM titrations. On NMC811 the Weppner-Huggins formula ranges from 0.25 to 3.1 and the linear-OCV relaxation fit from 0.26 to 4.6, while the OCV-mapped relaxation fit stays near 1. On graphite the Weppner-Huggins formula falls to 0.014 near x = 0.52 and the mapped fit stays near 1 except for the last pulse, which is marked fail.
The same two titrations through three analyses. The true D is constant, so the black line is the correct answer at every x. The dips near x = 0.35 on NMC811 and x = 0.5 on graphite look like features of the material and come entirely from the analysis.

5. Plateaus: where the scatter reaches orders of magnitude

Graphite is the harsh version of the same effect. Running the script with graphite puts the Chen2020 graphite OCP in the working electrode, with R = 6 µm and a constant D of 2×10⁻¹⁵ m²/s. The relaxation script then gives 0.08–6.21 for the linear OCV and 0.79–1.09 for the mapped fit over the 15 pulses with \(|\Delta E_s|\) above 1 mV. The textbook formula gives 0.014 to 3.9 over all 20 pulses, a factor of 272. With 0.3 mV of voltage noise added, the range becomes 0.0067 to 3.4, a factor of about 500, from a material that has one D.

The minimum near x = 0.52 in the figure deserves a second look. A dip of nearly two decades at a staging transition is easy to read as slow diffusion near a phase change. In this simulation D is constant, so the whole dip is arithmetic. On that pulse the bulk sits on the plateau, where \(\Delta E_s\) is 0.56 mV, while the surface runs off the edge of the plateau and \(\Delta E_t\) is 9.6 mV, and D follows the square of their ratio. A dip like this is no evidence about the material on its own.

Graphite also shows the limit of the mapped fit. On pulse 20, where \(\Delta E_s\) is 0.06 mV, the analyser reports 6.4 times the truth and marks it fail. Mapping cannot rescue a pulse whose voltage carries no composition signal.

The Prada2013 LFP-OCP test uses a 50 nm radius and D = 5.9×10⁻¹⁸ m²/s with 0.3 mV noise. Of 20 pulses, 13 have \(|\Delta E_s|\) below 1 mV. The textbook estimates range from 0.03 to 5.9 times input D; all pulses fail the analyser’s checks and 10 yield no D. In a physical two-phase coexistence region, phase-boundary motion and a flat OCV require a model beyond the single-phase Fickian interpretation used here.

6. Pulse duration and the size of the step

The usual advice is to shorten the pulse so that the short-time assumption holds. At a fixed composition step that trades one error for another. In this sweep every run has the same \(\Delta x=0.03\) over x = 0.27–0.69, 14 pulses, so the current scales as 1/τ. Rests are 2 h, and 4 h after the 2 h pulses. Each cell gives the median and range of D found over D true. The 60 s run needs 7.8 mA and the 2 h run 0.065 mA.

τ (s) \(D\tau/R^2\) Surface step / bulk step W-H formula Relaxation, linear OCV Relaxation, OCV mapped Pulses ok
60 0.0024 8.0 1.36 (0.29–4.47) 1.33 (0.21–3.35) 1.06 (1.00–1.32) 1
150 0.006 5.2 1.18 (0.29–3.54) 1.27 (0.19–4.45) 1.02 (1.00–1.10) 10
600 0.024 2.8 0.88 (0.25–3.14) 1.10 (0.26–4.63) 1.00 (0.94–1.17) 10
1800 0.072 1.8 0.66 (0.28–1.34) 1.06 (0.50–1.92) 1.00 (0.74–1.38) 10
3600 0.144 1.45 0.50 (0.29–0.73) 1.04 (0.66–1.54) 1.00 (0.81–1.41) 10
7200 0.288 1.2 0.34 (0.25–0.40) 1.03 (0.75–1.37) 1.00 (0.86–1.37) 10

Read the W-H column from the bottom up and the formula looks better as the pulse gets shorter: the median climbs from 0.34 towards 1, then overshoots. The range tells the rest of the story. At 60 s the change in surface stoichiometry is 8 times the change in bulk-average stoichiometry, so curvature grows as the finite-size bias shrinks, and the range stays wide, with a low end near 0.3 and a high end of 3.1 to 4.5, until the pulses become long enough to average over the bends. Kang and Chueh note that most reports in their compilation extend past \(\hat\tau=0.25\) on their own stated D and L. At 0.288 the formula here reads a factor of three low, with a tidy spread that looks like precision.

Shrinking the step is what removes curvature. At a fixed 600 s pulse, the linear-OCV fit spans 0.26–4.63 at \(\Delta x=0.03\), 0.43–2.35 at 0.01 and 0.78–1.36 at 0.003, and the textbook formula narrows in step to 0.60–1.14 at 0.003. Section 9 shows what stops you from taking this to the limit.

Very short pulses add one more effect, which belongs to the analyser. Cyclers log the step boundary on different sides, so it places the switch halfway between the last rest row and the first pulse row. With 60 s pulses logged every second, that half second is 0.8% of τ and D reads 1.03–1.07. All 200 pulses in that run warn through check C11, which exists for this reason. Logging at 0.1 s brings them to 1.00–1.01 and 194 ok, and the independent reference fit with the switch at the true time gives 1.00.

Long pulses end at identifiability. At \(\hat\tau\) = 0.6 (R = 1 µm, 600 s) the relaxation fit still works, 0.89–1.30 with every pulse on warn, while the textbook formula reads 0.2. At 3.6 the voltage is close to linear in time with a slope that no longer depends on D: the formula reads 0.04, all 20 pulses fail in the analyser, D is reported as not identified on 2 of them, and the other 18 range from 0.16 to 1.20.

7. Rest length

The slowest diffusion mode of a sphere decays with time constant \(R^2/(4.493^2 D)\), which is 1238 s here. A 20-minute rest is therefore one time constant.

Rest \(Dt_{rest}/R^2\) Analyser status Relaxation, OCV mapped W-H median
20 min 0.048 20 fail 0.84 (0.71–1.07) 0.89
40 min 0.096 20 fail 0.94 (0.90–1.02) 0.83
1 h 0.144 20 warn 0.98 (0.96–1.11) 0.81
2 h 0.288 16 ok, 4 warn 1.00 (0.94–1.17) 0.80

An unfinished rest makes \(\Delta E_s\) an imperfect equilibrium difference and leaves a nonuniform initial concentration for the next pulse. The independent-pulse fits used here assume uniform initial concentration; a history-aware diffusion fit would need to carry the preceding profile. At 20 minutes, pulse and relaxation estimates have medians 1.13 and 0.84, respectively. The analyser’s C3 uses its fitted model to estimate unrelaxed fraction: at most 2% is ok and at most 5% is warn. Its separate \(t_{rest}\ge 0.2R^2/D\) recommendation is 5000 s here. The 40-minute pulses fail C3 despite estimates of 0.90–1.02, median 0.94; that is a conservative outcome for this test.

8. Voltage that does not come from diffusion

A constant series resistance cancels from the within-pulse voltage difference for a constant-current step when \(E_1\) is taken after the jump. In the recorded 20 Ω test the textbook estimate remains 0.80 of input D. Adding a 10 Ω, 10 s RC transient lowers it to 0.67; the relaxation estimate stays close to its baseline when its window begins 30 s after the switch. At three time constants an exponential transient retains about 5% of its amplitude, so the remaining influence depends on its size relative to the diffusion signal.

A slow transient is the worst result in this article. With a 10 Ω RC of 150 s, the relaxation fit reads 0.76–0.92, because the RC’s decay sits inside the window and looks like slow diffusion. The analyser marks 12 pulses ok at 0.78–0.89. Nothing in the residuals gives it away, and the mapped OCV cannot help. The analyser has a manual remedy, “Skip after each current switch” under Advanced, which starts both windows later. Setting it to 450 s, three time constants, gives 15 ok pulses at 0.96–1.00. The remedy needs you to know the time constant. Nickol et al. measured double-layer time constants below 1 s above 0 °C at medium lithiation, and 30–100 s at x above 0.9 below −10 °C, so this case is realistic for cold measurements near full lithiation. Impedance data can supply the number.

Composition-dependent kinetics are subtler, and here the model can test a claim from the literature. Kang and Chueh argue that a charge-transfer resistance changing during the pulse distorts the \(\sqrt{t}\) slope, and that this makes GITT read higher in one current direction than the other. In the Xu2019 set the exchange current density goes as \(\sqrt{c_s(c_{max}-c_s)}\), so the resistance rises as the surface approaches full lithiation. I lowered the exchange current density by 10 and by 100 and ran both directions, comparing the pulses near x = 0.825, with D the same in every run:

Exchange current W-H, lithiation W-H, delithiation Pulse fit, lithiation Pulse fit, delithiation Relaxation fit, both
as in Xu2019 0.79 0.82 0.97 1.02 1.00
÷10 0.66 0.91 0.78 1.15 1.00
÷100 0.58 1.03 0.66 1.34 1.00

Their mechanism appears exactly as described. An overpotential that grows during the pulse lowers the apparent D, one that shrinks raises it, and the pair splits by a factor of two with no difference in diffusion. Near x = 0.5, where the exchange current peaks, the split disappears. The relaxation fit carries no current, so it reads 1.00 in all six runs. The analyser’s status stays at ok because its headline is the relaxation fit, and check C8, which compares the two fits, fired on only 2 pulses of the ÷100 lithiation run. So a direction difference seen in a pulse-based D should send you to the relaxation before anyone concludes that diffusion differs by direction.

9. Noise sets the floor on the step size

D goes as \(\Delta E_s^2\), so small steps pay twice. I added 0.3 mV Gaussian noise, quantised to 0.1 mV, to the noise-free runs with ten different seeds. The numbers below cover the mapped relaxation fit over all ten seeds, leaving out the first and last two pulses of each run.

\(\Delta x\) \(\Delta E_s\) at x > 0.7 Middle 95% of D found / D true Extremes Pulses ok per run
0.03 24 mV 0.98–1.03 0.97–1.03 15–16 of 20
0.01 8 mV 0.96–1.05 0.93–1.07 17–20 of 60
0.003 2.4 mV 0.85–1.18 0.61–1.47 0 of 200
0.001 0.8 mV 0.63–1.62 0.54–2.19 0 of 200

The reported median rounds to 1.00 in every row, while the spread grows at smaller steps. This does not establish unbiasedness of the mean or of every noise model. In this synthetic case, \(\Delta x\) = 0.01–0.03 and an equilibrium-voltage change around 25 times the noise provide a workable starting point. Most \(\Delta x=0.01\) pulses are warned by C6 despite estimates within a few percent of input D.

10. What the analyser’s checks catch, and what they miss

Each row below is one run of the production analyser code. “Off” counts pulses more than 10% from the truth, or with no D at all. The fifth column is the number that matters: pulses that were off and still marked ok.

Run Pulses ok / warn / fail Off Off and ok Range of ok pulses
NMC811 baseline 20 16 / 4 / 0 1 0 1.00–1.03
Baseline with 0.3 mV noise 20 16 / 4 / 0 1 0 0.99–1.03
Delithiation 20 17 / 1 / 2 1 0 0.94–1.06
Graphite 20 9 / 9 / 2 3 0 0.90–1.09
Graphite with noise 20 5 / 5 / 10 9 1 0.88–1.09
LFP with noise 20 0 / 0 / 20 19 0 none
Rest of 20 min 20 0 / 0 / 20 17 0 none
\(D\tau/R^2=3.6\) 20 0 / 0 / 20 14 0 none
DFN half cell 20 16 / 4 / 0 1 0 0.99–1.03
Full-cell voltage, Chen2020 17 3 / 13 / 1 10 0 0.96–1.01
Slow RC, 150 s 20 12 / 8 / 0 19 12 0.78–0.89
Default PyBaMM mesh 20 16 / 4 / 0 15 12 0.89–0.93
Radius typed as 10 µm 20 16 / 4 / 0 20 16 3.98–4.11

In these tested plateau, short-rest, long-pulse and OCV-range cases, the checks flag the large errors except one noisy graphite pulse that is 12% off. Warned pulses range from close to input D to almost twice it, so report both the estimate and the specific failed or warned checks.

The last three rows expose different gaps in the checks: a slow RC process, numerical error in the generating model and a wrong radius can each fit the selected diffusion response with a biased parameter. “ok” means that the implemented checks passed under the selected model and inputs.

The reported DFN half-cell result, including porous-electrode and electrolyte transport, agrees with the single-particle result within 1% at 0.78 mA on a 4.3 mAh, 42 µm electrode (about C/6); the 60 s DFN case also agrees with its SPM counterpart. The full-cell case has only three ok pulses. Chen2020’s graphite D is eight times its cathode D, but transient dominance also depends on radius, OCP slope and electrode capacity, and the two contributions were not separated in this test. Inferring separate electrode diffusivities from full-cell voltage therefore requires a model and data that distinguish both contributions.

11. A worked example you can repeat in the browser

Open the GITT analyser and press “Load example data (synthetic, known D)”. The file is a delithiation of the same NMC811 curve, generated with an independent finite-volume solver, with R = 5 µm, D = 1.0×10⁻¹⁵ m²/s, 1.5 h rests, a 15 Ω series resistance, an 8 Ω / 5 s RC element and 0.3 mV noise. The form fills itself in and the summary reads 14 ok, 4 warn, 2 fail. Click row 8.

The panel for pulse 8 gives \(\Delta E_s\) = 27.44 mV, \(\Delta E_t\) = 95.50 mV and τ = 600 s, and those three numbers are enough for a calculator:

$$D_{WH}=\frac{4}{\pi\times 600}\left(\frac{5\times 10^{-6}}{3}\right)^{2}\left(\frac{27.44}{95.50}\right)^{2}=4.87\times 10^{-16}\ \mathrm{m^2/s}$$

That matches the W-H line in the panel’s table of estimates, and it is 0.49 of the truth. The panel’s predicted bias for the formula at this \(\hat\tau\) is 0.75, so finite size explains only part of the gap. Pulses 1 to 4, where this OCV is nearly straight, read 0.70–0.72, so the RC element and the timing of \(E_1\) add little. The rest is curvature: the bulk moves from x = 0.66 to 0.63, the surface reaches 0.576, and \(\Delta E_s\) grows from 25 mV on pulse 7 to 33 mV on pulse 9. The other lines of the table show the same ladder as section 4: 4.36×10⁻¹⁶ for the \(\sqrt{t}\) slope, 5.68×10⁻¹⁶ for the pulse fit with a linear OCV, 7.27×10⁻¹⁶ for the relaxation fit with a linear OCV, and 9.95×10⁻¹⁶ for the OCV-mapped relaxation fit, with a 95% interval of 9.37×10⁻¹⁶ to 1.06×10⁻¹⁵. The rest line says 5400 s against a recommended 5030 s, so this file sits just above the rule.

Now open Advanced and switch the estimator to “linear OCV”. Pulse 8 drops to 7.27×10⁻¹⁶ and turns to fail on C9 and C10, and the summary falls to 5 ok, 1 warn, 14 fail. Switch back, and the 14 ok pulses read 0.986–1.011 of the truth. Pulse 20 is the instructive failure: the surface has left the measured OCV, the rest is not finished, and the analyser falls back to the linear fit at 5.55×10⁻¹⁶ and says so.

To repeat the PyBaMM runs, take the gitt.csv from section 1 and drop it on the same page. Choose spheres with R = 5 µm, x at start 0.27 and Qx = 4.331 mAh per unit x, and tick the half-cell box. You should get 16 ok and 4 warn. Then type 10 in the radius box and watch every D quadruple with no change in status.

12. The order I would check things in

The measurements above suggest a sequence, with the most expensive mistakes first.

  1. Choose the diffusion length and record its source. For a single-radius spherical approximation, report the radius convention, any distribution and the inferred D together.
  2. For the OCV-mapped spherical estimator tested here, \(D\tau/R^2\) below about 0.3, a voltage step at least 25 times the noise and \(\Delta x\) = 0.01–0.03 were useful starting points. The classical short-time W-H approximation requires much smaller dimensionless time; check its finite-size error separately.
  3. Use \(0.2R^2/D\) as the tested rest-length starting point, then check residual relaxation. Record switching times explicitly or sample around each switch at τ/100 or finer; the tested τ/60 interval read about 4% high from timing.
  4. Take D from the relaxation, with the voltage mapped through the measured OCV. Treat the textbook formula as a rough first look.
  5. With the stated noise and estimator, flag plateau pulses with \(|\Delta E_s|\) below about 1 mV. Set the signal threshold from the measurement noise and identifiability checks rather than applying 1 mV universally.
  6. Compare the pulse fit with the relaxation fit, and lithiation with delithiation. If only the pulse-based values disagree, suspect kinetics.
  7. For cold or highly lithiated conditions with overlapping RC dynamics, estimate the relevant time constants from impedance. Three time constants leave about 5% of an exponential amplitude; verify the estimate’s stability as the skipped interval changes.

One error source is missing from all these runs. At small pulse currents a parasitic current makes the Faradaic current differ from the applied one, and the conversion to D needs the Faradaic current. Kang et al. separate the two by repeating each pulse at three or more magnitudes. My simulations contain none, so I have no measurement of its size.

13. How this was measured

  • PyBaMM 26.10.1.1, Python 3.13, Apple M3. SPM half cell on the Xu2019 set with the OCP swapped as described, IDAKLUSolver at rtol 10⁻⁹ and atol 10⁻¹¹ (10⁻⁷ and 10⁻⁹ for the many-particle runs and for the DFN, which fails to initialise at the tighter setting), isothermal, 25 °C. Particle mesh: 480 points graded to the surface, or 60 graded points for DFN and many-particle runs.
  • The three scripts above were run as printed, and their output is pasted unchanged. As files: gitt_pybamm.py, wh_check.py, relax_fit.py.
  • Analyser results come from the production JavaScript (version 1.0.0), run in Node on each CSV. The relaxation numbers were cross-checked with an independent Python reference, and the worked example was read from the rendered page.
  • The RC elements are added to PyBaMM’s voltage afterwards, integrated exactly for piecewise-constant current. Noise is added last. The many-particle runs use 40 size bins and 60 radial points, with the lognormal cut at three times the mean, which lowers the area-weighted mean to 4.93 µm at a width of 0.50.
  • With a known D(x) varying 5-fold (the same NMC811 curve), the ok pulses read 0.96–1.02 of D at the assigned stoichiometry in both directions, against 0.19–0.90 for the textbook formula. One pulse sweeps a range of x, so the D it reports belongs to that range.
  • All data here are simulations of single-phase Fickian particles, so they measure errors of analysis. They give no value of D for any real material and contain no inter-particle reaction heterogeneity, phase separation or parasitic current.
  • The NMC noise summary in section 9 uses ten random seeds; the \(\Delta x=0.001\) row covers x=0.65–0.85. The graphite and LFP noise rows in the section 10 status table each use one seed. The τ/100 logging interval is an operating recommendation between the tested τ/60 (about +4%) and τ/150 (about +2%) intervals.

References

Related: the GITT analyser runs everything in section 11 in your browser and exports the result as a PyBaMM diffusivity function. Fitting PyBaMM parameters and identifiability covers the same problem of a good fit with a meaningless number at the level of whole parameter sets, and the dQ/dV analyser shows where a material’s plateaus sit before you trust a D there.

A tool I built

Validate your cell model on independent data

VoltSift is an online workspace I built. Upload three CSV files (a fitting record, an independent validation record and an open-circuit voltage curve), and it fits a cell model, checks voltage error and coverage on the held-out record, and produces a report. The standard workflow supports single NMC cells at 25°C and SOC 20%–100%. Register and verify your email to get one free analysis, available for seven days.

Visit VoltSift · Prepare the three CSV files · How to read the validation results

Leave a Reply

Scroll down