Converting a custom model into Pybamm class logic #2603
-
Hello, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 5 replies
-
Context: pybamm.Experiment handles the current control with a modular submodel, hence why "just" making a class like https://github.com/pybamm-team/PyBaMM/blob/develop/pybamm/models/full_battery_models/lithium_ion/basic_dfn.py is not enough. You want to use the structure of https://github.com/pybamm-team/PyBaMM/blob/develop/pybamm/models/submodels/base_submodel.py for your class; I will call it MyClass. Then, you need to make a second class following https://github.com/pybamm-team/PyBaMM/blob/develop/pybamm/models/full_battery_models/lithium_ion/base_lithium_ion_model.py. The line that makes it compatible with pybamm.Experiment is https://github.com/pybamm-team/PyBaMM/blob/develop/pybamm/models/full_battery_models/lithium_ion/base_lithium_ion_model.py#L69, |
Beta Was this translation helpful? Give feedback.
Context: pybamm.Experiment handles the current control with a modular submodel, hence why "just" making a class like https://github.com/pybamm-team/PyBaMM/blob/develop/pybamm/models/full_battery_models/lithium_ion/basic_dfn.py is not enough.
You want to use the structure of https://github.com/pybamm-team/PyBaMM/blob/develop/pybamm/models/submodels/base_submodel.py for your class; I will call it MyClass.
Then, you need to make a second class following https://github.com/pybamm-team/PyBaMM/blob/develop/pybamm/models/full_battery_models/lithium_ion/base_lithium_ion_model.py.
The line that makes it compatible with pybamm.Experiment is https://github.com/pybamm-team/PyBaMM/blob/develop/pybamm/…