Replies: 3 comments 1 reply
-
Maybe not from the PyBaMM side but from a more general viewpoint. The gradient calculates the derivative, so it calculates the changes between volume-elements. You can view it as the function being the values in the discretization elements, wherease the gradient calculates the weighted differences between the volume elements. The difference between the volume elements is naturally one dimension less than the actual values (example, three discretization elements where every elements has a temperature value, but there are only two values for the temperature difference/derivative/gradient namely the temperature difference between the first and the second, and the difference between the second and the third element). Discretization-wise you could say: the gradient evaluates on the internal edges and has therefore one value less than the actual function and since the laplacian is the second derivative it also may have a different dimension. So i would suggest that you're checking your differential equations first. There maybe a functionality in PyBaMM though that helps you dealing with this problem on the software side but i don't know. |
Beta Was this translation helpful? Give feedback.
-
Following on @dion-w's comment, note that your equation is not consistent as you are adding together BTW, I don't think it is related to your problem, but you are using a version of PyBaMM (0.2.3) which is almost two years old. I suggest updating it to a more recent version. In addition, note that from v21.9, Python 3.6 is not supported so you might need to update Python too. This issue is better suited as a discussion, so I am transferring it there. |
Beta Was this translation helpful? Give feedback.
-
Thank you both, |
Beta Was this translation helpful? Give feedback.
-
PyBaMM Version
0.2.3
Python Version
3.6
Describe the bug
Hi, community,
Would like to implement an equation as the simple snippet below, however ran into a dimension problem, saying the shape of rhs and ics are not matching. Is it an expected behavior? Or something I got wrong?
Can somebody kindly explain and provide a correct one? Thanks a lot.
Steps to Reproduce
Relevant log output
Beta Was this translation helpful? Give feedback.
All reactions