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 negative_electrodes” will copy directory foo in “pybamm/input/parameters/lithium-ion/negative_electrodes”.

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

Remove a parameter directory from package input directory.

Example: “rm_parameter foo lithium-ion negative_electrodes” will remove directory foo in “pybamm/input/parameters/lithium-ion/negative_electrodes”.

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

Copy a given default parameter directory to the current working directory for editing. For example

edit_param(["lithium-ion"])

will create the directory structure:

lithium-ion/
  negative_electrodes/
    graphite_Chen2020
    ...
  positive_electrodes/
  ...

in the current working directory.