Codes developed for my Master thesis at UFSC to solve the formation problem