Skip to content
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

[Bug]: Tutorial 8 - Solver options | Not showing what it intends to #4048

Closed
ottarg opened this issue Apr 27, 2024 · 2 comments
Closed

[Bug]: Tutorial 8 - Solver options | Not showing what it intends to #4048

ottarg opened this issue Apr 27, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@ottarg
Copy link

ottarg commented Apr 27, 2024

PyBaMM Version

24.1

Python Version

3.12.2

Describe the bug

When I run the tutorial 8 notebook, it runs one sim in CasADi safe mode, one in CasADi fast mode and then plots the two for comparison.

The text in the notebook indicates that the difference should be that the safe mode correctly stops at the given voltage cut-off and that fast mode continues until the end of the requested solution time. However, both simulations appear to stop at the cut-off voltage.
image

I get the same behavior both in the google colab notebook as I get locally:
link to google colab notebook

When I change the script such that the fast solver does not get an altered parameter for cut-off voltage, it does complete the full hour simulation -- so it appears that it is indeed respecting the stop condition (which is counter to the description of what this mode does)
# create simulations
safe_sim = pybamm.Simulation(model, parameter_values=param, solver=safe_solver)
fast_sim = pybamm.Simulation(model, solver=fast_solver)

image

Steps to Reproduce

Run the tutorial 8 notebook with no changes

Relevant log output

No response

@ottarg ottarg added the bug Something isn't working label Apr 27, 2024
@kratman
Copy link
Contributor

kratman commented May 3, 2024

Hi @ottarg, the notebook does not force a crash for the fast solver to make sure everything runs.

The description actually focuses on them giving the same exact result rather than showing that it stops at the cutoff:

We see that both solvers give the same solution and that the "fast" solver, as the name suggests,
runs faster. However, if the simulation time was longer the "fast" solver would not notice that the
battery is discharging beyond its cut-off voltage and the solver would crash.

I think that there could be another plot to show that the safe solver stops, but as it is setup now, it is not a bug

@kratman kratman self-assigned this May 3, 2024
@kratman
Copy link
Contributor

kratman commented May 3, 2024

I am going to close this for now since it is behaving as intended.

@kratman kratman closed this as completed May 3, 2024
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

No branches or pull requests

2 participants