add a write_state argument to the forward model to avoid disk writes when testing timings