Calculate reverse percentage amount
I apologize for this school-book question but I've been working on this SQL query the whole day and I'm on the last leg of this project but it's late and my head just refuses to work :) I'd app开发者_开发技巧reciate if someone could check the math for me:
I have a device that can be in 3 power states & run at full power. Each state has its own power consumption. I get how long each power state was on during the day (from my SQL queries). What I need is to calculate savings in percent for each device.
So here you go, let's assume:
Power State1:
Power Consumption = P1
Time On = T1
Power State2:
Power Consumption = P2
Time On = T2
Power State3:
Power Consumption = P3
Time On = T3
When not in any power state (Full Power):
Power Consumption = PFull
Time On = TFull
So to calculate energy used if running at full power I do: (i.e. all calculations are done in reference to a single day)
E(Full_Power_24hr) = PFull * 24hrs;
And to get the energy actually used:
E(used) = PFull * TFull + P1 * T1 + P2 * T2 + P3 * T3;
And lastly, energy saved (per 24-hr period):
E(saved) = E(Full_Power_24hr) - E(used);
What I need to do now, is to calculate percentage-wise what is the savings per each power state?
So is it:
Share_S1 = 1 / (P1 * T1 / E(Full_Power_24hr));
Share_S2 = 1 / (P2 * T2 / E(Full_Power_24hr));
Share_S3 = 1 / (P3 * T3 / E(Full_Power_24hr));
Percent_Share_S1 = 100 * Share_S1;
Percent_Share_S2 = 100 * Share_S2;
Percent_Share_S3 = 100 * Share_S3;
I think, you would first need to calculate the percentage saved over all states. And then divide that up between the saving states according to the time spent in each state.
精彩评论