Overview
Piecewise interpolation addresses several needs:- 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
Mathematical Formulation
Smooth Heaviside Function
Traditional piecewise functions use discontinuous step functions, which cause convergence issues in ODE/DAE solvers. Instead, we use a smooth approximation: where:- is the input variable (e.g., SOC)
- is the threshold value
- is the smoothing parameter (larger = smoother transition)
1D Piecewise Linear Interpolation
For a parameter varying with , given breakpoints with values : Each linear segment interpolates between adjacent knots:Piecewise Parameter Functions
1D Interpolation
For parameters that vary with a single variable (typically SOC), aPiecewiseInterpolation1D direct entry takes a base parameter name, a list of breakpoint values along the independent variable, and a smoothing parameter. The interpolant reads one parameter per breakpoint (e.g. "Negative particle diffusivity at SOC 0.3 [m2.s-1]") and returns a smooth function of the independent variable.
2D Interpolation
For parameters varying with two variables (e.g., SOC and temperature), aPiecewiseInterpolation2D direct entry takes breakpoints along both axes and separate smoothing parameters for each.
Use different smoothing parameters for dimensions with different scales (e.g., SOC in [0, 1] vs Temperature in [273, 323] K).
To configure these interpolants in a pipeline, see Pipelines → Calculations → Piecewise.
Formulations: Knots vs Slopes
Two equivalent parameterizations are available:| Formulation | Parameters | Best for |
|---|---|---|
| Knots | Values at each breakpoint | Direct measurements |
| Slopes | Initial value + slopes between breakpoints | Optimization (smoother landscape) |
SlopesToKnots.
OCP Interpolants
Open-circuit potential (OCP) interpolants are specialized functions that return equilibrium voltage for a given stoichiometry.From Experimental Data
AnOCPDataInterpolant calculation builds a smooth interpolant from half-cell OCP measurements. Data should be collected at low C-rates (C/20 or slower) to approximate equilibrium.
From MSMR Parameters
AnOCPMSMRInterpolant calculation evaluates the MSMR model over a voltage range to create an interpolant. This provides thermodynamic consistency and reliable extrapolation.
Blended MSMR / Experimental OCP
The recommended approach combines experimental data with MSMR extrapolation viaOCPDataInterpolantMSMRExtrapolation. The blending function smoothly transitions between data and MSMR:
where is a bump function that equals ~1 inside the data range and ~0 outside.
The Inaccessible Lithium Problem
Experimental OCP data never covers the full 0-1 stoichiometry range due to:- Electrolyte decomposition at low voltages
- Structural instability at high voltages
Numerical Considerations
Smoothing Parameter Selection
| Value | Effect |
|---|---|
| Too small | Approaches discontinuous, may cause solver issues |
| Too large | Excessive smoothing, reduces accuracy |
| Recommended | to (range of variable) |
Extrapolation Behavior
Both piecewise and OCP interpolants use constant extrapolation outside their defined ranges. This prevents unbounded values and is physically reasonable for many battery parameters.Common Use Cases
SOC-Dependent Diffusivity
Capture phase transitions or concentration effects on transport
OCP Functions
Define equilibrium voltage for electrochemical models
Temperature Effects
Non-Arrhenius temperature dependence
Coupled Dependencies
Parameters depending on multiple variables simultaneously
Best Practices
- Breakpoint placement: Place more breakpoints where the parameter changes rapidly
- Smoothing selection: Start with defaults; increase if solver has trouble
- Visualization: Always plot interpolants across the full range to check for artifacts
- MSMR for OCP: Use blended interpolants for robust extrapolation