-
-
Notifications
You must be signed in to change notification settings - Fork 559
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]: Geometry parameters must be Scalars after parameter processing #3649
Comments
Geometry parameters (particle radius and thicknesses) don't work with inputs at the moment unfortunately. This is a known issue but challenging to fix |
I am also facing the same bug, there is any other way to make these variables? |
As Valentin mentioned above, the geometric parameters require a rebuild of the model when changes are made. As a result, the gradient information is not available. As far as I know, this is the only way to change the geometric parameters: import pybamm
model = pybamm.lithium_ion.SPMe()
param = pybamm.ParameterValues('Prada2013')
param['Current function [A]'] = 1*param['Nominal cell capacity [A.h]']
param.update({'Positive particle radius [m]': 5e-8})
sim = pybamm.Simulation(model=model,parameter_values=param)
sol = sim.solve([0,3600]) In PyBOP we have a PR open to allow fitting of these parameters, which essentially rebuilds the required model objects at each iteration. You may be able to find some useful information related to this challenge on that branch. |
This way is great, which assign the parametervalue directly with avoiding "inputs". |
Reopening because we are fixing this now. |
PyBaMM Version
23.9
Python Version
3.9
Describe the bug
ValueError: Geometry parameters must be Scalars after parameter processing.
Steps to Reproduce
import pybamm
model = pybamm.lithium_ion.SPMe()
param = pybamm.ParameterValues('Prada2013')
param['Current function [A]'] = 1*param['Nominal cell capacity [A.h]']
param.update({'Positive particle radius [m]': "[input]"})
sim = pybamm.Simulation(model=model,parameter_values=param)
sol = sim.solve([0,3600],inputs={'Positive particle radius [m]':5e-08},calculate_sensitivities=True)
J = sol['Voltage [V]'].sensitivities['Positive particle radius [m]']
Relevant log output
No response
The text was updated successfully, but these errors were encountered: