paramm-team / pybamm-param

Parameter optimisation for PyBaMM.
BSD 3-Clause "New" or "Revised" License
37 stars 8 forks source link

Use sensitivities #15

Open brosaplanella opened 2 years ago

brosaplanella commented 2 years ago

Use sensitivities to calculate the Jacobian of the cost function in order to speed up the fitting. See this notebook for an example.

PipGrylls commented 10 months ago

In the notebook this is passed as a parameter to a pybamm solver:

`solver = pybamm.CasadiSolver(mode="safe", atol=1e-6, rtol=1e-3)

solution = solver.solve( model, t_eval, inputs={"Current function [A]": 0.15652}, calculate_sensitivities=True )`

Can you identify where a similar action is taken in our cost funtions and/or example scripts/notebooks?

brosaplanella commented 10 months ago

This would require the cost functions returning the Jacobian (which would depend on the sensitivity of the forward model), and feed that to the optimiser (e.g. jac argument in SciPy minimize).