# Configure Jupyter so figures appear in the notebook%matplotlibinline# Configure Jupyter to display the assigned value after an assignment%configInteractiveShell.ast_node_interactivity='last_expr_or_assign'# import functions from the modsim.py modulefrommodsimimport*frommpl_toolkitsimportmplot3dimportmatplotlib.gridspecasgridspecfromscipyimportintegrate
The question that we wanted to answer was: How does the ambient temperature increase due to global warming affect solar panel efficiency? This would be an explanatory question because we are trying to understand one of the causes of reduced efficiency of solar panels. This is an important question because it allows the customer or prospective customer to better understand where the energy from their panels is going and where some of it is being lost. On a larger scale, the losses would be much more significant, so the customer can see if it would be viable for them to install cooling.
To simulate the incidence power from sunlight over the course of the day, we are taking irradiance data from the course of a day in Needham (July). From this data, we factor in the albedo of the solar panels (how much energy is absorbed by the panel) to find the amount of power it is converting to electricity. We also factored in how many panels we are using, the surface area of the cells, and the time step for each datapoint of irradiance (30 minutes). We then took the specifications of the solar panel (such as maximum power production capacity, the power loss coefficient, and specific heat of the cells) and incorporated them into a set of equations that calculate the energy lost due to inefficiency over the course of the day. From that, we were able to plot the output over time and compare it to the ideal power generation with optimal conditions and visually see the inefficiency of the panel over the course of the day. Taking the integral of that allows us to see the cumilative energy loss over the course of the day.
defsimulation_day(system):temp,irradiance=system.initp_loss_percent=#creates an empty listducalc=#creates an empty listucalc=#creates an empty listdelta_u=#creates an empty listdelta_T=#creates an empty listT_celcius=#creates an empty listT_current=[295.15]#creates a list for the starting temperaturekwh_final=#creates a list with stored value of 0delta_irradiance=#creates a list with stored value of 0ideal_produced=#creates an empty listreal_produced=#creates an empty listreal_kwh=#creates an empty listideal_psum=#creates a list with stored value of 0ideal_kwh=#creates an empty listreal_psum=#creates a list with stored value of 0kwh_sum_real=#creates a list with stored value of 0kwh_sum_ideal=#creates a list with stored value of 0 irradiance1=[0,0,0,0,0,0,0,0,0,1,33,97,157,259,328,396,496,567,#creates a list with the values of irradiance over the course of 24 hours (30 min intervals)617,676,700,720,739,694,684,686,639,549,412,393,290,226,204,223,142,58,40,19,4,0,0,0,0,0,0,0,0]stamp=linrange(system.t_0,system.t_end,system.dt)#creates a timeseries with starting time at 0 minutes, an interval of 30 minutes, and an ending time of 1440 minutes)foriinrange(47):#creates a forloop with 47 iterationsdiffU=system.area*irradiance[i]*system.absorb#calculates how much energy is absorbed by the PV Panels from irradianceducalc.append(diffU)#adds diffU to the list "ducalc"UU=ducalc[i]*system.dt#multiplies the "ducalc" of the current list by dtucalc.append(UU)#places "UU" in the list "ucalc"delta_u.append(ucalc[i]-ucalc[i-1])#subtracts "ucalc" from the previous value of "ucalc", then places the answer in a list named "delta_u"delta_T.append(delta_u[i]/(system.specif*system.weight))#divides "delta_u" by the product of "system.specif" and "system.weight", then places it in a list named "delta_T"T_current.append(delta_T[i]+T_current[i])#adds "delta_T" or change in temperature from the current iteration to the current temperature ("T_current"), then adds it to a listT_celcius.append(T_current[i]-273.15)#converts the current temperature from Kelvin to Celcius, then adds it to a listp_loss_percent.append(T_celcius[i]*system.loss_coeff)#multiplies the current temperature by the loss coefficient of the PV panels, then adds it to a listideal_produced.append(system.maxPower*system.panel_num*irradiance1[i]/1000)#calculates the ideal amount of power produced by the PV panels without inefficiencies due to heat, then adds it to a listreal_produced.append(ideal_produced[i]*(1-p_loss_percent[i]))#calculated the actual power produced by the PV panels, then adds it to a listreturn(stamp,real_produced,ideal_produced,p_loss_percent,real_kwh,ideal_kwh)#returns the outputs
In [ ]:
stamp_day,real_produced_day,ideal_produced_day,p_loss,real_kwh_day,ideal_kwh_day=simulation_day(system)#places the outputs of the system into each of 6 variables
In [ ]:
In [ ]:
defintegrator(produced):#defines new variable with parameter "produced"kwh_conv=#creates a list with stored value of 0stamp_h=#creates a list with stored value of 0stamp=linrange(system.t_0,system.t_end-30,system.dt)#creates a timeseriesforiinrange(47):#runs a forloop for 47 iterationskwh_conv.append(produced[i]/1000)#converts the output of Wh to KWh and places it in a liststamp_h.append(stamp[i]/60)#converts minutes to hours and places it in a liststamp_int=(integrate.cumtrapz(kwh_conv,stamp_h))#takes the integral of the KWh's produced with respect to time to produce "stamp_int"returnstamp_int#returns "stamp_int"
In [ ]:
kwh_real=integrator(real_produced_day)#takes the integral of "real_produced_day"kwh_ideal=integrator(ideal_produced_day)#takes the integral of "ideal_produced_day"
In [ ]:
defplot_2D(ideal,real):#defines a new plot with parameters "real" and "ideal"stamp_h=#creates a new empty liststamp=linrange(system.t_0,system.t_end-30,system.dt)#creates a timeseries named "stamp"foriinrange(47):#creates a forloop with 47 iterationsstamp_h.append(stamp[i]/60)plot(stamp_h,real)plot(stamp_h,ideal)decorate(title='Kwh total Generated over a day ideal vs heat inefficiency',xlabel='Time (hours)',ylabel='Total Kwh Generated over a day')
The chart titled "Kwh total Generated over a day ideal vs heat inefficiency" displays how there is a direct correlation between irradiance, the power generated by the PV panels, and the inefficiency due to heat. It is visable that the graph that accounts for the inefficiencies due to heat is just a scaled down version of the ideal graph, and power generation peaks at the same time that irradiance does. We can also see from the cumilative inefficiency (energy lost due to the inefficiency caused by heat of the solar panels) over the course of the day that there is a total loss of 7.33 KWh or 78.2% of its full potential given the same irradiance. It is very clear that higher temperatures of PV cells have a significant negative impact on their efficiency.
The final plot represents total energy loss over the course of the day due to the inefficiency of the panel (over the x and z axes) and what the irradiance (inefficiency is directly correlated with irradiance) is over the course of the day as well (over the y and y axes). However, as inefficiency peaks during that time of the day, power production also peaks because the energy generated due to the irradiance increase outpreforms the energy loss due to the inefficiency increase. This essentially means that power loss due to inefficency increase has to be accounted for when investing in solar panels as it is an inherent flaw of the technology. This also means that efficiency could be significantly improved with the addition of some passive cooling system.
Connecting this to sustainability; since we know that the temperature of a solar cell is directly correlated to the cell's inefficiency and that aggregate global temperatures are also increasing, we can deduce that the aggregate equillibrium temperature the solar panel reaches as it dissipates its thermal energy to the surrounding environment also increases. In other words, global warming is worsening the efficiency of solar panels.