Convert some codes of Mecanica software written in Matlab language to Python