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

New solver mode: only including required variables (don't store entire y) #2796

Closed
martinjrobins opened this issue Mar 22, 2023 · 3 comments · Fixed by #3217
Closed

New solver mode: only including required variables (don't store entire y) #2796

martinjrobins opened this issue Mar 22, 2023 · 3 comments · Fixed by #3217
Assignees
Labels
difficulty: hard Will take several weeks feature priority: medium To be resolved if time allows solver

Comments

@martinjrobins
Copy link
Contributor

Description

Provide a mode for the solver so that only a user given list of variables are calculated and stored as part of the solution

Motivation

Remove the need to store the entire y solution and store only the variables given by the user

Possible Implementation

Interface might look like the following:

solver = pybamm.IDAKLUSolver()
sol = solver.solve(model, t_eval, solution_include=['Voltage [V]'])
print(sol['Voltage [V]'].entries)

sol['Negative particle surface concentration']  # gives an exception

Additional context

No response

@valentinsulzer
Copy link
Member

Sounds good, though I would prefer output_variables instead of solution_include to match the syntax of QuickPlot

@martinjrobins
Copy link
Contributor Author

martinjrobins commented Aug 23, 2023

Note that we probably need to do this for the JaxSolver as well, see pybop-team/PyBOP#25

@BradyPlanden

@BradyPlanden
Copy link
Member

Just to crosspost, I'll start working on the Jax implementation of this as discussed in the above PyBOP issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: hard Will take several weeks feature priority: medium To be resolved if time allows solver
Projects
Development

Successfully merging a pull request may close this issue.

5 participants