Repository navigation
Issue with pybamm.DefiniteIntegralVector causing ShapeError #5233
Replies: 1 comment
|
There are two separate problems here. The shape error comes from 1. Where (19,1) vs (21,1) comes from
2. Its docstring (
Fix: do not take You integrate xi = pybamm.standard_spatial_vars.x_n if self.domain == "negative" else pybamm.standard_spatial_vars.x_p
pressure = (
stress_r_surf
- pybamm.boundary_value(stress_r_surf, "left")
+ pybamm.IndefiniteIntegral((2 / xi) * (stress_r_surf - stress_t_surf), xi)
)This builds and solves for me, and all values are finite. For p = 0 at the right-hand end instead, use Notes:
|
Uh oh!
There was an error while loading. Please reload this page.
Hello everyone,
I am working on building a submodel in PyBaMM. Everything in the submodel works as expected until I reach the following line:
pressure = pybamm.DefiniteIntegralVector(pressure_gradient)
This line causes the following error:
pybamm.expression_tree.exceptions.ShapeError: Cannot find shape
(original error: operands could not be broadcast together with shapes (19,1) (21,1))
I have double-checked, and all shapes and domains appear consistent.
Below is the relevant portion of the code for context:
Has anyone encountered a similar issue with DefiniteIntegralVector? Any suggestions on how to resolve this shape mismatch while keeping the calculation fully symbolic would be greatly appreciated.
Thank you in advance!
All reactions