Previous topic

Citations

Next topic

Adding Parameter Values

This Page

Parameters command line interface

PyBaMM comes with a small command line interface that can be used to manage parameter sets. By default, PyBaMM provides parameters in the “input” directory located in the pybamm package directory. If you wish to add new parameters, you can first pull a given parameter directory into the current working directory using the command pybamm_edit_parameter for manual editing. By default, PyBaMM first looks for parameter defined in the current working directory before falling back the package directory if nothing is found locally. If you wish to access a newly defined parameter set from anywhere in your system, you can use pybamm_add_parameter to copy a given parameter directory to the package directory. To get a list of currently available parameter sets, use pybamm_list_parameters.

pybamm.parameters_cli.add_parameter(arguments=None)[source]

Add a parameter directory to package input directory. This allows the parameters to be used from anywhere in the system.

Example: “add_parameter foo lithium-ion anodes” will copy directory foo in “pybamm/input/parameters/lithium-ion/anodes”.

pybamm.parameters_cli.edit_parameter(arguments=None)[source]

Copy a given parameter package directory to the current working directory for editing. The copy preserves the directory structure within the “input” directory, i.e

edit_param(["graphite_Kim2011","lithium-ion","anodes"])

will create the directory structure “input/parameters/lithium-ion/anodes/graphite_Kim2011” in the current working directory.

pybamm.parameters_cli.list_parameters(arguments=None)[source]

Output a list of available parameter sets for a given chemistry and component. The list is divided into package parameter serts and local parameter sets, located in the current working directory.

>>> from pybamm.parameters_cli import list_parameters
>>> list_parameters(["lithium-ion", "anodes"])
Available package parameters:
  * graphite_Ecker2015
  * graphite_Chen2020
  * graphite_mcmb2528_Marquis2019
  * graphite_Kim2011
Available local parameters: