Update sim.py

missing arguments in f.write