I am trying to write a loop that can take all the different combinations of ON_PEAK, MID_PEAK and OFF_PEAK consumption combinations, which will result in the sum of 114.12 of the below-mentioned equation.
I also want those combinations to be appended to a dictionary.
In the dictionary, the key = (SUM of ON_PEAK, MID_PEAK, OFF_PEAK) and the values to be the list of combinations of On_Peak, MID_PEAK and OFF_PEAK combinations. I am new to python and struggle with loops. I appreciate whoever can provide help.
Please see the example below:
d = {}
on_kwh = range(1, 5001, 1)
mid_kwh = range(1, 5001, 1)
off_kwh = range(1, 5001, 1)
if 0.101*(on_kwh) + 0.065(off_kwh) + 0.14(mid_kwh) = 114.12:
d[on_kwh+mid_kwh+off_kwh].append[on_kwh,off_kwh,mid_kwh]
print(d)
output (Example:1 Combination)
{1000,[150,150,700]}
*Output is based on this logic:
0.101(150) + 0.0065(150) + 0.14(700) = 114.12
0.101 * (150) + 0.0065 * (150) + 0.14 * (700) = 122.9?