The rest of the script is used to output the results to 2D Grace files for visualisation (the grace.view user function calls will launch Grace with the created files), and the output of the values into plain text files.