Week 2

June 2017 ยท 1 minute read

My second week I spent on introducing Lame coefficients into CoordSysCartesian. Unfortunately, our work is restricted by SymPy structure so, we don’t have too much freedom in our implementation. Hopefully, with my mentor, Francesco, we found some solution how to achieve our goals without destroying vector module. This week shows that I have lack in my knowledge about object-oriented programming and SymPy.

Having access to Lame coefficient I was able to modified Del operator (in mathematics nabla operators) to handle spherical and cylindrical coordinate system. It was rather easy task. I had to only modified i.e. generalized gradient, dot, cross methods to any kind of orthogonal curvilinear system simply by multiplying by Lame factors. At that moment I stick only to this coordinate system. We can easily expand it to another in the future.

Below is example how we can calculate gradient, curl and divergence in spherical coordinate system:

A = CoordSysCartesian('A') A._set_lame_coefficient_mapping('spherical') gradient(3*A.x + 4*A.y) divergence(3*A.x*A.z*A.i + A.y*A.j + A.x*A.y*A.z*A.k) curl(A.x*A.i + A.y*A.j + A.z*A.k)

To sum up, This week I end up with two PR, which I think will be merged soon. We also started discussion about next step. I’d say that the hardest difficulties are now in front of us.