You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the pybamm.ScipySolver aborts early on the experiment given below, whereas the casadi and idaklu solver solve it correctly
Steps to Reproduce
importpybammimportnumpyasnpimportmatplotlib.pyplotaspltexperiment_2step=pybamm.Experiment(
[
(
"Discharge at C/20 for 1 hour",
"Charge at 1 A until 4.1 V",
"Hold at 4.1 V until C/2",
"Discharge at 2 W for 30 min",
"Discharge at 2 W for 30 min", # repeat to cover this case (changes initialisation)
),
]
*2,
)
solutions= []
forsolverin [
pybamm.CasadiSolver(),
pybamm.IDAKLUSolver(),
pybamm.ScipySolver(),
]:
model=pybamm.lithium_ion.SPM()
param=model.default_parameter_valuesinput_param_name="Negative electrode active material volume fraction"input_param_value=param[input_param_name]
param.update({input_param_name: "[input]"})
sim=pybamm.Simulation(
model,
experiment=experiment_2step,
solver=solver,
parameter_values=param,
)
solution=sim.solve(
inputs={input_param_name: input_param_value},
)
solutions.append(solution)
fori, sinenumerate(solutions):
plt.plot(s.t, s["Voltage [V]"](s.t) +float(i), label=f"Solver {i}")
plt.savefig("test.png")
foriinrange(1, len(solutions)):
np.testing.assert_allclose(
solutions[0]["Voltage [V]"].data[:-1],
solutions[i]["Voltage [V]"](solutions[0].t[:-1]),
rtol=5e-2,
equal_nan=True,
)
Relevant log output
No response
The text was updated successfully, but these errors were encountered:
PyBaMM Version
develop
Python Version
3.10
Describe the bug
the
pybamm.ScipySolver
aborts early on the experiment given below, whereas the casadi and idaklu solver solve it correctlySteps to Reproduce
Relevant log output
No response
The text was updated successfully, but these errors were encountered: