A simulation tool for extended distribution grids with controlled distributed generation