Modelling Flexible resources in the distribution grid