writing m5p equations to function file