Added file writing for numerical approximation.