Trial.simulation function

Trial simulation