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

Input parameters broken in v23.3 #2855

Closed
valentinsulzer opened this issue Apr 4, 2023 Discussed in #2852 · 0 comments · Fixed by #2856
Closed

Input parameters broken in v23.3 #2855

valentinsulzer opened this issue Apr 4, 2023 Discussed in #2852 · 0 comments · Fixed by #2856

Comments

@valentinsulzer
Copy link
Member

Discussed in #2852

Originally posted by agoshtasbi April 3, 2023
Hi folks,

It seems that the latest changes have caused some issues with specifying input parameters. The following code snippet (slightly modified from workshop notebooks) used to work in v23.2, but now produces the error below:

`
import pybamm
import numpy as np
model = pybamm.lithium_ion.DFN()
geometry = model.default_geometry
param = model.default_parameter_values

param.update({"Current function [A]": "[input]"})
param.update({"Negative electrode porosity": "[input]"})

param.process_geometry(geometry)
param.process_model(model)

var = pybamm.standard_spatial_vars
var_pts = {var.x_n: 30, var.x_s: 30, var.x_p: 30, var.r_n: 10, var.r_p: 10}
mesh = pybamm.Mesh(geometry, model.default_submesh_types, var_pts)

disc = pybamm.Discretisation(mesh, model.default_spatial_methods)
disc.process_model(model)

t_eval = np.linspace(0, 3600, 100)
solver = pybamm.CasadiSolver(mode="safe", atol=1e-6, rtol=1e-3)

solution = solver.solve(
model, t_eval,
inputs={"Current function [A]": 0.15652, "Negative electrode porosity": 0.3},
calculate_sensitivities=False
)`

pybamm.expression_tree.exceptions.DomainError: Cannot concatenate child 'Column vector of length 30 * Negative electrode porosity' with empty domain

I couldn't find any trace of this in the change log so I'm not sure if the code needs to be changed for v23.3. Any help would be much appreciated.

Thanks!

@valentinsulzer valentinsulzer changed the title Are input parameters broken in v23.3? Input parameters broken in v23.3 Apr 4, 2023
valentinsulzer added a commit that referenced this issue Apr 4, 2023
@valentinsulzer valentinsulzer mentioned this issue Apr 4, 2023
8 tasks
valentinsulzer added a commit that referenced this issue Apr 5, 2023
valentinsulzer added a commit that referenced this issue Apr 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant