import math


def get_normalized_meter_value(t):
    """
    Expects a value between 0 and 1 (0 -> 00:00:00 || 1 -> 24:00:00) and returns the normalized
    simulated household consumption at that time, according to this
    Graph: http://blog.abodit.com/images/uploads/2010/05/HomeEnergyConsumption.png

    The formula can be examinated on https://www.desmos.com/calculator
    The formula used is this one: 
    \frac{\left(\sin\left(x\right)\ +\ \frac{x}{2.5}\ \cdot\left(-e^{\frac{x}{12}}+2.85\right)+1\right)}{5}
    It tries to mimic the Graph as normalized values.
    
    f(0) = power consumption at 00:00:00
    f(PI*4) = power consumption at 24:00:00
    """
    x = t * math.pi * 4
    meter_value = math.sin(x) + (x/2.5) * (-math.pow(math.e, x / 12.0) + 2.85) + 1
    normalized_meter_value = meter_value / 5.0
    return normalized_meter_value