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

Update BaseModel.simulate() for IDAKLU output_variables #160

Closed
BradyPlanden opened this issue Dec 21, 2023 · 0 comments · Fixed by #450
Closed

Update BaseModel.simulate() for IDAKLU output_variables #160

BradyPlanden opened this issue Dec 21, 2023 · 0 comments · Fixed by #450
Assignees
Labels
blocked This issue or pull request is blocked enhancement New feature or request

Comments

@BradyPlanden
Copy link
Member

Feature description

Starting with PyBaMM v23.5 it is possible to pass predefined output variables to the IDAKLU solver. This feature eliminates the need to access the pybamm.solution class, as the solver returns the requested output variables directly. For PyBOP this would be the cost.signal object.

This should reduce computation time and memory requirements as we avoid the pybamm.solution class altogether.

Motivation

Reduce inference/optimisation time, simplify the codebase.

Possible implementation

Example taken from tests for the output_variable solver functionality:

Solve for a subset of variables and compare results

    output_variables = [
        "Voltage [V]",
        "Time [min]",
        "x [m]",
        "Negative particle flux [mol.m-2.s-1]",
        "Throughput capacity [A.h]",  # ExplicitTimeIntegral
    ]

    solver = pybamm.IDAKLUSolver(
        atol=1e-8, rtol=1e-8,
        options=options,
        output_variables=output_variables,
    )

    sol = solver.solve(
        model,
        t_eval,
        inputs=input_parameters,
        calculate_sensitivities=True,
    )

Additional context

No response

@BradyPlanden BradyPlanden added the enhancement New feature or request label Dec 21, 2023
@BradyPlanden BradyPlanden self-assigned this Jan 25, 2024
@BradyPlanden BradyPlanden linked a pull request Jan 26, 2024 that will close this issue
3 tasks
@BradyPlanden BradyPlanden added the blocked This issue or pull request is blocked label May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked This issue or pull request is blocked enhancement New feature or request
Projects
Status: Done
1 participant