A behaviour model to simulate stomatal resistance