I'm looking for the math that a demand meter would use to calculate the power demand. Specifically the average demand over a 15 minute period (see NEC 220.87).