simulate function

Simulate stock-and-flow model