Functional parameters

Battery models contain functional parameters. The most important one is probably the OCV function, but we have also the ionic conductivity and diffusion in the electrolyte.

The function definitions are given in the input json file, using one of the following formats:

  1. Function name

  2. Function formula

  3. Tabulated function

The json schema that describes the interface is available here.

The keyword to choose the format is given by functionFormat.

The keyword argumentList is common to all the formats and is used to describe the list of arguments that will be sent to the function. The argument names given there are independent to the implementation in itself. They indicates the meaning of the arguments.

Let us go through each different format separatly. For each format, we start by giving an example.

Function name

{
  "functionFormat" : "named function",
  "functionName" : "computeOCP_Graphite_Torchio",
  "argumentList" : ["stoichiometry"]
}

For a formula, the function format is set to "named function".

With the key "functionName", we give the name of the function. In matlab, this function should then be found in the function path (more on the in matlab documentation).

The key argumentList is used to describe the list of arguments that will be sent to the function. Note that the names do not necessarily to the one used in the implementation itself, as we can check in the implementation of computeOCP_Graphite_Torchio where the argument there is set to the variable name theta.

Function formula

{
    "functionFormat": "string expression",
    "argumentList": ["var1", "var2"],
    "expression" : {"language" : "matlab",
                    "variableNames" : ["x", "y"],
                    "formula" : "x + y"}
}

For a formula, the function format is set to "string expression".

The key argumentList is used to describe the list of arguments that will be sent to the functions. Again, it is not related to the actual implementation described under the key expression.

With the key "expression", we give the expression which, once evaluated, will give the value of the function.

The key language is used to provide the programming language that the expression should be evaluated with. The default value is matlab but we aim at a language agnostic interface and we open for the possibility to include an expression using an other language, even if it is not supported in the matlab code.

The key formula is used to give the expression that we will be run and return the value. The variable names should be given using the key variableNames.

You can find an example in the json file chen2020_positive_electrode_interface.json.

Tabulated function

{"functionFormat": "tabulated",
 "argumentList" : ["stoichiometry"],
 "dataX" : [0, 1, 2],
 "dataY" : [4, 3, 2]
}

Tabulated functions are given by a set of point values in the form of a table. Between the given points, the value is obtained by linear interpolation.

For a tabulated function, the function format is set to "tabulated".

The keys dataX and dataY are used to provide the data points of the function.

You can find an example in the json file LFP_Xu2015.json

Example

Example script