Documentation Index
Fetch the complete documentation index at: https://docs.ionworks.com/llms.txt
Use this file to discover all available pages before exploring further.
What is an Interpolant?
An interpolant is a parameter defined as a lookup table rather than a single value or mathematical expression. Interpolants are ideal for representing experimental data or complex relationships that don’t have simple mathematical formulas. When you define a parameter as an interpolant, you provide discrete data points, and Ionworks Studio automatically interpolates between them during simulations.When to Use Interpolants
Interpolants are particularly useful for:- Open-circuit potential (OCP) curves: Voltage as a function of stoichiometry from experimental measurements
- Diffusivity data: Diffusion coefficients that vary non-linearly with concentration or temperature
- Temperature-dependent properties: Physical properties measured at discrete temperature points
- Complex multi-variable relationships: Parameters that depend on multiple inputs (e.g., conductivity as a function of both concentration and temperature)
Creating an Interpolant
Step 1: Identify Compatible Parameters
Not all parameters can be converted to interpolants. Only parameters that accept function inputs can become interpolants. To check if a parameter can be an interpolant:- Navigate to the Model Editor when creating or cloning a model
- Look for the parameter you want to modify
- Click the change circle icon (⟳) next to the parameter value
- If “Interpolant” appears in the menu, the parameter supports interpolants
Parameters that only accept scalar values (like geometric dimensions) cannot
be converted to interpolants.
Step 2: Convert the Parameter Type
To convert a parameter to an interpolant:- Click the change circle icon (⟳) next to the parameter value
- Select Interpolant from the dropdown menu
- The interpolant editor will open
Step 3: Enter Data
You have two options for entering interpolant data:Option A: Upload a CSV File
The quickest way to define an interpolant is to upload a CSV file:- In the interpolant editor, click the Upload File button or drag and drop a CSV file
- Format your CSV file with columns for:
- First column(s): Input variable(s) (e.g., stoichiometry, temperature)
- Last column: Output value (the parameter value)
Option B: Manual Entry
For smaller datasets, you can enter data points manually:- Click Insert Row Above or Insert Row Below to add new data points
- Click on any cell in the table to edit the value
- Enter your data points
- Use Delete Row to remove unwanted points
For 1D interpolants, you can edit both input (x) and output (y) values. For
multi-dimensional interpolants, only output (y) values are editable after
uploading data—input combinations must be defined via CSV.
Step 4: Choose Interpolation Method
Select the interpolation method that best fits your data:- Linear: Straight lines between data points. Best for coarse data or when you want to avoid overfitting.
- Cubic: Smooth curves using cubic splines. Ideal for smooth physical relationships.
- Pchip: Piecewise cubic Hermite interpolating polynomial. Prevents overshooting and is good for monotonic data.
Step 5: Preview and Save
- For 1D interpolants, a plot preview appears on the right side showing how your data will be interpolated
- Review the plot to ensure the interpolation looks physically reasonable
- Click Save to apply the interpolant to your parameter
Working with Multi-Dimensional Interpolants
Multi-dimensional interpolants allow you to define parameters that depend on multiple variables simultaneously (e.g., conductivity as a function of both concentration and temperature).Requirements
- The parameter must accept a function with multiple inputs
- Data must be provided as a CSV file with all input combinations you want to define
- The CSV format is:
input1, input2, ..., output
Example: Diffusivity(Stoichiometry, Temperature)
If a parameter accepts a function likeD(sto, T), you can create a 2D
interpolant:
Best Practices
Data Quality
- Use sufficient data points: For 1D interpolants, 10-20 points often provide good accuracy
- Cover the full range: Ensure your data spans the entire range the parameter will encounter during simulation
- Avoid extrapolation: Simulations that require parameter values outside your data range will extrapolate, which can lead to unphysical results
- Check for noise: Smooth or filter noisy experimental data before creating an interpolant
Testing Your Interpolant
After creating an interpolant:- Visual inspection: For 1D interpolants, check the plot preview to ensure the curve looks physically reasonable
- Run a test simulation: Verify that your model with the interpolant produces expected results
- Compare with original data: If converting from a function to an interpolant, compare simulation results to ensure consistency
Converting Between Parameter Types
You can always switch a parameter between value, function, and interpolant:- Click the change circle icon (⟳)
- Select the new type
- Ionworks Studio temporarily saves your previous parameter definition, so switching back preserves your work within the same editing session
Common Use Cases
Open-Circuit Potential (OCP)
The most common use of interpolants is for OCP curves:Positive electrode OCP [V] or Negative electrode OCP [V]
Temperature-Dependent Conductivity
Electrolyte conductivity [S.m-1]
Concentration-Dependent Diffusivity
Positive electrode diffusivity [m2.s-1] or
Negative electrode diffusivity [m2.s-1]
Technical Details
Interpolation Algorithms
- Linear: Uses
scipy.interpolate.interp1dwithkind='linear' - Cubic: Uses
scipy.interpolate.interp1dwithkind='cubic' - Pchip: Uses
scipy.interpolate.PchipInterpolator(monotonic cubic interpolation)
Interpolant class handles the evaluation of
interpolated values.
Troubleshooting
”Missing values in the table”
This error occurs when your data contains NaN or missing values. Check your CSV file for:- Empty cells
- Non-numeric data
- Formatting issues
Simulation fails with interpolant
If your simulation fails after adding an interpolant:- Check data range: Ensure your interpolant covers the full range of values encountered during simulation
- Try different interpolation method: Switch from cubic to linear or pchip
- Increase data points: Add more points in regions where the parameter changes rapidly
- Verify units: Confirm that your data uses the correct units for both inputs and outputs
Cannot convert parameter to interpolant
If the interpolant option doesn’t appear:- The parameter only accepts scalar values and cannot be an interpolant
- Try using a function parameter instead, or check the parameter library documentation for that specific parameter
Related Topics
- Models: Learn more about model creation and parameter configuration
- Simulations: Understand how interpolants are used during simulation