GSoC 2017 Report, Implementation of multiple types of coordinate systems for vectors

August 2017 · 3 minute read

This page summarizes the work which I’ve done this summer.

About me

My name is Szymon Mieszczak and I’m master student at Adam Mickiewicz University in Poznań, Poland.

The goals

The aim of my work was to introduce different kind of orthogonal curvilinear coordinate systems to vector package in SymPy. Previously coordinate system could be only rotated or/and translated with respect to other coordinate systems.

My work can be split into tasks. I shortly described everyone and made a lists with pull requests which are dealing with them.

Differential operators

The work here concerns two things. Firstly, we need to calculate correctly gradient, curl, and divergence in different types of orthogonal curvilinear coordinate systems. We used here Lame coefficients which are obtained from transformation equations. Secondly, we can deal here with complex expressions which depends on many coordinate system so product rules for differential operators needs to be considered. We also introduced unevaluated expression for vector products and differential operators because sometimes it’s not possible to determined exact value of expression.

Introduction of transformation equations

Several new methods were added to CoordSys3D which are calculating transformation equations from rotation matrix and location vector, but also calculate inverse transformation equations. There are also methods which store informations about curvilinear coordinate systems, so user can just type coordinate system which are interested in without knowledge about transformation equations.

When we connect more than two coordinate systems we need to also take care about composition of transformation equations.

CoordSys3D constructor were modified to keep information about transformation equations and Lame coefficients. New parameter were add, transformation, which allows us to set any supported transformation(rotation, translation, and new ones). This parameter is used in whole package insead of rotation_matrix and location. It makes the code much more consistent.

express is a method which recalculates expression from some coordinate system into other coordinate system. This function were modified to support new types of transformations.

Tests and documentations and others

I systematically updated documentation. I also add pretty and LaTeX printing for newly created objects, like unevaluated Curl, cross etc.

Further work

Not everywhere transformation is used instead of rotation_matrix but it’s rather small amount of work here. New functionalities should be also more intensively tested to find every possible problems. I think that bugs somewhere can still exist.