Cost-efficient smart metering, a dynamic model for optimization of costs and benefits of smart metering