add_error function

Add an error term for simulation