MEASUR-Tools-Suite v1.0.11
The MEASUR Tools Suite is a collection of industrial efficiency calculations written in C++ and with bindings for compilation to WebAssembly.
Loading...
Searching...
No Matches
OperatingCost.h
Go to the documentation of this file.
1#pragma once
2
12#include <cmath>
13#include <functional>
14#include <stdexcept>
15#include <vector>
16
18 public:
31 OperatingCost(double motorBhp, double bhpUnloaded, double annualOperatingHours, double runTimeLoaded,
32 double efficiencyLoaded, double efficiencyUnloaded, double costOfElectricity)
33 : motorBhp(motorBhp), bhpUnloaded(bhpUnloaded), annualOperatingHours(annualOperatingHours),
34 runTimeLoaded(runTimeLoaded), efficiencyLoaded(efficiencyLoaded), efficiencyUnloaded(efficiencyUnloaded),
35 costOfElectricity(costOfElectricity) {}
36
37 struct Output {
38 Output(const double runTimeUnloaded, const double costForLoaded, const double costForUnloaded,
39 const double totalAnnualCost)
40 : runTimeUnloaded(runTimeUnloaded), costForLoaded(costForLoaded), costForUnloaded(costForUnloaded),
41 totalAnnualCost(totalAnnualCost) {}
42
43 const double runTimeUnloaded, costForLoaded, costForUnloaded, totalAnnualCost;
44 };
45
46 Output calculate() {
47 auto const runTimeUnloaded = 100 - runTimeLoaded;
48 auto const costForLoaded =
49 (motorBhp * 0.746 * annualOperatingHours * costOfElectricity * (runTimeLoaded / 100)) /
50 (efficiencyLoaded / 100);
51 auto const costForUnloaded = (motorBhp * 0.746 * annualOperatingHours * costOfElectricity *
52 (bhpUnloaded / 100) * (runTimeUnloaded / 100)) /
53 (efficiencyUnloaded / 100);
54 return {runTimeUnloaded, costForLoaded, costForUnloaded, costForLoaded + costForUnloaded};
55 }
56
57 private:
58 double motorBhp, bhpUnloaded, annualOperatingHours, runTimeLoaded, efficiencyLoaded;
59 double efficiencyUnloaded, costOfElectricity;
60};
61
OperatingCost(double motorBhp, double bhpUnloaded, double annualOperatingHours, double runTimeLoaded, double efficiencyLoaded, double efficiencyUnloaded, double costOfElectricity)