Skip to content

[Bug]: SPMe surface form "false" and "algebraic" give different answers #4910

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
valentinsulzer opened this issue Mar 11, 2025 · 0 comments · May be fixed by #4986
Open

[Bug]: SPMe surface form "false" and "algebraic" give different answers #4910

valentinsulzer opened this issue Mar 11, 2025 · 0 comments · May be fixed by #4986
Labels
bug Something isn't working

Comments

@valentinsulzer
Copy link
Member

PyBaMM Version

25.1.1

Python Version

3.11

Describe the bug

The SPMe with surface form "false" and "algebraic" give different results. I don't remember if this is expected or not. This was found because setting "particle phases" to ("1", "1") sets surface form to "algebraic" (also a bug)

Steps to Reproduce

import pybamm
import matplotlib.pyplot as plt

options_list = [
    ("two-particle", { "particle phases": ("1", "1")}),
    ("algebraic", {"surface form": "algebraic"}),
    ("standard", {})
]

sims = []
for label, options in options_list:
    model = pybamm.lithium_ion.SPMe(options)
    sim = pybamm.Simulation(model)
    sim.solve([0, 3600])
    sims.append((label, sim))

fig, ax = plt.subplots(1, 1)
for label, sim in sims:
    ax.plot(
        sim.solution["Time [min]"].data,
        sim.solution["Battery voltage [V]"].data,
        marker= 'o' if label == 'algebraic' else 's' if label == 'two-particle' else '^',
        label=label
    )

ax.set_xlabel("Time [min]")
ax.set_ylabel("Voltage [V]")
ax.legend()
plt.show()

Algebraic and two-particle match, standard is slightly lower

Relevant log output

@valentinsulzer valentinsulzer added the bug Something isn't working label Mar 11, 2025
@vidipsingh vidipsingh linked a pull request Apr 19, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant