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

Theoretical energy integral is very slow #3506

Closed
valentinsulzer opened this issue Nov 8, 2023 · 3 comments · Fixed by #3510
Closed

Theoretical energy integral is very slow #3506

valentinsulzer opened this issue Nov 8, 2023 · 3 comments · Fixed by #3510
Assignees
Labels
difficulty: easy A good issue for someone new. Can be done in a few hours priority: high To be resolved as soon as possible

Comments

@valentinsulzer
Copy link
Member

This for loop is killing us and should be vectorized:

for i in range(x_vals.size):
Vs[i] = (
parameter_values.evaluate(param.p.prim.U(y_vals[i], T)).item()
- parameter_values.evaluate(param.n.prim.U(x_vals[i], T)).item()
)

@valentinsulzer valentinsulzer added difficulty: easy A good issue for someone new. Can be done in a few hours priority: high To be resolved as soon as possible labels Nov 8, 2023
@valentinsulzer
Copy link
Member Author

Screenshot 2023-11-08 at 6 48 21 PM

@AbhishekChaudharii
Copy link
Contributor

I tried vectorizing it but it seems that performing binary operations between NumPy arrays and <class 'pybamm.parameters.parameter_values.ParameterValues'> might not be supported.

Error : NotImplementedError: BinaryOperator not implemented for symbols of type <class 'numpy.ndarray'> and <class 'pybamm.expression_tree.scalar.Scalar'>

@valentinsulzer
Copy link
Member Author

Ok I'll look into this

@valentinsulzer valentinsulzer self-assigned this Nov 9, 2023
valentinsulzer added a commit that referenced this issue Nov 13, 2023
valentinsulzer added a commit that referenced this issue Nov 13, 2023
js1tr3 pushed a commit to js1tr3/PyBaMM that referenced this issue Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
difficulty: easy A good issue for someone new. Can be done in a few hours priority: high To be resolved as soon as possible
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants