Abstract
In this paper, we present a mathematical algorithm for the optimal orientation of solar panels for multi-apartment buildings. Currently, photovoltaic power generation has increasingly become an effective method. It has the advantage of not causing environmental pollution; however, it has the disadvantage of relatively low power generation efficiency. To increase the power efficiency of the panel, one can consider a rotation. However, if there is a limitation to the rotation angle of the solar panel, especially in multi-apartment buildings, it is desirable to install the panel at the optimal angle under given constraints. Therefore, we present a simple and practical method to evaluate the optimal installation angle of the panel. Using the proposed method, it is easy to find an optimal installation angle to achieve the best power generation efficiency based on the latitude and azimuth angles. To demonstrate the effectiveness of the proposed algorithm, several numerical simulation results are provided.
Keywords:
solar energy; solar panel; optimal orientation; mathematical modeling; code implementations MSC:
49M25; 65K10; 65Z05
1. Introduction
Solar energy is one of the important energy sources, and many countries, therefore, have realized the important role of renewable energies due to the depletion of conventional energy sources [1,2]. In particular, interest in solar power generation is increasing due to the dangers of nuclear/thermal power generation that have recently occurred in several countries. The advantages of using solar power generation are as follows. First, because it uses solar energy, it does not require fuel costs and is a clean energy source that does not generate air pollution or waste. Second, because the power generation unit is composed of semiconductor devices, there is no vibration and noise, and automation is easy. Lastly, efficient power generation is possible because power can be maximized during the daytime and summer when the power load is high.
However, photovoltaic power generation has several problems. First, there is a time constraint on energy generation. This is a very important issue and inevitably causes the problem of maximum efficiency and storage capacity in a limited time. Second, the profitability is not good due to the high unit price for power generation. For example, it is about 4 to 5 times more expensive than nuclear power generation.
In everyday life, one can often see solar panels installed in multi-apartment buildings to generate solar energy, as shown in Figure 1. An installation angle of the solar panel is important to collect photons efficiently [3]. If the solar panels are installed in a parallel direction to the building, then the energy efficiency is usually not optimal at each location. Therefore, we propose a simple mathematical algorithm for setting the angle and direction of the solar panel that can produce the maximum solar energy efficiency at each location based on the latitude and azimuth angle under several constraints.
Figure 1.
(a) The actual solar panel installed in the apartment. (b) An enlarged view.
As there is a lot of interest in solar panels and photon collectors around the world, many researchers have investigated calculating their optimal tilt angles [4,5,6,7,8,9,10,11,12,13,14,15,16,17,18]. Not only the optimal angle calculation but also the research on factors that can affect the performance of solar panels such as wind speed [19], weather [20], latitude and longitude [21] are in progress. In South Africa, the authors in [5] calculated the annual solar insolation for all possible angles on fixed collectors using the data obtained from the nine measuring stations. Other studies proposed using incident beam radiation-based maximization approach [6], a latitude-based optimization approach in the Mediterranean region [7], and non-linear time-varying particle swarm optimization in Taiwan [8].
As most researchers have reported that the maximum power can be harvested when a solar panel is equipped with a sun-tracking system. Referred researches suggest that the different adjustment number of intervals from 4 to 12 to obtain maximum energy in each country: 8 times a year in Iraq [10], 12 times a year in Syria [11], and also 12 times a year but each month adjusting the tilt angle which can achieve 8% more surface radiation compared with yearly adjustment in Saudi Arabia [12]. Furthermore, the solar panel with a fixed tilt angle without representing the number of yearly adjustments got 10–25% higher irradiations with increasing latitude in USA [13], the variation of optimal tilt angle throughout a year is between and in Turkey [14].
In [16], the authors present several models to calculate the optimal slope of the solar panel accurately at any location in the world. Using the proposed models, the authors estimate the annual energy output along with the amount of irradiance stored per hour according to the slope of the solar panel. There is a study that calculates the optimal tilt angle of a solar panel using machine learning recently [17]. In this study, energy generation simulations of panels are performed to calculate monthly and yearly panel angles, and economic cost effects are also evaluated in real-world environments. In [18], the optimal solar panel angle is calculated for the maximum energy yield. Calculating the cosine effect of the angle of the sun and the angle of the panel, the authors present a permanent fixed optimal angle but also a four-season or monthly adjustment to improve the total annual solar energy yield. In [22], the authors investigate the arrangement of solar panels for various spaces. Solar panels can be arranged to maximize energy production in limited spaces such as rooftops of buildings. The results suggest that the suitable deployment of solar panels could increase energy production by up to 6%. In [23], the authors introduce a new term, the tolerance angle. The tolerance angles refer to the angular range of optimal solar panels that minimize economic losses. It can be useful during actually installing solar panels.
The main purpose of this paper is to present a mathematical algorithm for the optimal orientation of solar panels for multi-apartment buildings under several constraints. Let and be the representative of the solar beam and normal vector of the panel, respectively. Then, we consider the following optimizing problem
when the solar vector and certain constraint for is given.
The outline of this paper is as follows. A mathematical model for finding the optimal position of a solar panel for buildings is described in Section 2. Numerical results are listed in Section 3. We finalize the paper with the conclusion in Section 4. A code implementation is included in Appendix A for users who may not be familiar with the content.
2. Mathematical Modeling
In this section, we propose our mathematical modeling to derive the optimal orientation of solar panels under several constraints. First, we consider a rectangular panel (represented dark gray) whose horizontal and vertical lengths are and , respectively, as shown in Figure 2.
Figure 2.
Schematic illustrations of our mathematical modeling to the rotated panel, (a) fixing A and (b) fixing B.
As shown in Figure 2a, we suppose that the panel is on -plane and the coordinates of , and C are determined automatically. Then, we move the solar panel while keeping the coordinate of fixed. Moreover, we fix the height of panel . We then obtain a moved solar panel , which is represented by light gray. Here, let a and b be the lengths of the perpendicularity from and to the plane , respectively. We can know that the length of the perpendicularity from to is . Note that the foot perpendicular on the plane from is a point on the plane, not B. Similarly, it is important to know that each foot perpendicular on the plane from and is also a point on the plane. By using the Pythagorean theorem, we can obtain the coordinate of as . However, we only obtain the x-coordinate of as b. In this case, we define the coordinate of as , in which y and z are unknown constants. The purpose of our modeling is to find the best-fitted normal vector of the plane to a given sunlight vector. In other words, finding is our primary goal. In our modeling, we can get the two equations from the geometry. The first equation is obtained from the fact that the length of equals the diagonal of a rectangular panel. That is,
Moreover, we know that the length of is equal to the height of the panel, , we have the following
Then, we can combine the two Equations (2) and (3) to get y and z in terms of a, b, , and as follows:
Now, we get from the fact that it shares the midpoint of the rectangle (). To find the normal vector of plane , we define both vectors and using , and . By using the cross product of and , we can find the normal vector as follows:
Similarly, we consider the case in which B is fixed as shown in Figure 2b. Following the above method, we can obtain the specific coordinates of and , which are moved points from and C, respectively. To sum up, let us assume that the coordinates and C are given as follows:
For the cases (i) fixed A and (ii) fixed B, we can derive the remaining coordinates of the panel as follows:
Subsequently, we need to evaluate the normal vector of the panel. In multi-apartment buildings, if an inclination angle is formed between the panel and the bottom plane perpendicular to the wall where the panel is installed less than a certain degree, it can be a nuisance downstairs due to a shade from the panel. For this reason, the angle is restricted by regulation, and we take a threshold as in this paper. Therefore, we can set the maximum value of b to ; hence we have the constraint for the problem (1). Figure 3a shows the curved triangular region where all the possible normal vectors can be located. Note that we set for simplicity.
Figure 3.
(a) All the possibilities of normal vector can be located. It is a curved triangular shape. Note that the black part corresponds to Figure 2a, and the blue part corresponds to Figure 2b. (b) Schematic illustration of finding the nearest normal vector , which is represented by green color, using the projection of solar beam , which is represented by red color, to the plane generated by any two vectors, and , such that lie on the nearest boundary of the region to . Note that we normalize the magnitude of the normal vector.
There are two cases for the given vector representing a solar beam . One is in the curved triangular region, and the other is outside of the curved region. We just take to the former. However, one cannot take a normal vector that coincides with if is outside of the region. In this case, we have to choose such that is maximized. Such a vector can be found as normalizing the vector, which is given by the projection of to the plane generated by any two vectors that lie on the nearest boundary of the region to . Figure 3b depicts the process of how to find the corresponding fitted normal vector to .
To be more precise, we can obtain the normal vector as follows:
where . An important thing is that we can simplify the representation of boundary vectors as the relation between a and b. Three endpoints of the triangular boundary are expressed by (i) , , (ii) , where A is fixed, (iii) , where B is fixed. Thus, one can easily get the best-fitted orientation for the solar panel by following the above process.
The solar beam is treated as a given constant throughout the whole process so far. The only remaining thing is, therefore, to choose an appropriate representative . One way to find the representative of a solar beam is by applying the mean value property to the trace of the sun. Assume that Earth is a sphere, and the orbit of Earth is a circle. Then the azimuth can be computed. Considering the spherical coordinates system while looking at the celestial body from the current position. Note that we fix the current position as Seoul, whose latitude is approximately . The south meridian altitude of the sun is on a great circle of spheres when the celestial body passes through the meridian of Earth. Furthermore, there are two times when the orbit of Earth and its axis of rotation are perpendicular; we call this vernal/autumnal equinox, respectively. Moreover, summer and winter solstices are parallel to the equinox. Therefore, the procedure assumes that the values between the maximum and minimum south meridian altitude have the same normal vector. To depict it clearly, we present Figure 4a as follows.
Figure 4.
(a) Illustration of the trajectory of the sun when the positions of Earth are on solstice and equinox in Seoul. Note that these three traces have an identical normal vector. (b) Illustration of a trace of the sun (magenta) and possibly generating trajectory (solid line). Note that the dotted line is part of the trace where the sunlight does not shine due to the azimuth angle of buildings. Solar vector (red) and solar panel (blue) are represented with the shaded region, which represents a possible area to receive sunlight. The black cuboid is a schematic illustration of the residence; it is actually treated as a point (the origin) in our method. (c) Illustration of the solar vector (red) and the best-fitted normal vector (blue). Note that a cyan-colored triangle represents the boundary of all possibly taken normal vectors of the solar panel.
Because the normal vectors of solstice and equinox are identical, we can easily find the trajectory of average solar movement via the intersection curve with this unique normal vector. Then we can compute if we know the azimuth angle of the place to install the solar panel. Suppose that we wish to install the panel in the building to a certain degree. Figure 4b depicts a trace of solar movement and the corresponding representative solar vector.
Therefore, combining all of the above conditions, we can find the best-fitted vector out of all the normal vectors that the solar panel can take along with respect to the solar vector. Figure 4c shows the evaluated solar vector and the derived best-fitted normal vector corresponding to the solar vector.
In summary, the optimal solar panel installation can be determined by knowing the south-middle altitude of the desired area and the azimuth angle of the building where the solar panel will be installed. Figure 5 depicts the procedure for finding the optimal installation specification of solar panels with respect to geometric features.
Figure 5.
Schematic illustration to find the optimal installation specification of solar panels.
3. Numerical Simulation Results
We present several numerical simulation results in this section. We fix the solar panel specification as and because this is the common length ratio of the standard solar panel. To evaluate the solar elevation angle at noon, we use the following formula [24].
where is the latitude, and is the declination angle defined as
where is degree of the rotation axis of Earth, and d represents the number of days since January 1st in 2022. For instance, one can take for 09:00 A.M. on 4 January 2022. Note that this approximation formula is fitted to UTC + 00:00. Though there is a slight difference (up to the second decimal place) between the fixed and local time-based formula, this condition can be ignored because we consider the declination angle only up to the first decimal place. All the latitudes are sourced from [25]. Table 1 shows monthly installation specification data with respect to the monthly arithmetic average of the south altitude of each city with the azimuth angle from the north. Note that we use the notation to represent the computed parameters hereafter.
Table 1.
Installation specification with respect to the south meridian altitude of each city. The azimuth angle is . Note that the data is aligned by month from the top (January) to the bottom (December).
Next, we present Table 2, a monthly installation specification data with respect to the monthly arithmetic average of the south altitude of each city with the azimuth angle from the north.
Table 2.
Installation specification with respect to the south meridian altitude of each city. The azimuth angle is . Note that the data is aligned by month from the top (January) to the bottom (December).
Subsequently, we present Table 3, which represents optimal installation specification data with respect to the monthly average of the south altitude of each city with the azimuth angle .
Table 3.
Installation specification with respect to the south meridian altitude of each city. The azimuth angle is . Note that the data is aligned by month from the top (January) to the bottom (December).
According to the above tables, it can be verified that the rate of change of the parameter is nearly zero when the south meridian altitude is high, and the latitude is low. These results are independent of the azimuth angle of buildings. Because time series data can be generated, it would be better to rotate the panel in real-time; however, in the case of installing a solar panel in a residential area, it is expensive to construct the panel support that moves according to the time. Therefore, we employ a weighted mean of monthly based on daylight time. More precisely, we adopt the following weight formula to each monthly weight as
where represents the length of the trajectory of the sun for the i-th month. Figure 6, Figure 7 and Figure 8 represent the weighted average values of the south meridian altitude in selected regions and those of parameters .
Figure 6.
Weighted average values of parameters with respect to each region in Table 1. Note that the number displayed after the city is the weighted average value of the south meridian altitude.

Figure 7.
Weighted average values of parameters with respect to each region in Table 2. Note that the number displayed after the city is the weighted average value of the south meridian altitude.
Figure 8.
Weighted average values of parameters with respect to each region in Table 3. Note that the number displayed after the city is the weighted average value of the south meridian altitude.
In addition, we evaluate the energy efficiency compared to the panel installed in parallel to its support by using the following function,
where is given constant and represents a normal vector of the panel installed in parallel to its support. Table 4 shows the annual efficiency based on (13) for each city.
Table 4.
The annual energy efficiency based on (13) for each city. The azimuth angle is (a) , (b) , (c) .
From the above results, it is effective to set the installation angle of the solar panel using the proposed method. In particular, the reason why the efficiency is higher in the area near the equator is that the south meridian altitude is much higher than in other areas.
4. Conclusions
In this paper, we propose a simple mathematical method to obtain the optimal installation conditions for solar panels in multi-apartment buildings. The presented method provides optimal installation information by considering the azimuth of the building and the amount of sunlight (per month). Through the numerical simulation results, we can confirm that more efficient energy generation can be expected via our method than the panel simply fixed on support without rotation (parallel to the building). Note that the efficiency is maximized if the panel can be rotated in real-time; however, it is not practical for residence; hence, finding an optimal fixed position for the panel is essential to have maximal efficiency under several constraints. In this study, the shadow effect (caused by itself or any other buildings) and the diffuse and reflected irradiations are not considered in the proposed method. These effects are common in urban areas; therefore, we plan to address these aspects in future works.
Author Contributions
Conceptualization, Y.C. and J.K.; Methodology, S.Y. and J.K.; Software, S.Y.; Validation, S.Y., J.P., C.L., S.K. (Sangkwon Kim), Y.C., S.K. (Soobin Kwak), H.K. and J.K.; Formal analysis, S.Y. and J.K.; Investigation, S.Y., Y.C., S.K. (Soobin Kwak); Data curation, S.Y.; Writing—original draft, S.Y., J.P., C.L., S.K. (Sangkwon Kim), S.K. (Soobin Kwak), H.K. and J.K.; Writing—review & editing, S.Y., S.K. (Soobin Kwak) and J.K.; Visualization, S.Y., J.P. and S.K. (Soobin Kwak); Supervision, J.K.; Project administration, S.K. (Soobin Kwak), H.K. and J.K.; Funding acquisition, S.Y. and J.K. All authors have read and agreed to the published version of the manuscript.
Funding
The first author (S. Yoon) was supported by the National Research Foundation of Korea (NRF) grant funded by the Ministry of Science and ICT of Korea (MSIT) (No. 2019R1A6A1A11051177). The corresponding author (J. Kim) and the APC were supported by the Brain Korea 21 (BK 21) FOUR from the Ministry of Education.
Data Availability Statement
The data used to support the findings of this study are available from the corresponding author upon request.
Acknowledgments
The authors wish to thank the reviewers for their constructive and helpful comments on the revision of this article.
Conflicts of Interest
The authors declare that there are no conflicts of interest regarding the publication of this paper.
Appendix A
The following MATLAB codes are available from the corresponding author’s webpage: https://mathematicians.korea.ac.kr/cfdkim/open-source-codes/ (accessed on 1 November 2022).




References
- Acosta-Silva, Y.d.J.; Torres-Pacheco, I.; Matsumoto, Y.; Toledano-Ayala, M.; Soto-Zarazúa, G.M.; Zelaya-Ángel, O.; Méndez-López, A. Applications of solar and wind renewable energy in agriculture: A review. Sci. Prog. 2019, 102, 127–140. [Google Scholar] [CrossRef]
- Firozjaei, M.K.; Nematollahi, O.; Mijani, N.; Shorabeh, S.N.; Firozjaei, H.K.; Toomanian, A. An integrated GIS-based Ordered Weighted Averaging analysis for solar energy evaluation in Iran: Current conditions and future planning. Renew. Energy 2019, 136, 1130–1146. [Google Scholar] [CrossRef]
- Sintali, I.S.; Abioye, A.M. Effects of Tilt Angles on the Thermal Performance of a Solar Parabolic Trough Collector System. Am. J. Appl. Sci. Res. 2020, 6, 76–82. [Google Scholar] [CrossRef]
- Skerlić, J.; Radulović, J.; Nikolić, D.; Bojić, M. Maximizing performances of variable tilt flat-plate solar collectors for Belgrade (Serbia). J. Renew. Sustain. Energy 2013, 5, 041820. [Google Scholar] [CrossRef]
- Le Roux, W.G. Optimum tilt and azimuth angles for fixed solar collectors in South Africa using measured data. Renew. Energy 2016, 96, 603–612. [Google Scholar] [CrossRef]
- Handoyo, E.A.; Ichsani, D. The optimal tilt angle of a solar collector. Energy Procedia 2013, 32, 166–175. [Google Scholar] [CrossRef]
- Darhmaoui, H.; Lahjouji, D. Latitude based model for tilt angle optimization for solar collectors in the Mediterranean region. Energy Procedia 2013, 42, 426–435. [Google Scholar] [CrossRef]
- Chang, Y.P. Optimal the tilt angles for photovoltaic modules in Taiwan. Int. J. Electr. Power Energy Syst. 2010, 32, 956–964. [Google Scholar] [CrossRef]
- Despotovic, M.; Nedic, V. Comparison of optimum tilt angles of solar collectors determined at yearly, seasonal and monthly levels. Energy Convers. Manag. 2015, 97, 121–131. [Google Scholar] [CrossRef]
- Saraf, G.; Hamad, F.A.W. Optimum tilt angle for a flat plate solar collector. Energy Convers. Manag. 1988, 28, 185–191. [Google Scholar] [CrossRef]
- Skeiker, K. Optimum tilt angle and orientation for solar collectors in Syria. Energy Convers. Manag. 2009, 50, 2439–2448. [Google Scholar] [CrossRef]
- Benghanem, M. Optimization of tilt angle for solar panel: Case study for Madinah, Saudi Arabia. Appl. Energy 2011, 88, 1427–1433. [Google Scholar] [CrossRef]
- Lave, M.; Kleissl, J. Optimum fixed orientations and benefits of tracking for capturing solar radiation in the continental United States. Renew. Energy 2011, 36, 1145–1152. [Google Scholar] [CrossRef]
- Bakirci, K. General models for optimum tilt angles of solar panels: Turkey case study. Renew. Sustain. Energy Rev. 2012, 16, 6149–6159. [Google Scholar] [CrossRef]
- Hartner, M.; Ortner, A.; Hiesl, A.; Haas, R. East to west–The optimal tilt angle and orientation of photovoltaic panels from an electricity system perspective. Appl. Energy 2015, 160, 94–107. [Google Scholar] [CrossRef]
- Chinchilla, M.; Santos-Martín, D.; Carpintero-Rentería, M.; Lemon, S. Worldwide annual optimum tilt angle model for solar collectors and photovoltaic systems in the absence of site meteorological data. Appl. Energy 2021, 281, 116056. [Google Scholar] [CrossRef]
- Kim, G.Y.; Han, D.S.; Lee, Z. Solar panel tilt angle optimization using machine learning model: A case study of Daegu City, South Korea. Energies 2020, 13, 529. [Google Scholar] [CrossRef]
- Gwesha, A.O.; Li, P.; Alfulayyih, Y.M. Optimization of Fixed Photovoltaic Panel “Tilt” Angles for Maximal Energy Harvest Considering Year-Around Sky Coverage Conditions. J. Sol. Energy Eng. 2021, 143, 021002. [Google Scholar] [CrossRef]
- Gökmen, N.; Hu, W.; Hou, P.; Chen, Z.; Sera, D.; Spataru, S. Investigation of wind speed cooling effect on PV panels in windy locations. Renew. Energy 2016, 90, 283–290. [Google Scholar] [CrossRef]
- Armstrong, S.; Hurley, W. A new methodology to optimise solar energy extraction under cloudy conditions. Renew. Energy 2010, 35, 780–787. [Google Scholar] [CrossRef]
- Elsayed, M.M. Optimum orientation of absorber plates. Sol. Energy 1989, 42, 89–102. [Google Scholar] [CrossRef]
- Zhong, Q.; Tong, D. Spatial layout optimization for solar photovoltaic (PV) panel installation. Renew. Energy 2020, 150, 1–11. [Google Scholar] [CrossRef]
- Oh, M.; Kim, J.Y.; Kim, B.; Yun, C.Y.; Kim, C.K.; Kang, Y.H.; Kim, H.G. Tolerance angle concept and formula for practical optimal orientation of photovoltaic panels. Renew. Energy 2021, 167, 384–394. [Google Scholar] [CrossRef]
- Woolf, H.M. On the Computation of Solar Elevation Angles and the Determination of Sunrise and Sunset Times; National Aeronautics and Space Administration: IL, USA, 1968. [Google Scholar]
- Available online: https://latlong.net (accessed on 6 January 2023).
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content. |
© 2023 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (https://creativecommons.org/licenses/by/4.0/).