# PyBaMM Q&A

**URL:** https://pybamm.discourse.group/c/pybamm-qa/6.md?page=2

[Latest](https://pybamm.discourse.group/latest.md) · [Categories](https://pybamm.discourse.group/categories.md) · [Tags](https://pybamm.discourse.group/tags.md)

**Page:** 3

---

## [How are the voltage step simulations implemented?](https://pybamm.discourse.group/t/how-are-the-voltage-step-simulations-implemented/222)

<div class="topic-metadata">

**Author:** [@brian\_osp](https://pybamm.discourse.group/u/brian_osp)\
**Replies:** 1\
**Last updated:** [11 March 2025 00:26 UTC](https://pybamm.discourse.group/t/how-are-the-voltage-step-simulations-implemented/222 "2025-03-11T00:26:05Z")

</div>

Hi. I’ve been using PyBaMM for parameters identification, mostly using constant current experiments. I would like to use also constant voltage data, but before I would like to understand how the voltage-controlled steps…

---

## [How to disable already existing events in a model?](https://pybamm.discourse.group/t/how-to-disable-already-existing-events-in-a-model/203)

<div class="topic-metadata">

**Author:** [@alighato](https://pybamm.discourse.group/u/alighato)\
**Replies:** 2\
**Last updated:** [6 March 2025 18:38 UTC](https://pybamm.discourse.group/t/how-to-disable-already-existing-events-in-a-model/203 "2025-03-06T18:38:42Z")

</div>

Hello everyone, I am trying to run a Single Particle Model (SPM) simulation and want to allow the cell voltage to go beyond the usual operating limits (i.e., I do not want the simulation to stop once the voltage crosses…

---

## [Electrolyte gassing in Lithium-ion batteries](https://pybamm.discourse.group/t/electrolyte-gassing-in-lithium-ion-batteries/212)

<div class="topic-metadata">

**Author:** [@Salah](https://pybamm.discourse.group/u/Salah)\
**Replies:** 0\
**Last updated:** [3 March 2025 14:31 UTC](https://pybamm.discourse.group/t/electrolyte-gassing-in-lithium-ion-batteries/212 "2025-03-03T14:31:19Z")

</div>

Hello, I’m trying to simulate the electrolyte gassing in Li-ion batteries but i couldn’t find refrences that has equations that include the Cumulative gas volume and the Gas volume production rate.

---

## [Surface Concentration at t=0 for a SPM.](https://pybamm.discourse.group/t/surface-concentration-at-t-0-for-a-spm/193)

<div class="topic-metadata">

**Author:** [@UelDoy](https://pybamm.discourse.group/u/UelDoy)\
**Replies:** 1\
**Last updated:** [26 February 2025 18:20 UTC](https://pybamm.discourse.group/t/surface-concentration-at-t-0-for-a-spm/193 "2025-02-26T18:20:24Z")

</div>

Hii, At t=0, Since there is a finite value of current that exits, the surface concentration ( boundary value) should be different than initial concentration as a gradient wrt r exists at t=0. But, The solution variab…

---

## [Modify the plating.py issue](https://pybamm.discourse.group/t/modify-the-plating-py-issue/197)

<div class="topic-metadata">

**Author:** [@travis\_wu](https://pybamm.discourse.group/u/travis_wu)\
**Replies:** 0\
**Last updated:** [21 February 2025 02:24 UTC](https://pybamm.discourse.group/t/modify-the-plating-py-issue/197 "2025-02-21T02:24:10Z")

</div>

I want to set j\_stripping to 0 when eta\_plating is greater than 0, while keeping the rest of the calculations unchanged. So, I modified the code as follows: I have confirmed that the logic is correct, but I am unable…

---

## [Change parameter function inputs](https://pybamm.discourse.group/t/change-parameter-function-inputs/133)

<div class="topic-metadata">

**Author:** [@derek](https://pybamm.discourse.group/u/derek)\
**Replies:** 5\
**Last updated:** [19 February 2025 14:43 UTC](https://pybamm.discourse.group/t/change-parameter-function-inputs/133 "2025-02-19T14:43:01Z")

</div>

I am currently creating a routine for parameter estimation based on experimental data. It would be helpful for me if it was possible to customize the inputs in parameter functions to align with the inputs to my parameter…

---

## [Save data to format csv is not work](https://pybamm.discourse.group/t/save-data-to-format-csv-is-not-work/179)

<div class="topic-metadata">

**Author:** [@naltang](https://pybamm.discourse.group/u/naltang)\
**Replies:** 1\
**Last updated:** [19 February 2025 14:36 UTC](https://pybamm.discourse.group/t/save-data-to-format-csv-is-not-work/179 "2025-02-19T14:36:22Z")

</div>

sol.save\_data(\*\*\*,to\_format=“csv”) was worked at the previous version, but it is not work after updating to newer version. What am I gonna do? Here is my code: %pip install pybamm -q # install PyBaMM if it is not i…

---

## [More efficient way to update simulation parameters between runs; Make individual runs faster](https://pybamm.discourse.group/t/more-efficient-way-to-update-simulation-parameters-between-runs-make-individual-runs-faster/180)

<div class="topic-metadata">

**Author:** [@derek](https://pybamm.discourse.group/u/derek)\
**Replies:** 1\
**Last updated:** [19 February 2025 14:30 UTC](https://pybamm.discourse.group/t/more-efficient-way-to-update-simulation-parameters-between-runs-make-individual-runs-faster/180 "2025-02-19T14:30:05Z")

</div>

Hi I am using pybamm in a parameter estimation format. In the code below model.full\_routine will call the following equation 1000s of times. current\_interpolant = pybamm.Interpolant(t, I, pybamm.t) param1\["Current funct…

---

## [Why Is My Simulation Loop Much Slower Than a Single Experiment?](https://pybamm.discourse.group/t/why-is-my-simulation-loop-much-slower-than-a-single-experiment/85)

<div class="topic-metadata">

**Author:** [@ErfanSamadi1998](https://pybamm.discourse.group/u/ErfanSamadi1998)\
**Replies:** 14\
**Last updated:** [17 February 2025 23:14 UTC](https://pybamm.discourse.group/t/why-is-my-simulation-loop-much-slower-than-a-single-experiment/85 "2025-02-17T23:14:46Z")

</div>

Hi, I noticed a big difference in the time it takes to run two similar simulations in PyBaMM, and I don’t understand why. Here’s what I mean: Case 1: This code runs in 12.6 seconds: import pybamm options = {"thermal"…

---

## [Question on the DFN surface formulation model equations](https://pybamm.discourse.group/t/question-on-the-dfn-surface-formulation-model-equations/170)

<div class="topic-metadata">

**Author:** [@tosh07](https://pybamm.discourse.group/u/tosh07)\
**Replies:** 0\
**Last updated:** [13 February 2025 12:42 UTC](https://pybamm.discourse.group/t/question-on-the-dfn-surface-formulation-model-equations/170 "2025-02-13T12:42:56Z")

</div>

Hi Everyone, This is just a question about the model equations for the ‘surface formulation’ of the DFN model. I am running some simple simulations to compare this formulation with other model types. I was just curious…

---

## [Controlling PyBaMM from MATLAB: Stepping the solver, managing interval values, and extracting variables from the solution object](https://pybamm.discourse.group/t/controlling-pybamm-from-matlab-stepping-the-solver-managing-interval-values-and-extracting-variables-from-the-solution-object/121)

<div class="topic-metadata">

**Author:** [@mo\_pb](https://pybamm.discourse.group/u/mo_pb)\
**Replies:** 2\
**Last updated:** [12 February 2025 13:00 UTC](https://pybamm.discourse.group/t/controlling-pybamm-from-matlab-stepping-the-solver-managing-interval-values-and-extracting-variables-from-the-solution-object/121 "2025-02-12T13:00:24Z")

</div>

General Idea I would like to call PyBaMM from MATLAB and advance the simulation by one time step in each function call using the step() method (sim.step()). During this process, I want to adapt certain input values such…

---

## [Questions about simulation.step()](https://pybamm.discourse.group/t/questions-about-simulation-step/146)

<div class="topic-metadata">

**Author:** [@appana.3](https://pybamm.discourse.group/u/appana.3)\
**Replies:** 2\
**Last updated:** [12 February 2025 05:50 UTC](https://pybamm.discourse.group/t/questions-about-simulation-step/146 "2025-02-12T05:50:31Z")

</div>

Hi, I want to run a custom current profile (let’s say \[0, 0.5, 0.45, 0.47\]) using sim.step instead of sim.solve. How do I do that? Here’s a MWE of what I’m trying to achieve. # Using sim.solve() import pybamm import n…

---

## [Domain-sepcific electrolyte parameters](https://pybamm.discourse.group/t/domain-sepcific-electrolyte-parameters/167)

<div class="topic-metadata">

**Author:** [@fmaletic](https://pybamm.discourse.group/u/fmaletic)\
**Replies:** 0\
**Last updated:** [10 February 2025 16:29 UTC](https://pybamm.discourse.group/t/domain-sepcific-electrolyte-parameters/167 "2025-02-10T16:29:06Z")

</div>

Hi Everyone! I’d like to have separate electrolyte parameters – mostly diffusivity and conductivity – for each electrode. Is there an easy way to achieve that?

---

## [Summary variables calculation](https://pybamm.discourse.group/t/summary-variables-calculation/164)

<div class="topic-metadata">

**Author:** [@algo-eng](https://pybamm.discourse.group/u/algo-eng)\
**Replies:** 0\
**Last updated:** [10 February 2025 09:22 UTC](https://pybamm.discourse.group/t/summary-variables-calculation/164 "2025-02-10T09:22:48Z")

</div>

How summary variables are calculated if there are multiple steps in a single cycle

---

## [Current dependent particle radius](https://pybamm.discourse.group/t/current-dependent-particle-radius/62)

<div class="topic-metadata">

**Author:** [@algo-eng](https://pybamm.discourse.group/u/algo-eng)\
**Replies:** 2\
**Last updated:** [9 February 2025 16:50 UTC](https://pybamm.discourse.group/t/current-dependent-particle-radius/62 "2025-02-09T16:50:40Z")

</div>

Is there any example python function for current dependent particle radius? What will be the input to the function?

---

## [Is the project pybamm-param still active?](https://pybamm.discourse.group/t/is-the-project-pybamm-param-still-active/144)

<div class="topic-metadata">

**Author:** [@Cade](https://pybamm.discourse.group/u/Cade)\
**Replies:** 2\
**Last updated:** [7 February 2025 21:24 UTC](https://pybamm.discourse.group/t/is-the-project-pybamm-param-still-active/144 "2025-02-07T21:24:45Z")

</div>

Hello all, I have been experimenting with the pybamm-param package (GitHub - paramm-team/pybamm-param: Parameter optimisation for PyBaMM.) in hopes of fitting a parameter set to experimental data and am encountering iss…

---

## [Discussing/understanding the Marquis2019 SPMe Asymptotic Derivation](https://pybamm.discourse.group/t/discussing-understanding-the-marquis2019-spme-asymptotic-derivation/88)

<div class="topic-metadata">

**Author:** [@amundmr](https://pybamm.discourse.group/u/amundmr)\
**Replies:** 1\
**Last updated:** [7 February 2025 15:48 UTC](https://pybamm.discourse.group/t/discussing-understanding-the-marquis2019-spme-asymptotic-derivation/88 "2025-02-07T15:48:20Z")

</div>

Hi all! Hope you had a great vacation. I hope I am not off-topic by asking math & model derivation questions here, but I am trying to get to the crux of Marquis et al 2019’s paper which derives the SPMe model that is us…

---

## [Need help with experiment and drive cycles](https://pybamm.discourse.group/t/need-help-with-experiment-and-drive-cycles/80)

<div class="topic-metadata">

**Author:** [@A-bnk](https://pybamm.discourse.group/u/A-bnk)\
**Replies:** 1\
**Last updated:** [7 February 2025 14:58 UTC](https://pybamm.discourse.group/t/need-help-with-experiment-and-drive-cycles/80 "2025-02-07T14:58:30Z")

</div>

Hello guys, I am currently trying to create a simple example to use the US06 drive cycle. The problem is that my experiment just won’t finish completely because of an infeasibility warning. I hope someone can help me he…

---

## [What is meaning of electrode density parameter](https://pybamm.discourse.group/t/what-is-meaning-of-electrode-density-parameter/61)

<div class="topic-metadata">

**Author:** [@algo-eng](https://pybamm.discourse.group/u/algo-eng)\
**Replies:** 1\
**Last updated:** [7 February 2025 14:43 UTC](https://pybamm.discourse.group/t/what-is-meaning-of-electrode-density-parameter/61 "2025-02-07T14:43:16Z")

</div>

What is the correct way: Total electrode material (active material+conductive+binder) divided by electrode volume ??? Just active material density??

---

## [Clarification on Reproducing Composite Battery Degradation Model in PyBaMM (Bonkile et al. work)](https://pybamm.discourse.group/t/clarification-on-reproducing-composite-battery-degradation-model-in-pybamm-bonkile-et-al-work/150)

<div class="topic-metadata">

**Author:** [@DineshAdepu](https://pybamm.discourse.group/u/DineshAdepu)\
**Replies:** 0\
**Last updated:** [6 February 2025 10:18 UTC](https://pybamm.discourse.group/t/clarification-on-reproducing-composite-battery-degradation-model-in-pybamm-bonkile-et-al-work/150 "2025-02-06T10:18:29Z")

</div>

Dear all, I am attempting to reproduce the composite battery degradation model presented in Bonkile et al. \[1\]. The paper states that the modeling work has been integrated into the main PyBaMM repository. However, whil…

---

## [Getting cycle number from summary variables](https://pybamm.discourse.group/t/getting-cycle-number-from-summary-variables/108)

<div class="topic-metadata">

**Author:** [@Guri](https://pybamm.discourse.group/u/Guri)\
**Replies:** 1\
**Last updated:** [1 February 2025 23:11 UTC](https://pybamm.discourse.group/t/getting-cycle-number-from-summary-variables/108 "2025-02-01T23:11:22Z")

</div>

Hi, Before I was doing sim = pybamm.Simulation(spm, experiment=experiment, parameter\_values=parameter\_values) Solve the model sol = sim.solve() Extract cycle number and discharge capacity cycle\_number = sol.summary\_v…

---

## [Positive electrode porosity](https://pybamm.discourse.group/t/positive-electrode-porosity/136)

<div class="topic-metadata">

**Author:** [@algo-eng](https://pybamm.discourse.group/u/algo-eng)\
**Replies:** 0\
**Last updated:** [31 January 2025 07:48 UTC](https://pybamm.discourse.group/t/positive-electrode-porosity/136 "2025-01-31T07:48:10Z")

</div>

Selected SEI solvent diffusion limited, film resistance, porosity change true For LFP cell After first cycle it is showing positive electrode porosity 1 Why it is?

---

## [How can I use PyBaMM to solve a Poisson equation specifying both boundary conditions as Neumann conditions?](https://pybamm.discourse.group/t/how-can-i-use-pybamm-to-solve-a-poisson-equation-specifying-both-boundary-conditions-as-neumann-conditions/129)

<div class="topic-metadata">

**Author:** [@lorenzo\_coltu](https://pybamm.discourse.group/u/lorenzo_coltu)\
**Replies:** 0\
**Last updated:** [29 January 2025 11:19 UTC](https://pybamm.discourse.group/t/how-can-i-use-pybamm-to-solve-a-poisson-equation-specifying-both-boundary-conditions-as-neumann-conditions/129 "2025-01-29T11:19:54Z")

</div>

Hy everyone. I’m developing a transient 1D model for the membrane of a vanadium redox flow battery. The membrane is treated as a single spatial domain that is discretised according to the finite volume method: # Spatia…

---

## [Amplitude of the Voltage output after cycles is decreased even without aging?](https://pybamm.discourse.group/t/amplitude-of-the-voltage-output-after-cycles-is-decreased-even-without-aging/127)

<div class="topic-metadata">

**Author:** [@Notslytherin1](https://pybamm.discourse.group/u/Notslytherin1)\
**Replies:** 1\
**Last updated:** [28 January 2025 16:16 UTC](https://pybamm.discourse.group/t/amplitude-of-the-voltage-output-after-cycles-is-decreased-even-without-aging/127 "2025-01-28T16:16:39Z")

</div>

Dear PyBaMM community, I’m trying to apply a current profile on my model, after scaling up the widht to match the actual capacity of the cell. Then i noticed that the voltage output of the model is deviated after cycles…

---

## [Using the Idaklu Solver causing a memory leak](https://pybamm.discourse.group/t/using-the-idaklu-solver-causing-a-memory-leak/117)

<div class="topic-metadata">

**Author:** [@Nicholas\_Budenberg](https://pybamm.discourse.group/u/Nicholas_Budenberg)\
**Replies:** 8\
**Last updated:** [28 January 2025 11:30 UTC](https://pybamm.discourse.group/t/using-the-idaklu-solver-causing-a-memory-leak/117 "2025-01-28T11:30:54Z")

</div>

I am running the following code in order to see how the degradation of the cell is effected by different drive cycles. My drive cycle has spiky currents and I have found that using the Casadi Solver fails unless I use a …

---

## [Problems with the gradient operator](https://pybamm.discourse.group/t/problems-with-the-gradient-operator/115)

<div class="topic-metadata">

**Author:** [@isaac\_basil](https://pybamm.discourse.group/u/isaac_basil)\
**Replies:** 2\
**Last updated:** [28 January 2025 08:19 UTC](https://pybamm.discourse.group/t/problems-with-the-gradient-operator/115 "2025-01-28T08:19:35Z")

</div>

Hi, I am trying to build a custom model with a bit of an unusual form, but I don’t see why it shouldn’t be solvable. However, I am having some problem with the grad operator, and getting an “off by one” shape error, whic…

---

## [Controlling the current of a cell - Extracting model dynamics (for example DAE) directly from the CasADi-solver](https://pybamm.discourse.group/t/controlling-the-current-of-a-cell-extracting-model-dynamics-for-example-dae-directly-from-the-casadi-solver/123)

<div class="topic-metadata">

**Author:** [@Cherif](https://pybamm.discourse.group/u/Cherif)\
**Replies:** 0\
**Last updated:** [27 January 2025 08:25 UTC](https://pybamm.discourse.group/t/controlling-the-current-of-a-cell-extracting-model-dynamics-for-example-dae-directly-from-the-casadi-solver/123 "2025-01-27T08:25:04Z")

</div>

I am trying to control the current of a cell for a fast charging situation, while avoiding the plating (anode potential at the surface of the separator needs to be greater than 0V). In order to apply this in a control, I…

---

## [Cycle Ageing with PyBaMM EIS](https://pybamm.discourse.group/t/cycle-ageing-with-pybamm-eis/111)

<div class="topic-metadata">

**Author:** [@AkilaJ](https://pybamm.discourse.group/u/AkilaJ)\
**Replies:** 1\
**Last updated:** [26 January 2025 21:37 UTC](https://pybamm.discourse.group/t/cycle-ageing-with-pybamm-eis/111 "2025-01-26T21:37:23Z")

</div>

Hello Everyone, I am trying to observe the EIS variation of degradation coupled DFN or SPMe model with PyBaMM-EIS. However I have the following issues, If someone can guide me on this it is highly appreciated. Thank y…

---

## [Discrepancy in Degradation Calculations When Using Experiment Blocks](https://pybamm.discourse.group/t/discrepancy-in-degradation-calculations-when-using-experiment-blocks/110)

<div class="topic-metadata">

**Author:** [@fiju1012](https://pybamm.discourse.group/u/fiju1012)\
**Replies:** 0\
**Last updated:** [21 January 2025 13:29 UTC](https://pybamm.discourse.group/t/discrepancy-in-degradation-calculations-when-using-experiment-blocks/110 "2025-01-21T13:29:27Z")

</div>

Hello everyone, I have encountered an issue with simulating degradation mechanisms in PyBaMM when splitting a long experiment into multiple blocks. Here are the details: I have real-world power data over a month, provi…

---

## [How to use parameter function instead of parameter values?](https://pybamm.discourse.group/t/how-to-use-parameter-function-instead-of-parameter-values/106)

<div class="topic-metadata">

**Author:** [@gulzar223](https://pybamm.discourse.group/u/gulzar223)\
**Replies:** 1\
**Last updated:** [20 January 2025 12:11 UTC](https://pybamm.discourse.group/t/how-to-use-parameter-function-instead-of-parameter-values/106 "2025-01-20T12:11:29Z")

</div>

Hi everyone, I’m working on a project using PyBaMM, and trying to update parameter values by uploading a custom parameter function. However, I’m unsure about the correct way to do this. Could someone guide me on how to…

[Previous page](https://pybamm.discourse.group/c/pybamm-qa/6.md?page=1)

[Next page](https://pybamm.discourse.group/c/pybamm-qa/6.md?page=3)
