Build smooth, differentiable piecewise interpolants for OCP, diffusivity, and SOC- or temperature-dependent battery parameters.
Many battery parameters depend on state of charge, temperature, or both. Piecewise interpolation enables the creation of smooth parameter functions suitable for physics-based models. This guide covers both general piecewise interpolants and specialized OCP interpolants.
SOC-dependent parameters: Diffusivity, exchange current density, and other transport properties often vary significantly with lithiation state
Temperature dependence: Non-Arrhenius behavior requires more flexible functional forms
OCP functions: Open-circuit potential must be defined across the full stoichiometry range for simulation
The implementation uses smooth heaviside functions to create continuous, differentiable interpolants that work well with differential equation solvers.
Traditional piecewise functions use discontinuous step functions, which cause convergence issues in ODE/DAE solvers. Instead, we use a smooth approximation:Hsmooth(x;θ,ϵ)=21(1+tanh(2ϵx−θ))where:
x is the input variable (e.g., SOC)
θ is the threshold value
ϵ is the smoothing parameter (larger = smoother transition)
The smooth heaviside is infinitely differentiable (C∞) and transitions from ~0 for x≪θ to ~1 for x≫θ.
For a parameter p varying with x, given breakpoints {x0,x1,…,xN−1} with values {p0,p1,…,pN−1}:p(x)=p0H0−(x)+i=0∑N−2piseg(x)Hiseg(x)+pN−1HN−1+(x)Each linear segment interpolates between adjacent knots:piseg(x)=pi+(pi+1−pi)xi+1−xix−xi
The blending function smoothly transitions between data and MSMR:U(x)=w(x)⋅Udata(x)+(1−w(x))⋅UMSMR(x)where w(x) is a bump function that equals ~1 inside the data range and ~0 outside.
Experimental OCP data never covers the full 0-1 stoichiometry range due to:
Electrolyte decomposition at low voltages
Structural instability at high voltages
Without physics-based extrapolation, simulations that access stoichiometries outside the data range produce unreliable results.
Always use MSMR blending if your simulation might access stoichiometries outside your experimental range. The MSMR model provides physically reasonable behavior at the extremes.
Both piecewise and OCP interpolants use constant extrapolation outside their defined ranges. This prevents unbounded values and is physically reasonable for many battery parameters.