Calculating the Energy Produced by Solar Power
Photovoltaic (PV) systems are used to translate sunlight into energy, for residential and industrial use. Along with wind power and other sources, PV systems represent a renewable source of energy, though PV systems do require batteries to allow for a continuous supply of electricity.
One thing to consider with PV systems is just how much energy can be harnessed. We can use the following formula to estimate the average energy output (E) of a PV solar panel, measured under standard test conditions and expressed in kilowatt hours (kWh):
E = A × r × H × η
Where…
- A is the total solar panel area in m2.
- r is the solar panel yield, expressed as a percentage (%).
- H is the average annual available solar radiation, assuming a 90° tilt, in kWh ⁄ m2
- η is the efficiency of the solar installation, factoring in losses. The typical range of values are [0.75…0.85].
Before proceeding, check out the following brief video regarding solar energy use in California:
Calculating the Solar Radiation Available
Calculations of solar panel capability often assume a 90° angle between sunlight and the solar panel; in other words, maximum energy can be achieved when the solar panel and sunlight are perpendicular. However, in reality, corrections to the panel’s incline need to be made based on geographic position, season, and even the day of the year. How do we determine the amount of solar radiation available to the panel on a given day?
Observe the following diagram, which depicts the relationship between the amount of solar radiation measured on a horizontal surface (Sh), the amount of solar radiation measured perpendicular to the sun (Sp), and the amount of solar radiation incident on a titled panel (Si):
Adapted from http://www.pveducation.org/
We can calculate the amount of solar radiation using the following formula:
Where the elevation angle θ (in degrees) is calculated from:
and where d is the day of the year; for example, January 20 would be day 20, whereas February 4 would be day 35. The angle β is the angle at which the solar panel is tilted. The sine function (“sin”) is a trigonometric function based on the concept of a right triangle; it computes the quotient of (length of side opposite the angle / length of hypotenuse).
C++ Activity: Computing The Impact of Tilt
This project will provide you with an introduction to the fundamentals of conditional repetition in C++. The focus of this project is on how to solve problems using the C++ “while” or “for” statements. In this project, you will…
- Develop code to read data from the standard input and produce data to the standard output.
- Write code that conforms to a programming style specified by the instructor.
- Translate given mathematical expressions into equivalent syntactically correct programming statements.
- Select and implement the appropriate control structure(s) for this problem.
As always, be sure to properly document your code. Consult the C++ Coding Guidelines document for proper coding standards. Use good design principles and design the solution before attempting to write code.
Create a program called SolarPanelInclination.cpp.
This program will allow the user to enter two inputs, as follows:
- Sh , the amount of solar radiation measured horizontally, in kWh/m2
- β, the angle at which the solar panel is tilted, in degrees (range is [0-180])
You must validate the β input for the given range. Remember to include a descriptive error message, and follow the basic steps outlined in class.
Once the program has received the input, a table of solar radiation measured perpendicular to the solar panel (Sp) over a period of 31 days (days 150-180). You may assume that the latitude is 40.6306464, which is the latitude of Schuylkill Haven, PA. All values should be expressed with three digits of precision on the right of the decimal point. Note: The sin()
function in C++, found in the <cmath
> library, expects to be given an angle in radians, not degrees. The formula to convert an angle in degrees to an angle in radians is (angle in degrees) x (π/180). Use the value 3.14159265359 for π.
For example:
Please enter the amount of horizontal solar radiation (kWh/m^2): 30 You entered 30 kWh/m^2. Please enter the angle of tilt, in degrees: 45 You entered 45 degrees. DAY Sp === ======== 150 28.468 151 28.407 152 28.349 153 28.293 154 28.240 155 28.191 156 28.144 157 28.099 158 28.058 159 28.019 160 27.983 161 27.950 162 27.920 163 27.892 164 27.868 165 27.846 166 27.827 167 27.811 168 27.797 169 27.787 170 27.779 171 27.774 172 27.772 173 27.773 174 27.776 175 27.783 176 27.792 177 27.804 178 27.819 179 27.836 180 27.857 Press any key to continue . . . |
Another example:
Please enter the amount of horizontal solar radiation (kWh/m^2): 30 You entered 30 kWh/m^2. Please enter the angle of tilt, in degrees: 60 You entered 60 degrees. DAY Sp === ======== 150 23.885 151 23.810 152 23.739 153 23.671 154 23.607 155 23.546 156 23.488 157 23.434 158 23.383 159 23.336 160 23.292 161 23.251 162 23.214 163 23.180 164 23.150 165 23.123 166 23.100 167 23.080 168 23.064 169 23.051 170 23.042 171 23.035 172 23.033 173 23.034 174 23.038 175 23.046 176 23.057 177 23.072 178 23.090 179 23.111 180 23.136 Press any key to continue . . . |
Deliverables
See the instructor for submission instructions and due date(s).