# Solvers

**URL:** https://pybamm.discourse.group/c/pybamm-qa/solvers/8.md

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

---

## [About the Solvers category](https://pybamm.discourse.group/t/about-the-solvers-category/15)

<div class="topic-metadata">

**Author:** [@pybamm](https://pybamm.discourse.group/u/pybamm)\
**Replies:** 0\
**Last updated:** [6 November 2024 14:10 UTC](https://pybamm.discourse.group/t/about-the-solvers-category/15 "2024-11-06T14:10:46Z")

</div>

Subcategory to ask questions about PyBaMM solvers.

---

## [What are the ways to reinitialize the model with the previous state?](https://pybamm.discourse.group/t/what-are-the-ways-to-reinitialize-the-model-with-the-previous-state/485)

<div class="topic-metadata">

**Author:** [@geri](https://pybamm.discourse.group/u/geri)\
**Replies:** 3\
**Last updated:** [6 October 2026 10:48 UTC](https://pybamm.discourse.group/t/what-are-the-ways-to-reinitialize-the-model-with-the-previous-state/485 "2026-10-06T10:48:57Z")

</div>

Hello everyone! I am trying to find a way to replicate the solution of the 2 cycles of one simulation by solving one cycle at a time and then reinitialize. The experiment consist of \[discharge, rest, charge, rest\] = Cyc…

---

## [How can I pause a PyBaMM experiment at fixed simulated-time intervals, update ECM parameters, and resume from the same point in the experiment?](https://pybamm.discourse.group/t/how-can-i-pause-a-pybamm-experiment-at-fixed-simulated-time-intervals-update-ecm-parameters-and-resume-from-the-same-point-in-the-experiment/482)

<div class="topic-metadata">

**Author:** [@Ivan](https://pybamm.discourse.group/u/Ivan)\
**Replies:** 1\
**Last updated:** [24 September 2026 11:59 UTC](https://pybamm.discourse.group/t/how-can-i-pause-a-pybamm-experiment-at-fixed-simulated-time-intervals-update-ecm-parameters-and-resume-from-the-same-point-in-the-experiment/482 "2026-09-24T11:59:54Z")

</div>

I am simulating a Thevenin equivalent circuit model using pybamm.Experiment. I want to update some model parameters periodically during the simulation—for example, every 100 simulated seconds. The intended workflow is: …

---

## [Possible Bug or just my usecase? Memory growth out of bounds](https://pybamm.discourse.group/t/possible-bug-or-just-my-usecase-memory-growth-out-of-bounds/473)

<div class="topic-metadata">

**Author:** [@Xamroh](https://pybamm.discourse.group/u/Xamroh)\
**Replies:** 0\
**Last updated:** [4 July 2026 13:33 UTC](https://pybamm.discourse.group/t/possible-bug-or-just-my-usecase-memory-growth-out-of-bounds/473 "2026-07-04T13:33:56Z")

</div>

Hello! I found this rapid memory growth in my simulation but i am not quite sure if its a bug of missing garbage collection or just my usecase that calculates unused results. Recreation and diagnostic in small a exampl…

---

## [IDAKlu KLU import Error, KLU not installed](https://pybamm.discourse.group/t/idaklu-klu-import-error-klu-not-installed/412)

<div class="topic-metadata">

**Author:** [@timo](https://pybamm.discourse.group/u/timo)\
**Replies:** 0\
**Last updated:** [11 November 2025 08:41 UTC](https://pybamm.discourse.group/t/idaklu-klu-import-error-klu-not-installed/412 "2025-11-11T08:41:41Z")

</div>

Hi there, I am relativly new to PyBamm. I run Pybamm in a Conda env on WSL. I tried using it with the IDAKLU Solver, but everytime there is an error from within the idaklu\_solver.py file, it tells me ImportError(“KLU is …

---

## [Passing initial soc and starting solution together](https://pybamm.discourse.group/t/passing-initial-soc-and-starting-solution-together/359)

<div class="topic-metadata">

**Author:** [@harisankarsuresh](https://pybamm.discourse.group/u/harisankarsuresh)\
**Replies:** 0\
**Last updated:** [30 June 2025 09:54 UTC](https://pybamm.discourse.group/t/passing-initial-soc-and-starting-solution-together/359 "2025-06-30T09:54:34Z")

</div>

If i pass initial\_soc and starting\_solution into of sim.solve which has been run using experiments, will the initial soc be overwritten from starting solution? sim.solve( solver=safe\_solver, …

---

## [Resolving Random Number Generation Conflict with CasADi's \_set\_random\_seed](https://pybamm.discourse.group/t/resolving-random-number-generation-conflict-with-casadis-set-random-seed/283)

<div class="topic-metadata">

**Author:** [@squirrel](https://pybamm.discourse.group/u/squirrel)\
**Replies:** 0\
**Last updated:** [29 March 2025 02:19 UTC](https://pybamm.discourse.group/t/resolving-random-number-generation-conflict-with-casadis-set-random-seed/283 "2025-03-29T02:19:28Z")

</div>

Hi, I encountered an issue when using the CasADi solver. While running the following code, I found that the random numbers were not being generated properly. I discovered that if the CasADi solver is used, the function \_…

---

## [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…

---

## [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…

---

## [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 …

---

## [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…

---

## [Error “The linesearch algorithm failed with too small a step.” in sensitivitiy analysis](https://pybamm.discourse.group/t/error-the-linesearch-algorithm-failed-with-too-small-a-step-in-sensitivitiy-analysis/70)

<div class="topic-metadata">

**Author:** [@Azure-Dreamer](https://pybamm.discourse.group/u/Azure-Dreamer)\
**Replies:** 3\
**Last updated:** [16 December 2024 23:34 UTC](https://pybamm.discourse.group/t/error-the-linesearch-algorithm-failed-with-too-small-a-step-in-sensitivitiy-analysis/70 "2024-12-16T23:34:29Z")

</div>

Thank you pybamm team for your great work, and I would be grateful if you can provide some help with the following problem. I tried to calculate the sensitivity applying the “explicit sensitivity calculation” function. …
