Text this: Dynamic active and reactive power compensation in distribution networks with batteries: A day-ahead economic dispatch approach