Parameters that don't affect the geometric structure of the model should be passed as inputs to the pybamm.solver class to improve performance. This will allow the built model to be updated with the appropriate parameters at each iteration without reforming the model, discretisation and solver.
If the parameters of interest have an influence on the geometric structure of the model (electrode thickness, number of particles, etc.), the above workflow must be rebuilt on each iteration. This slows down the iterations/sec of parameterisation/optimisation, but without pre-composing the design space (there is a side discussion to be had here) we need to do this to enable robust results.
Open thoughts:
- For the structural parameter set, obtaining the gradient of the result will not be easy, and if needed will require more computationally complex methods, as the model structure changes with each iteration.
- There is a further discussion here about the fidelity of varying the model structure during either parameterisation or optimisation. There may be side effects that need to be captured in the model construction (for multi-particle models, the discretisation distribution could be held constant between structural changes).
To do:
Parameters that don't affect the geometric structure of the model should be passed as inputs to the pybamm.solver class to improve performance. This will allow the built model to be updated with the appropriate parameters at each iteration without reforming the model, discretisation and solver.
If the parameters of interest have an influence on the geometric structure of the model (electrode thickness, number of particles, etc.), the above workflow must be rebuilt on each iteration. This slows down the iterations/sec of parameterisation/optimisation, but without pre-composing the design space (there is a side discussion to be had here) we need to do this to enable robust results.
Open thoughts:
To do: