wheelsmanx

SolarEngery Source.cpp

Jun 1st, 2017
134
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.60 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <vector>
  4.  
  5.  
  6. using namespace std;
  7.  
  8. class solarPanel {
  9. public:
  10. //https://www.amazon.com/WindyNation-Solar-Panel-Battery-Charging/dp/B00FE45FD4/ref=sr_1_1?ie=UTF8&qid=1496373790&sr=8-1-spons&keywords=Solar+Panel&psc=1
  11. double costPerPanel = 111.99; // 111.99$
  12. double outputOfEnergy = 100; // 100w
  13. double widthOfSolarPanel = 26.4; // inches
  14. double heightOfSolarPanel = 40; //inches
  15. double AreaOfSolarPanel;
  16. };
  17.  
  18. class solarField {
  19. public:
  20. double squareMile;
  21. double solarCountPerCapita;
  22. double size; //acers
  23. double cost; // in dollars
  24. vector <solarPanel> numberOfPanels;
  25. double feetOfWire;
  26. double numberOfSolarPanelRegulators; // one for ever 3.61 of them
  27. //100w at 12v= 100/12 = 8.3 repeating and they are rated for only 30 amps - so 30/8.3 = 3.61 panels per regulator
  28. };
  29.  
  30. class unitedStates {
  31. public:
  32. float budget;
  33. float costForPanels;
  34. float costOfEnergyNow;
  35. float numberOfPanelsForCountry;
  36. float numberOfPeople = 321400000; // 321.4million
  37. //https://www.google.com/#q=number+of+people+in+the+us+
  38. double energyDemand = 12988.26; // measure in kwh per capita
  39. //https://www.google.com/#q=united+states+of+america+electricity+consumption+per+capita&stick=H4sIAAAAAAAAAOPgUeLUz9U3sEw2LzfQcspOttLPyU9OLMnMz9MvLgHSxSWZyYk58UWp6UAhq9Sc1OSSoszkzJLK-OT8vOLS3AKQ0viC1KL45MSCzJJEAIAa6C1RAAAA
  40. };
  41.  
  42. void main() {
  43.  
  44. solarPanel SP_A;
  45. solarField SF_A;
  46. //Calculate the area of land each one will take up https://www.google.com/#q=how+to+get+square+inches
  47. SP_A.AreaOfSolarPanel = SP_A.widthOfSolarPanel * SP_A.heightOfSolarPanel;
  48. // a Panel on average in the US delivers 30kwh https://www.google.com/#q=determine+kwh+output+of+solar+panel
  49. unitedStates USA;
  50. SF_A.solarCountPerCapita = USA.energyDemand / 30;
  51. cout << SF_A.solarCountPerCapita << " Solar Panels Per Capita for the year" << endl;
  52. //convert inches to feet in solar size
  53. SP_A.AreaOfSolarPanel = SP_A.AreaOfSolarPanel / 144;
  54. cout << SP_A.AreaOfSolarPanel << " Area of Solar Panel in square feet" << endl;
  55. // turn inches to feet : number of square inches in a foot is 144
  56. SP_A.AreaOfSolarPanel = SP_A.AreaOfSolarPanel / 43560;
  57. cout << SP_A.AreaOfSolarPanel << " Area of solar panel in acers" << endl;
  58. // turn number of feet into acers - number of sq feet in an acer is 43560
  59. SF_A.size = SF_A.solarCountPerCapita * SP_A.AreaOfSolarPanel;
  60. cout << SF_A.size << " size of solar field in acers per capita" << endl;
  61. // multiplied the area of a solar field in acers by the number of solar panels needed per capita
  62. SF_A.size = SF_A.size * USA.numberOfPeople;
  63. cout << SF_A.size << " of ACERS OF SOLAR FIELD IN US FOR YEAR" << endl;
  64. SF_A.size = SF_A.size / 640; // 640 is the number of acers in a square mile
  65. cout << SF_A.size << " square miles" << endl; // the number of square miles of solar panels it would take to power everyone in the USA
  66. SF_A.cost = SF_A.solarCountPerCapita * SP_A.costPerPanel;
  67. cout << SF_A.cost << " solar cost per capita" << endl;
  68. //need to conver it to thousands
  69. SF_A.cost = SF_A.cost / 1000;
  70. cout << SF_A.cost << " in thousands" << endl;
  71. SF_A.cost = SF_A.cost * USA.numberOfPeople;
  72. cout << SF_A.cost << " cost of all panels" << endl;
  73. SF_A.cost = (SF_A.cost * 1000) / 1000000000000; // convert in thousands to in trillions
  74. cout << SF_A.cost << " cost of all panels in trillions" << endl;
  75. // need to add wiring cost and cost of regulators
  76. SF_A.feetOfWire = SF_A.solarCountPerCapita * USA.numberOfPeople;
  77. SF_A.feetOfWire = SF_A.feetOfWire * 2 * 2; // 2 peices of wire per solar panel - the width 26.4 ( i gave them 24 inch) of the solar panel seemed like a good length
  78. cout << SF_A.feetOfWire << endl;
  79. SF_A.feetOfWire = SF_A.feetOfWire / 5280;
  80. cout << SF_A.feetOfWire << " miles" << endl;
  81. SF_A.feetOfWire = (SF_A.feetOfWire / 24) * 27.00;
  82. cout << SF_A.feetOfWire << " feet of wire in dollars" << endl;
  83. SF_A.cost = SF_A.cost + (SF_A.feetOfWire / 1000000000000);
  84. cout << SF_A.cost << " solar cost with wire and panels" << endl;
  85. // now we need to add in regulators
  86. SF_A.numberOfSolarPanelRegulators = (SF_A.solarCountPerCapita * USA.numberOfPeople) / 3.61;
  87. cout << SF_A.numberOfSolarPanelRegulators << "number of solar panel regulators" << endl;
  88. SF_A.cost = SF_A.cost + ((SF_A.numberOfSolarPanelRegulators * 51.99) / 1000000000000);
  89. cout << SF_A.cost << " total cost of wire, solar panel, solar Regulator in trillions" << endl;
  90. // lets spread that cost over lets say 30 years? the average mortgage on a house for most Americans
  91. SF_A.cost = (SF_A.cost * 1000000000000) / 30;
  92. SF_A.cost = (SF_A.cost / 1000000000);
  93. cout << SF_A.cost << " per year for 30 years by the brillions" << endl;
  94. // the average cost of a kwh of energy in the us is .12
  95. USA.costOfEnergyNow = ((0.12 * USA.energyDemand) * USA.numberOfPeople);
  96. cout << USA.costOfEnergyNow << " Cost of energy in dollars for 1 year" << endl;
  97. USA.costOfEnergyNow = USA.costOfEnergyNow / 1000000000;
  98. cout << USA.costOfEnergyNow << " Cost of energy now in billions of dollars for 1 year" << endl;
  99. cout << SF_A.cost - USA.costOfEnergyNow << " This amount per year for 30 years" << endl;
  100. USA.costForPanels = SF_A.cost - USA.costOfEnergyNow;
  101. cout << "the use has 3.21 Trillion dollars per year OR " << (3.21 * 1000000000000) / 1000000000 << " Billion dollars a year" << endl;
  102. USA.budget = (3.21 * 1000000000000) / 1000000000;
  103. cout << endl << endl << endl << "THE IMPORTANT STUFF" << endl;
  104. cout << "Cost to put the entire country on solar would be just " << USA.costForPanels / USA.budget << "% of the national budget" << endl;
  105. cout << "and the number of space it would require is just " << SF_A.size << " Square Miles." << endl;
  106. cout << "Which sounds like a lot but the Mojave Desert is 47,877 square miles... mostly unusable land" << endl;
  107. cout << "Note: this is all speculation and all prices are consumer prices with out negotiation" << endl;
  108. cout << "this is if you were to lay the panels flat - directly facing up - and if you were to place them in a " << endl;
  109. cout << "\/\/\/\/ pattern you can save space and increase effciency." << endl;
  110. cout << "This also assumes that we are not getting our energy from anywhere else" << endl;
  111. cout << "Cost to the average american - with out adding in other taxes ( if we split the cost per person not per entity)" << endl;
  112. cout << (SF_A.cost * 1000000000) / USA.numberOfPeople << "Per Person " << endl;
  113.  
  114.  
  115. cout << "if you want to understand this amature model more feel free to get the source code at : " << endl;
  116. cout << "https://pastebin.com/7zmUvdMv" << endl;
  117. cout << "-Justin Hagerty" << endl;
  118.  
  119.  
  120.  
  121.  
  122.  
  123. system("pause");
  124. }
Advertisement
Add Comment
Please, Sign In to add comment