text:
Thank you for visiting nature.com. You are using a browser version with limited support for CSS. To obtain the best experience, we recommend you use a more up to date browser (or turn off compatibility mode in Internet Explorer). In the meantime, to ensure continued support, we are displaying the site without styles and JavaScript.

# A silicon carbide-based highly transparent passivating contact for crystalline silicon solar cells approaching efficiencies of 24%

## Abstract

A highly transparent passivating contact (TPC) as front contact for crystalline silicon (c-Si) solar cells could in principle combine high conductivity, excellent surface passivation and high optical transparency. However, the simultaneous optimization of these features remains challenging. Here, we present a TPC consisting of a silicon-oxide tunnel layer followed by two layers of hydrogenated nanocrystalline silicon carbide (nc-SiC:H(n)) deposited at different temperatures and a sputtered indium tin oxide (ITO) layer (c-Si(n)/SiO2/nc-SiC:H(n)/ITO). While the wide band gap of nc-SiC:H(n) ensures high optical transparency, the double layer design enables good passivation and high conductivity translating into an improved short-circuit current density (40.87 mA cm−2), fill factor (80.9%) and efficiency of 23.99 ± 0.29% (certified). Additionally, this contact avoids the need for additional hydrogenation or high-temperature postdeposition annealing steps. We investigate the passivation mechanism and working principle of the TPC and provide a loss analysis based on numerical simulations outlining pathways towards conversion efficiencies of 26%.

## Main

At present, the efficiency of most crystalline silicon (c-Si) solar cells is limited by recombination in the diffused emitter regions and at the contact between metal electrodes and the silicon absorber1. Device designs that avoid diffused emitter regions and direct metal-absorber contacts, commonly denoted as passivated contacts, are key enablers for a further increase of efficiency. So far, three concepts have been developed that enable junction formation in crystalline silicon solar cells without diffused emitters. These concepts are: the silicon heterojunction (SHJ) based on intrinsic and doped amorphous silicon2,3,4; the so-called TOPCon or POLO concepts using a combination of silicon oxide and polycrystalline silicon (SiO2/poly-Si)5,6 and the use of metal oxides/nitrides/fluorides such as MoOx (refs. 7,8,9), TiN10 or LiF8.

While these approaches allow high efficiencies, they come with a considerable drawback. The implementation of, for example, MoOx combined with intrinsic hydrogenated amorphous silicon (a-Si:H) enabled solar cells with an efficiency >23.5% (ref. 11). The short-circuit current density (Jsc) limited the efficiency due to the high amount of parasitic absorption by the intrinsic a-Si:H layer. The other two concepts have achieved efficiencies in the >25% range so far. However, due to the low band gaps and substantial absorption coefficients of a-Si:H and poly-Si (Fig. 1a), these layers cause stronger parasitic absorption losses when compared to other nanocrystalline silicon/silicon alloys with comparable thickness but a higher band gap. In the case of poly-Si, these optical losses are so severe that the application of this contact is up to now restricted to the rear side of c-Si solar cells12. It can also be clearly seen in Fig. 1a that for photon energies above 1.75 eV, nc-SiC:H(n) features the lowest absorption coefficient and thereby the best transparency among these materials.

While nc-SiC:H(n) is an obvious candidate to achieve highly transparent front contacts, so far efficiencies have lagged behind due to difficulties in obtaining nc-SiC:H(n) that features high transparency, good conductivity and at the same time provides sufficient hydrogenation for passivation. These three properties are the challenges to be overcome for high efficiency c-Si solar cells, as depicted in Supplementary Note 1 in the Supplementary Information.

The present paper demonstrates how to overcome this drawback by using exclusively low-temperature processes and by the implementation of a highly transparent passivating contact (TPC) scheme consisting of a thin, wet-chemically grown SiO2 tunnel oxide and a hot-wire chemical vapour deposition (HWCVD) fabricated wide band gap nc-SiC:H(n) (Eg of approximately 2.7–3 eV)13 contact layer, as depicted in Fig. 1b. Here, we demonstrate an independently confirmed efficiency of 23.99 ± 0.29%. This efficiency was achieved by introducing a double layer stack of nc-SiC:H(n) deposited first with low and subsequently with high filament temperatures to tackle the trade-off between passivation and conductivity. Furthermore, a systematic investigation and optimization of the ITO sputtering conditions combined with a low-temperature curing contributed to the efficiency improvement.

## Development of a nc-SiC:H(n) double layer stack

For nc-SiC:H(n) deposited at low filament temperatures (Tf < 1,750 °C), the electrical conductivity is usually below 10−10 S cm−1 compared to filament temperatures between 1,900 and 2,100 °C where the electrical conductivity drastically increases to 0.07–0.9 S cm−1 (see Supplementary Note 2 for more information about the electrical properties of nc-SiC:H(n)). Given that the higher band gap of nc-SiC:H(n) is a natural advantage in terms of optical transparency, the optimization of the nc-SiC:H(n) layer still has to tackle the trade-off between passivation and conductivity that hampered earlier attempts to make efficient silicon solar cells with SiC-based contacts13,14.

Figure 2 shows the implied open-circuit voltage (iVoc) of the c-Si(n) wafer symmetrically passivated by the TPC (Fig. 2a) and the contact resistivity of the TPC stack (Fig. 2b) as a function of the filament temperature. For a single nc-SiC:H(n) layer (thickness of 30 nm) deposited at increased filament temperatures the passivation quality of the TPC is reduced, while high Tf is needed for low contact resistivities (Fig. 2b). Thus, a single nc-SiC:H(n) layer deposited by HWCVD cannot maximize passivation quality and minimize resistive losses at the same time. To overcome this trade-off, the filament temperature during the deposition was changed, hence a double layer stack of nc-SiC:H(n) was implemented (9 nm for the first layer and 25–30 nm for the second layer). The modified process starts with a lower Tf of 1,775 °C for the layer in direct contact with the tunnel oxide. This is followed by a layer deposited using a higher Tf, which was initially varied as shown in Fig. 2a. This double layer nc-SiC:H(n) stack allows to keep the passivation quality nearly independent of Tf in the second stage resulting in a maximum iVoc of 740 mV. At the same time, the contact resistivity is kept at a low value of 38 mΩ cm2, as shown in Fig. 2b. Achieving the same low contact resistivity in a single layer would cause a substantial loss in passivation quality (iVoc < 720 mV).

Three mechanisms presumably contribute to the reduced iVoc at higher Tf. First, the nc-SiC:H(n) deposited at higher Tf contains less hydrogen than at lower Tf. However, hydrogen is necessary to passivate remaining dangling bonds at the c-Si/SiO2 interface. Second, the substrate temperature is increased due to increased thermal radiation of the filaments at increased Tf. An increased substrate temperature is known to reduce the TPC passivation quality15, which might be caused by an out-diffusion of hydrogen from the interface. Third, higher Tf leads to an increased hydrogen radical density during the HWCVD deposition16. The hydrogen radicals can be a source of damage for the crystalline silicon interfaces17,18, thus increase the density of dangling bonds and deteriorate the passivation quality.

In addition to the filament temperatures, the thicknesses of both nc-SiC:H(n) layers and the doping gas flow might also be factors influencing passivation quality and conductivity. To be able to judge which deposition parameters have the strongest influence on the overall solar cell performance, we conducted a design of experiment (DoE). In this DoE we found that the thickness of the first nc-SiC:H(n) layer for passivation with low electrical conductivity has the strongest influence on the fill factor. By decreasing the thickness from 13 to 3 nm to decrease the bulk resistance, the series resistance was reduced from 2.5 to 0.65 Ω cm2 resulting in a fill factor increase from 63 to 77% while maintaining the high passivation quality (see Methods and Supplementary Discussion 1 for more details about the DoE).

## Passivation mechanism and working principle of TPC

In contrast to SiO2/poly-Si passivating contacts, the passivation of SiO2/nc-SiC:H(n) works without any high-temperature recrystallization, hydrogenation or firing steps19. The as-deposited low-temperature (heater set temperature of 250 °C) nc-SiC:H(n) deposited by HWCVD was found in literature to allow for an effective interface hydrogenation for c-Si(n)/SiO2/poly-Si contacts without additional steps20. Since no high-temperature steps are involved in the TPC fabrication process, the hydrogen supplied during HWCVD deposition is also found to accumulate at the c-Si(n)/SiO2 interface. This effect can be seen in Fig. 3a displaying the secondary-ion mass spectrometry (SIMS) profiles. This hydrogen avoids the demand of any further hydrogenation steps. For the single layer stack shown in the upper graph of Fig. 3a, the hydrogen concentration in the nc-SiC:H(n) bulk is decreased for increased Tf, while the hydrogen concentration at the interface is increased. The reason for the accumulation of hydrogen at the interface is most probably the increased sample temperature as higher thermal radiation of the hot wires enables a higher diffusivity of the hydrogen. Another potential reason for the accumulation is that the higher filament temperature also leads to higher kinetic energies of the hydrogen radicals causing deeper in-diffusion. For Tf = 2,040 °C, the hydrogen peak at the interface decreased indicating out-diffusion of hydrogen. This behaviour of hydrogen in- and out-diffusion was also reported for SiO2/poly-Si contacts21.

Another reason for the high passivation quality is that the SiO2 layer is working as a protection layer against the hostile deposition conditions during the HWCVD process. The SiO2 prevents interface damage and simultaneously reduces the dangling bond density at the c-Si(n) surface22. The interface of c-Si(n)/SiO2/nc-SiC:H(n) is undamaged, which is revealed in the high-resolution, bright-field scanning transmission electron microscopy (HRSTEM) image in Fig. 3b. Close to the SiO2/c-Si interface, the SiC layer is amorphous, whereas nc-SiC crystals embedded in an amorphous matrix are observed in the bulk of the material (Fig. 3b, arrow). The energy dispersive X-ray spectroscopy (EDX) line profile, obtained at a comparable location within the sample, additionally shows that aside from silicon, oxygen is present at the interface to the crystalline silicon substrate, indicating that the SiO2 is not entirely removed during the HWCVD process (see also the EDX mapping result in Supplementary Fig. 7).

The passivation of the c-Si(n)/SiO2 interface is additionally supported by the electrostatic potential difference between c-Si(n) and the conductive nc-SiC:H(n). This potential difference induces a band bending in the c-Si(n) as illustrated in the Fig. 3c showing the band diagram obtained from the technology computer-aided design (TCAD) Sentaurus simulations (Methods and Supplementary Discussion 2). The energy of the Fermi level of nc-SiC:H(n) was measured to be approximately 3 eV relative to the vacuum level (Supplementary Fig. 12). For the conductive nc-SiC:H(n) deposited at higher Tf, the carrier concentration is higher and thus leads to a Fermi level closer to the conduction band, which induces a stronger band bending in the c-Si. Due to the strong band bending in the c-Si, the energy bands can become degenerated close to the c-Si/SiO2 interface, which induces a strong accumulation of majority charge carriers (electrons) at the interface, while the band bending suppresses the minority charge carrier (holes) accumulation near the c-Si(n)/SiO2 interface. The concentration difference between the majority and minority carriers at the interface reduces the probability of surface recombination23. With a carrier accumulation at the c-Si/SiO2 interface estimated to be 7.4 × 1019 cm−3 from the TCAD simulation, the carrier accumulation exceeds the density of states in the conduction band of c-Si(n) (2.8 × 1019 cm−3). Note that this is achieved without the support of any buried diffusion of dopants in the c-Si(n) as in the case of passivating contacts based on poly-Si24,25.

Due to the co-existence of the high hydrogen concentration at the c-Si(n)/SiO2 interface and the strong field-effect passivation, the passivation quality of the SiO2/nc-SiC:H(n) contact reaches an iVoc up to 740 mV. The stronger band bending and thereby stronger field-effect passivation explains the lower hydrogen content at the interface but similar passivation quality that is found in the double layer stack with the conductive nc-SiC:H(n) deposited at higher Tf (visualized in the lower graph of Fig. 3a). The accumulation of electrons at the c-Si(n) interface promotes the tunnelling through the thin SiO2 layer to the conductive nc-SiC:H(n) layers. In this respect, the measured activation energy of the dark conductivity is 50 to 100 meV (refs. 15,26), which represents the energy difference between the conduction band edge and the Fermi level. Such a low value reveals the negligible contribution of nc-SiC:H(n) to the potential barrier for collecting electrons. Hence, TPCs based on nc-SiC:H(n) enable excellent energy alignment for an efficient field-effect passivation and for electron extraction.

The SiC-based tunnel-junction front contact has some comparable properties to the common low-temperature approach of the a-Si SHJ double stack (doped/intrinsic). These similarities include the supply of H2 to the interface by the intrinsic/passivation layer, field-effect passivation and carrier selectivity provided by the doped/conductive layer. The key difference lies in the absence of the smaller band gap and the low transparency of the doped a-Si or even poly-Si layers relative to the nc-SiC:H(n). Additionally, using the tunnel oxide rather than intrinsic a-Si:H as the interface passivation layer on top of the c-Si, the TPC further facilitate the advantage in terms of transparency.

## Investigation and mitigation of sputter degradation

On completion of the devices we observed a substantial difference between the implied Voc after nc-SiC:H(n) deposition and the actual Voc of the finished devices. This difference of up to 32 mV indicates that during ITO sputtering the passivation quality is substantially deteriorated, which is similar to that reported for solar cells passivated by a-Si:H27 and SiO2/poly-Si28,29. Degradation of the passivation due to ITO sputtering can originate either from ion bombardment or from ultraviolet (UV) light emitted for example by oxygen in the plasma (λ = 130.5 nm) during sputtering30,31.

To identify the main source of the sputter degradation, we conducted model experiments measuring the minority charge carrier lifetime of wafers that were symmetrically passivated by TPC. The wafers were partially covered with different optical filters and exposed either to a pure oxygen plasma without sputtering or a complete ITO deposition process (see details in Supplementary Discussion 3). During the pure plasma treatment, only those areas that were covered with filters blocking wavelengths down to 130 nm radiation preserved a high lifetime. In contrast, during ITO deposition all areas that were covered by any filter, blocking or partly transparent to the 130 nm radiation, preserved a high minority charge carrier lifetime due to the physical protection of the wafer from sputter damage. Furthermore, the uncovered areas showed only a moderate degradation compared to the results from the pure plasma experiment. We therefore conclude that during the deposition process the damage by radiation is increasingly limited by the optical transparency of the growing ITO film and the sputter damage is the relevant degradation mechanism to be considered.

This finding indicates that an optimization of the ITO deposition process by adjusting the ion flux density by the sputter power (Pdep) and the secondary-ion energy by the deposition pressure (pdep) is required. For the latter, a higher pressure reduces the free path and therefore reduces the kinetic energy of the ions. The best solar cell with the optimized ITO sputtering process showed an increase in Voc with respect to the reference from 711 to 718 mV. However, the difference from before sputtering to after sputtering (iVoc to Voc) is still 20 mV.

As a final measure, we cured the samples on a hot plate in two steps at 220 °C for 10 + 10 min leading to an improvement in Voc by 4 and 7 mV for the two cells with improved (high pressure, low power) and optimum (high pressure, intermediate power) deposition conditions. In contrast, the reference cell exhibited no increase in Voc by the same treatment. The highest Voc in this series was 725 mV going along with the lowest iVoc to Voc difference (before sputtering to after curing) of 12 mV. Thus, lowering ion energy and flux not only reduces the initial damage but also allows some of the damage to be cured, for example by the reduction of dangling bonds at the interface due to the re-organization of hydrogen32.

## Optical loss analysis for the optimized solar cell

The performance of the four best solar cells after the curing experiment (Supplementary Fig. 16) were independently certified by CalTeC at the Institute for Solar Energy Research in Hamelin (Supplementary Fig. 17 and Supplementary Discussion 4). The best solar cell of this series was certified with an efficiency of 23.79% and a Voc of 725 mV. Subsequently, a MgF2 layer was used as an antireflection coating to reduce the reflectivity of the solar cells (Supplementary Fig. 18) leading to a certified efficiency η = 23.99 ± 0.29% and Jsc = 40.87 ± 0.57 mA cm−2 (Supplementary Fig. 19). The evolution of the solar cell parameters due to the optimization of the SiC double layer, transparent conductive oxide (TCO) and ARC is summarized in Fig. 4. For comparison, µc-SiOx:H(p) as a front side emitter layer allowed for Jsc = 40.4 mA cm−2 but with much lower Voc and fill factor, FF (ref. 33). Implementing a double layer antireflection coating of SiOx:H/ITO for SHJ solar cells yielded a Jsc = 40.6 mA cm−2 via a photolithography based metallization34. Within the measurement error range, our result equals the short-circuit current density record value of 40.8 mA cm−2 for a both-side-contacted SHJ solar cell reported by Kaneka35. Here, Kaneka used the copper plating technology for metallization and a finger width of approximately 30–40 μm (refs. 35,36). However, due to the lack of information concerning the metallization fraction and ARC of this solar cell, we cannot provide an in-depth comparison. For our cells, we used a finger width of approximately 60 µm and a circumferential busbar outside of the active area (Supplementary Fig. 20).

The optimized front contact stack includes 70 nm of ITO, 30 nm of conductive nc-SiC:H(n) and 3 nm of passivating nc-SiC:H(n). By performing an optical simulation with the software GenPro4 (ref. 37), we present the optical analysis of the optimized solar cells in Fig. 5. The simulations are performed for the device (coated with a 125 nm MgF2 layer) shown in Supplementary Fig. 19. For the relevant wavelength range (300–1,100 nm) there is a good agreement between measured and simulated results. Only for wavelengths longer than 1,100 nm are the deviations between simulation and measurement substantial. This can most probably be explained by an underestimation of the absorption coefficient of the TCO or silver in this wavelength range. Since in this wavelength range the absorptance of c-Si is negligible, this optical deviation does not affect the calculated optical generation rate or the subsequent electrical simulations based on these optical simulations.

The shading of the grid of 3.1% leads to a short-circuit current density loss of 1.4 mA cm−2. The parasitic absorption in the nc-SiC:H(n) layers is less than 0.7 mA cm−2, thus confirming the high transparency. In contrast, >2 mA cm−2 is typically lost by parasitic absorption in the front side layer stack of conventional front-back contacted SHJ solar cells38. This result was experimentally validated by measurements on SHJ cells made in-house39 and by state-of-the-art SHJ cells from Kaneka40. Moreover, the high passivation quality leads to recombination losses of less than 0.05 mA cm−2. The highest parasitic absorption loss is introduced by the front side ITO. To further increase the Jsc, several options can be implemented: decreasing the finger width from currently 60 to 40 µm by using a screen with narrower finger openings; using a thinner ITO and/or more transparent TCO with less parasitic absorption; or implementing a TCO-free concept, where the c-Si(n) wafer with an estimated sheet resistance 60 Ω sq–1 supports the lateral transport of the charge carriers. Removing the TCO, meanwhile, can mitigate sputtering damage due to the TCO deposition, which would also improve the passivation of the contact. The work on a TCO-free contact is currently ongoing.

## Practical efficiency potential for TPC solar cells

The theoretical efficiency ($${\eta }^{{\rm{theo}}}$$) limit for a c-Si solar cell according to Richter et al.41, which considers the intrinsic limitation and relies on the assumption of a perfect Lambertian light trapping scheme, is predicted to be $${\eta }^{{\rm{theo}}}$$ = 28.66%. In the calculation, a 170-μm-thick c-Si wafer with a resistivity of 1 Ω cm as also used in this work is assumed, leading to a theoretical Voc, $${V}_{{\rm{oc}}}^{{\rm{theo}}}$$ = 746.9 mV, theoretical Jsc, $${J}_{{\rm{sc}}}^{{\rm{theo}}}$$ = 43.72 mA cm−2 and theoretical FF, $${{\rm{{FF}}}}^{{\rm{theo}}}$$ = 87.75%. The difference between the theoretical limit of $${\eta }^{{\rm{theo}}}$$ = 28.66% and the actual achieved efficiency in this work of $${\eta }^{{\rm{act}}}$$ = 23.99% is 16.3% relative. Among the IV parameters, the FF shows the strongest potential for improvement with 7.8%, while for Jsc the potential is 6.5% and for Voc it is 2.9%.

To investigate the reason for the FF difference, we conducted a FF loss analysis42 using a two-diode equivalent circuit to model the solar cell. For this analysis, the losses in FF are parameterized by the losses due to the saturation current density of the first and second diode (J01 and J02), as well as by the shunt resistance (Rsh) and the series resistance (Rs). The saturation current density J01 describes recombination currents in the quasi-neutral bulk and the solar cell surfaces, while J02 mostly describes the recombination attributed to Shockley–Read–Hall defects in the space charge region. The results are presented in Fig. 6. The maximum FF for our optimized solar cells by avoiding all J02, Rs and Rsh related losses is the FFJ01 and is calculated to be approximately 85%. From the FF loss analysis, it becomes clear that the shunt resistance does not contribute any notable loss to the FF. The loss due to the series resistance is the largest loss (2.96%abs) followed by the loss of 1.11%abs due to recombination in the space charge region (J02). The transmission line method (TLM) measurement for the front TPC (ITO/nc-SiC:H(n)/SiO2/c-Si(n)) and the rear SHJ contact (ITO/a-Si:H(p/i)/c-Si(n)) delivers contact resistivities of 38 and 350 mΩ cm2, respectively, indicating that the rear SHJ contact contributes most strongly to the series resistance and is the bottleneck for FF improvement, which is consistent with the TCAD simulation results.

From the Suns-Voc measurement for the optimized solar cells, an Rs of 0.58 Ω cm2 can be determined. Using an anticipated value of 0.45 Ω cm2 by optimizing the contact resistivity at the rear SHJ contact, a FF of 81.5% can be calculated. Concerning the Jsc loss, it is shown in the last section, that the shading loss and parasitic absorption in the ITO are the two biggest losses that need further optimization. By reducing the finger width from 60 to 40 µm (shading ratio from 3.1 to 2.1%), a Jsc gain of 0.46 mA cm−2 can be calculated. Combining this gain with the optimization of the transparency of TCO and reflection minimization, a Jsc of 42 mA cm−2 is practically achievable. Considering that there is still an iVoc to Voc drop of 12 mV, further optimization on improving the iVoc and decreasing the iVoc to Voc drop are important for a higher Voc. The optimization of the SiO2 preparation process is ongoing. First results show that a 7 mV gain in iVoc is possible, which indicates that a Voc of 730 mV is in reach. An efficiency of 25% can finally be predicted assuming the practical IV parameters of Voc of 730 mV, Jsc of 42 mA cm−2 and FF of 81.5%.

Numerical simulations are performed using the TCAD Sentaurus to identify directions and potentials for further improving the power conversion efficiency of solar cells using the TPC. The results reveal that optimizing the rear SHJ contact stack the Voc and FF could be improved up to 739 mV and 84.2%, respectively. Such an improvement would be due to the field-effect passivation in case of Voc and interface transport in case of FF enhancement24,43. Furthermore, considering advanced metallization techniques, for example copper plating, we have the flexibility to have smaller pitch sizes and front metallization fraction. Addressing these two aspects could potentially lead to FF improvements up to 85% due to the decreased lateral transport in the smaller finger pitch (500 µm pitch size and 10 µm front contact width), and Jsc above 42 mA cm−2 due to the smaller metallization fraction (<2% front metallization). In fact, front and back contacted solar cells using TPC technology will be promising candidates to break the 26% threshold for c-Si single junction solar cells.

## Conclusion

The present paper has demonstrated that a promising front passivating contact system (SiO2/nc-SiC:H(n)/ITO) provides a possibility to solve the triple challenge of conductivity, passivation, and transparency. The evolution of TPC solar cells and simulations demonstrate that the SiC-based TPC has an inherent, not yet fully exploited, advantage over other heterojunction contacts in terms of transparency (Jsc) with the potential to achieve Jsc in the range of 42 mA cm−2 likes diffused junctions13. At the same time, the high Voc of the heterojunctions can be maintained. Thus, innovations such as the double layer nc-SiC:H(n) stack allow to optimize all three photovoltaic parameters without the need of compromising between them. In addition, we demonstrate that the process flow for the TPC is very lean, the extra hydrogenation or high-temperature postdeposition annealing steps, which add cost and energy to the process flow of other passivated contact schemes44, are not needed. Finally, in view of the short research history, we see scope for further improvements beyond the present efficiency of 24% to a practical efficiency of 25%. Numerical simulations predict an efficiency of 26% by improving FF and Voc via optimizing the SHJ contact at the rear side and introducing a frontier metallization approach such as copper plating.

## Methods

### Fabrication of symmetric samples and solar cells with TPC

The symmetric samples and solar cells were fabricated with Czochralski grown n-type double-side textured, 170-µm-thick, 1 Ω cm silicon <100> wafers produced by LONGi. The wafers were cleaned in a cleanroom according to standard RCA cleaning45. The native oxide was afterwards removed in 1% diluted hydrofluoric acid for 5 min. Afterwards, the wet-chemical oxide was produced in a mixture of H2O2:H2SO4 at 2:1 at a temperature of around 60 °C for 10 min. This results in a SiO2 thickness of roughly 1 nm (ref. 46). The nc-SiC:H(n) layers were deposited by HWCVD partly in an in-house built system and partly in a commercial system built by MRG. As precursors 5% monomethylsilane diluted in H2 (MMS, 6 standard cubic centimeters per minute (sccm)), hydrogen (H2, 94 sccm) and nitrogen (N2, 30 sccm) were used if not stated otherwise. As a catalyser, three 15 cm curled rhenium wires were used. The substrate is heated by a substrate heater set to 250 °C. The deposition pressure was 0.75 mbar. The filament temperature was tuned by adjusting the electrical current through the wires. For double layer stacks, the temperature of the hot-wire filaments was ramped up during the deposition. For symmetric samples, the first layer of nc-SiC:H(n) was deposited at Tf = 1,775 °C with a thickness of 9 nm. The filament temperature for producing the conductive second layer was varied between Tf = 1,895 and 2,055 °C with layer thicknesses of 25–30 nm. The solar cells for the ITO development were deposited with nc-SiC:H(n) layers deposited at Tf = 1,775 °C with a thickness of 3 nm, followed by Tf = 1,950 °C with a thickness of 30 nm.

For solar cells, the back side SiO2 was removed in a hydrofluoric acid dip for 5 min following SiC deposition. Afterwards, the a-Si:H(i) 7 nm and a-Si:H(p) 7.4 nm layers were deposited at 200 °C in an AK1000 PECVD system provided by Meyer Burger. The intrinsic layer was deposited at 50 W with an H2 flow of 650 sccm and a SiH4 flow of 145 sccm. The p-type layer was deposited at 90 W with an H2 flow of 500 sccm, a SiH4 flow of 50 sccm and 1% trimethylboron in H2 flow of 100 sccm. In this system, all back contacts for each solar cell experiment were deposited at once. The ITO was sputtered from a 3% ITO target rotating at 10 r.p.m. at a sample heater temperature of 250 °C and through a mask to create four 2 × 2 cm2 solar cells on each wafer. The ITO on the a-Si:H(p) was sputtered, using a deposition pressure of 6 µbar, deposition power of 5 kW, an Ar flow of 90 sccm and an O2 flow of 5 sccm. The ITO deposition of the back side was kept the same throughout this study. For sputtering on the nc-SiC:H(n) the reference ITO was deposited at a deposition pressure of 6 µbar, deposition power of 5 kW, an Ar flow of 197 sccm and an O2 flow of 3 sccm. In the ITO optimization experiment for the n-side, deposition pressures of 10, 15 and 20 µbar and deposition powers of 0.5, 3.35 and 6.2 kW are tested. The metal contacts have been screen printed by an MT-650TVC screen printer from Micro-tec using a low-temperature silver paste H9481 provided by NAMICS. The silver paste was afterwards annealed at 190 °C in an oven for 40 min. The curing of the solar cells was performed on a hot plate at 220 °C for 10 + 10 min. A MgF2 ARC (125 nm) was thermally evaporated by an electron beam as an ARC on the front side of the best solar cell. The cell was subsequently annealed for 10 min on a hot plate at 200 °C. The oxygen plasma treatment of the sample covered with UV filters was done in an Oxford Instruments OpAL ALD reactor for 15 min. The O2 flow was 100 sccm at 0.12 mbar and 300 W at 50 °C. The respective ITO deposition was performed at 3.35 kW and 15 µbar.

### DoE for double layer stack development of nc-SiC:H(n)

To be able to judge which HWCVD deposition parameter has a significant influence on the device performance, we varied five parameters on two levels (high and low). We varied the filament temperature (and thereby the conductivity) of the nc-SiC:H(n) deposition as well as the layer thickness for the passivation and the conductive layer separately. The filament temperature was changed from 1,775 to 1,875 °C and from 1,950 to 2,060 °C for the passivation and the conductive nc-SiC:H(n) layer, respectively. The layer thickness was changed from 3 to 13 nm and from 11 to 27 nm for the passivation and conductive layer, respectively. The wire temperature was measured using a Raytek Marathon pyrometer with an accuracy of approximately ±20 °C. The layer thickness is estimated from thickness measurements of nc-SiC:H(n) on polished silicon substrates. The doping gas flow rate of nitrogen was kept the same for both layers but was varied between 30 and 100 sccm. If all parameter combinations were to be investigated that would result in a total number of 32 experiments. Therefore, we decided to use the advantage of a fractional factorial plan that allowed us to reduce the experiments to 16. Additionally, we did three centre-point experiments (experiments 17–19 in Supplementary Table 1) where all five parameters had the centre value between high and low levels to judge the significance of the parameters. Nevertheless, by this reduction in number of experiments we sacrificed complete information about all interactions of the deposition parameters. To be able to see the influences of the five parameters we calculated the effect E of each parameter i: $${E}_{i}={\bar{y}}_{{\rm{high}}}-{\bar{y}}_{{\rm{low}}}$$ where $${\bar{y}}_{{\rm{high}}}$$ is the mean value of the results y when the parameter was set to the high level and $${\bar{y}}_{{\rm{low}}}$$ is the mean value of the results y when the parameter was set to the low level. The result hereby means the measured value by current–voltage (IV) or photoconductance measurements (for example, efficiency, fill factor or iVoc). The stronger the absolute effect is, the stronger is the influence of the investigated parameter on the final result. When the effect is positive, changing the level of the parameter from low to high results in an increase of y.

In the case of the effect of the passivation layer thickness on the fill factor as shown in Supplementary Fig. 2, the effect is negative meaning that the fill factor can be increased by decreasing the layer thickness. If the output parameter should be decreased to increase the efficiency of the final device as is the case for the series resistance (Supplementary Fig. 3), a parameter with a positive effect should be set to its low value to decrease the series resistance.

To evaluate the significance of each effect, we computed the pure error, PE, from the variance, Vcp, of the results for the three centre-point experiments.

$${\rm{PE}}=\sqrt{\frac{4{V}_{{\rm{cp}}}}{n}}$$

where n is the number of experiments excluding the centre points (for this DoE, n = 16). PE is then multiplied with the t value of Student’s distribution with the confidence level α and the degrees of freedom, d.f. (for this DoE, 2)

$${\rm{Threshold}}={\rm{PE}}\times t\left(\frac{\alpha +1}{2},{\rm{d.f.}}\right)$$

The threshold is marked by a dashed line in the Supplementary Figs. 25 to visualize whether an effect is significant or not. If an effect lays within the grey area not exceeding the threshold, the effect has no significant influence on the result of the experiment.

### Characterization of passivation quality

The passivation quality of the layer was tested on symmetric samples and solar cells before ITO deposition by measuring the photo-conductance of the wafer using a Sinton WCT-120 lifetime tester. From these measurements, the implied open-circuit voltage (iVoc) at one sun, the saturation current density (J0) at an excess charge carrier density of 5 × 1015 cm−3 and the effective minority charge carrier lifetime (τeff) at a charge carrier density of 1 × 1015 cm−3 were extracted47,48.

### SIMS measurement

The SIMS (time-of-flight-SIMS IV by IONTOF) measurement was conducted to analyse the interface properties of the nc-SiC:H(n)/SiO2/c-Si(n) stack, to investigate the correlation between passivation quality and filament temperature. An area of 300 × 300 μm2 was sputtered (using a 1 keV Cs ion beam), and an area of approximately 80 × 80 μm2 was measured (using a 30 keV Bi1 ion beam).

### STEM and energy dispersive X-ray measurements

The high-resolution bright-field STEM images were obtained with a probe aberration corrected Hitach HF5000 microscope. EDX mapping of the O-K edge, Si-L edge and C-K edge were obtained at the aberration corrected FEI Titan G2 80-200 microscope equipped with a four-quadrant EDX detector. The sample for STEM measurement and EDX mapping was prepared from the same batch of double nc-SiC:H(n) layer stack as that for SIMS measurement.

### UV photoelectron spectroscopy (UPS) measurement

The UPS system is a MULTIPROBE MXPS system from Scienta Omicron with an ARGUS hemispherical electron spectrometer and part of the JOSEPH cluster system in the Research Center Jülich. The light source for UPS measurements is a HIS13 HeI gas discharge vacuum UV source from FOCUS (main line HeIα 21.22 eV). Spectra are collected with a path energy of 2 eV, a digital resolution of 0.01 eV and a sample bias of 6 V at a takeoff angle of 0°. Since we suspected the absolute positions of the spectral features were influenced by sample charging, we only determined the ionization energy Ei from the distance of the cutoff at low kinetic energies and the valence band edge at high kinetic energies by linear fits to the spectrum. The measurements were averaged over four positions on the sample.

### Characterization of contact resistivity and IV characteristics

The contact resistivity (ρc) was measured on an in-house setup using the TLM. The contact resistivity was evaluated for the complete front side layer stack of c-Si(n)/TPC/ITO/Ag. The efficiency, the fill factor, the open-circuit voltage and the short-circuit current density were measured by IV measurements under standard test conditions using the LOANA system from pv-tools. The series resistance was derived from JscVoc measurement49.

For the UV degradation experiment, different UV filters were used to find the energy range in which the light has the ability to degrade the surface passivation. Therefore, the three filters had different transmission properties for the light. The transmission properties are summarized in Supplementary Table 2. For the experiment with oxygen plasma (Supplementary Fig. 14c), a thicker filter (5 mm) was used as compared to the ITO sputter experiment (Supplementary Fig. 14d). Thus, the thinner filter has a higher typical transmission.

### Photoluminescence measurement

The lifetime-corrected photoluminescence images were taken using a Xenics Cheetah 640-CL InGaAs camera cooled to 0 °C. To obtain a lifetime-corrected photoluminescence image, four images have to be taken during one illumination cycle. The method to calculate the lifetime-photoluminescence image from the four photoluminescence images taken during one illumination cycle is described in literature50,51. The lifetime-photoluminescence image is corrected afterwards for the effective minority charge carrier lifetime measured by photo-conductance. A general description of the underlying physical principles of photoluminescence is described elsewhere52.

### Simulations

Electrical simulations based on the optimized TPC solar cells were performed using TCAD Sentaurus with parameters of c-Si(n) and amorphous layers as reported in ref. 43. The simulations used measured electronic parameters of our conductive and passivating nc-SiC:H(n) layers. More details of the parameters can be found in the Supplementary Information (Supplementary Discussion 2 and Supplementary Tables 3 and 4). Optical simulations based on the optimized TPC solar cells were performed using GenPro4 (ref. 37). The simulations were based on double-side textured interfaces with layers’ measured thicknesses and complex refractive indices. More details of the parameters can be found in the Supplementary Information (Supplementary Table 5 and Supplementary Fig. 21).

### Reporting Summary

Further information on research design is available in the Nature Research Reporting Summary linked to this article.

## Data availability

All data generated or analysed during this study are included in the published article and its Supplementary Information. Source data are provided with this paper.

## References

1. 1.

Min, B. et al. A roadmap toward 24% efficient PERC solar cells in industrial mass production. IEEE J. Photovolt. 7, 1541–1550 (2017).

2. 2.

Wakisaka, K. et al. More than 16% solar cells with a new ‘HIT’ (doped a-Si/nondoped a-Si/crystalline Si) structure. In Proc. Conference Record of the Twenty-Second IEEE Photovoltaic Specialists Conference 887–892 (IEEE, 1991); https://doi.org/10.1109/PVSC.1991.169337

3. 3.

Tanaka, M. et al. Development of a new heterojunction structure (ACJ-HIT) and its application to polycrystalline silicon solar cells. Prog. Photovolt. Res. Appl. 1, 85–92 (1993).

4. 4.

Masuko, K. et al. Achievement of more than 25% conversion efficiency with crystalline silicon heterojunction solar cell. IEEE J. Photovolt. 4, 1433–1435 (2014).

5. 5.

Peibst, R. et al. Working principle of carrier selective poly-Si/c-Si junctions: is tunnelling the whole story? Sol. Energy Mater. Sol. Cells 158, 60–67 (2016).

6. 6.

Feldmann, F., Bivour, M., Reichel, C., Hermle, M. & Glunz, S. W. Passivated rear contacts for high-efficiency n-type Si solar cells providing high interface passivation quality and excellent transport characteristics. Sol. Energy Mater. Sol. Cells 120, 270–274 (2014).

7. 7.

Battaglia, C. et al. Hole selective MoOx contact for silicon solar cells. Nano Lett. 14, 967–971 (2014).

8. 8.

Geissbühler, J. et al. 22.5% efficient silicon heterojunction solar cell with molybdenum oxide hole collector. Appl. Phys. Lett. 107, 081601 (2015).

9. 9.

Bullock, J. et al. Efficient silicon solar cells with dopant-free asymmetric heterocontacts. Nat. Energy 1, 15031 (2016).

10. 10.

Yang, X. et al. Dual-function electron-conductive, hole-blocking titanium nitride contacts for efficient silicon solar cells. Joule 3, 1314–1327 (2019).

11. 11.

Dréon, J. et al. 23.5%-efficient silicon heterojunction silicon solar cell using molybdenum oxide as hole-selective contact. Nano Energy 70, 104495 (2020).

12. 12.

Feldmann, F., Nicolai, M., Müller, R., Reichel, C. & Hermle, M. Optical and electrical characterization of poly-Si/SiOx contacts and their implications on solar cell design. Energy Procedia 124, 31–37 (2017).

13. 13.

Köhler, M. et al. Development of a transparent passivated contact as a front side contact for silicon heterojunction solar cells. In Proc. 2018 IEEE 7th World Conference on Photovoltaic Energy Conversion (WCPEC) 3468–3472 (IEEE, 2018); https://doi.org/10.1109/PVSC.2018.8548008

14. 14.

Köhler, M. et al. Optimization of transparent passivating contact for crystalline silicon solar cells. IEEE J. Photovolt. 10, 46–53 (2020).

15. 15.

Pomaska, M. Microcrystalline Silicon Carbide for Silicon Heterojunction Solar Cells. PhD thesis, RWTH Aachen Univ. (2017).

16. 16.

Umemoto, H. et al. Direct detection of H atoms in the catalytic chemical vapor deposition of the SiH4/H2 system. J. Appl. Phys. 91, 1650–1656 (2002).

17. 17.

Irikawa, J., Miyajima, S., Watahiki, T. & Konagai, M. High efficiency hydrogenated nanocrystalline cubic silicon carbide/crystalline silicon heterojunction solar cells using an optimized buffer layer. Appl. Phys. Express 4, 092301 (2011).

18. 18.

Pomaska, M., Beyer, W., Neumann, E., Finger, F. & Ding, K. Impact of microcrystalline silicon carbide growth using hot-wire chemical vapor deposition on crystalline silicon surface passivation. Thin Solid Films 595, 217–220 (2015).

19. 19.

Ingenito, A. et al. A passivating contact for silicon solar cells formed during a single firing thermal annealing. Nat. Energy 3, 800–808 (2018).

20. 20.

Qiu, K. et al. Development of conductive SiCx:H as a new hydrogenation technique for tunnel oxide passivating contacts. ACS Appl. Mater. Interfaces 12, acsami.0c06637 (2020).

21. 21.

Liu, W. et al. Polysilicon passivating contacts for silicon solar cells: interface passivation and carrier transport mechanism. ACS Appl. Energy Mater. 2, 4609–4617 (2019).

22. 22.

Glunz, S. W. & Feldmann, F. SiO2 surface passivation layers—a key technology for silicon solar cells. Sol. Energy Mater. Sol. Cells 185, 260–269 (2018).

23. 23.

Cuevas, A. et al. Carrier population control and surface passivation in solar cells. Sol. Energy Mater. Sol. Cells 184, 38–47 (2018).

24. 24.

Procel, P., Yang, G., Isabella, O. & Zeman, M. Theoretical evaluation of contact stack for high efficiency IBC-SHJ solar cells. Sol. Energy Mater. Sol. Cells 186, 66–77 (2018).

25. 25.

Procel, P., Yang, G., Isabella, O. & Zeman, M. Numerical simulations of IBC solar cells based on poly-Si carrier-selective passivating contacts. IEEE J. Photovolt. 9, 374–384 (2019).

26. 26.

Pomaska, M. et al. Role of oxygen and nitrogen in n-type microcrystalline silicon carbide grown by hot wire chemical vapor deposition. J. Appl. Phys. 120, 225105 (2016).

27. 27.

Demaurex, B., De Wolf, S., Descoeudres, A., Charles Holman, Z. & Ballif, C. Damage at hydrogenated amorphous/crystalline silicon interfaces by indium tin oxide overlayer sputtering. Appl. Phys. Lett. 101, 171604 (2012).

28. 28.

Morales-Vilches, A. B. et al. ZnO:Al/a-SiOx front contact for polycrystalline-silicon-on-oxide (POLO) solar cells. In Proc. 8th International Conference on Crystalline Silicon Photovoltaics 040016 (2018); https://doi.org/10.1063/1.5049279

29. 29.

Tutsch, L. et al. Implementing transparent conducting oxides by DC sputtering on ultrathin SiOx/poly-Si passivating contacts. Sol. Energy Mater. Sol. Cells 200, 109960 (2019).

30. 30.

Illiberi, A., Kudlacek, P., Smets, A. H. M., Creatore, M. & van de Sanden, M. C. M. Effect of ion bombardment on the a-Si:H based surface passivation of c-Si surfaces. Appl. Phys. Lett. 98, 242115 (2011).

31. 31.

Profijt, H. B., Kudlacek, P., van de Sanden, M. C. M. & Kessels, W. M. M. Ion and photon surface interaction during remote plasma ALD of metal oxides. J. Electrochem. Soc. 158, G88–G91 (2011).

32. 32.

Reed, M. L. & Plummer, J. D. Chemistry of Si–SiO2 interface trap annealing. J. Appl. Phys. 63, 5776–5793 (1988).

33. 33.

Mazzarella, L. et al. p-type microcrystalline silicon oxide emitter for silicon heterojunction solar cells allowing current densities above 40 mA/cm2. Appl. Phys. Lett. 106, 023902 (2015).

34. 34.

Herasimenka, S. Y., Dauksher, W. J., Boccard, M. & Bowden, S. ITO/SiOx:H stacks for silicon heterojunction solar cells. Sol. Energy Mater. Sol. Cells 158, 98–101 (2016).

35. 35.

Adachi, D., Hernández, J. L. & Yamamoto, K. Impact of carrier recombination on fill factor for large area heterojunction crystalline silicon solar cell with 25.1% efficiency. Appl. Phys. Lett. 107, 233506 (2015).

36. 36.

Hernández, J. L. et al. High efficiency silver-free heterojunction silicon solar cell. Jpn. J. Appl. Phys. 51, 10NA04 (2012).

37. 37.

Santbergen, R. et al. GenPro4 optical model for solar cell simulation and its application to multijunction solar cells. IEEE J. Photovolt. 7, 919–926 (2017).

38. 38.

Huang, Y. et al. Preparation of microcrystalline silicon solar cells on microcrystalline silicon carbide window layers grown with HWCVD at low temperature. J. Non Cryst. Solids 354, 2430–2434 (2008).

39. 39.

Zhang, D. et al. Design and fabrication of a SiOx/ITO double-layer anti-reflective coating for heterojunction silicon solar cells. Sol. Energy Mater. Sol. Cells 117, 132–138 (2013).

40. 40.

Santbergen, R. et al. Minimizing optical losses in monolithic perovskite/c-Si tandem solar cells with a flat top cell. Opt. Express 24, A1288 (2016).

41. 41.

Richter, A., Hermle, M. & Glunz, S. W. Reassessment of the limiting efficiency for crystalline silicon solar cells. IEEE J. Photovolt. 3, 1184–1191 (2013).

42. 42.

Khanna, A. et al. A fill factor loss analysis method for silicon wafer solar cells. IEEE J. Photovolt. 3, 1170–1177 (2013).

43. 43.

Procel, P. et al. The role of heterointerfaces and subgap energy states on transport mechanisms in silicon heterojunction solar cells. Prog. Photovolt. Res. Appl. 28, 935–945 (2020).

44. 44.

Römer, U. et al. Recombination behavior and contact resistance of n+ and p+ poly-crystalline Si/mono-crystalline Si junctions. Sol. Energy Mater. Sol. Cells 131, 85–91 (2014).

45. 45.

Kern, W. The evolution of silicon wafer cleaning technology. J. Electrochem. Soc. 137, 1887–1892 (1990).

46. 46.

Köhler, M. et al. Wet-chemical preparation of silicon tunnel oxides for transparent passivated contacts in crystalline silicon solar cells. ACS Appl. Mater. Interfaces 10, 14259–14263 (2018).

47. 47.

Sinton, R. A., Cuevas, A. & Stuckings, M. Quasi-steady-state photoconductance, a new method for solar cell material and device characterization. In Proc. Conference Record of the Twenty Fifth IEEE Photovoltaic Specialists Conference 457–460 (IEEE, 1996); https://doi.org/10.1109/PVSC.1996.564042

48. 48.

Kimmerle, A., Rothhardt, P., Wolf, A. & Sinton, R. A. Increased reliability for J0-analysis by QSSPC. Energy Procedia 55, 101–106 (2014).

49. 49.

Aberle, A. G., Wenham, S. R. & Green, M. A. Series resistance of solar cells. In Proc. Photovoltaic Specialists Conference 133–139 (IEEE, 1993).

50. 50.

Ramspeck, K., Reissenweber, S., Schmidt, J., Bothe, K. & Brendel, R. Dynamic carrier lifetime imaging of silicon wafers using an infrared-camera-based approach. Appl. Phys. Lett. 93, 102104 (2008).

51. 51.

Herlufsen, S. et al. Dynamic photoluminescence lifetime imaging for the characterisation of silicon wafers. Phys. Status Solidi - Rapid Res. Lett. 5, 25–27 (2011).

52. 52.

Rau, U. Superposition and reciprocity in the electroluminescence and photoluminescence of solar cells. IEEE J. Photovolt. 2, 169–172 (2012).

53. 53.

Green, M. A. Self-consistent optical parameters of intrinsic silicon at 300K including temperature coefficients. Sol. Energy Mater. Sol. Cells 92, 1305–1310 (2008).

## Acknowledgements

This research was supported through the funding of the German Federal Ministry of Economic Affairs and Energy in the framework of the TUKAN project (grant no. 0324198D) and the funding within the Helmholtz Energy Materials Foundry project. K.Q. thanks the financial support by the China and Germany Postdoctoral Exchange Program 2018 from the Office of China Postdoctoral Council and the Helmholtz Centre and the National Natural Science Foundation of China (grant no. 61774173). A.Z. acknowledges the financial support from the German Academic Exchange Service (DAAD) and the Ministry of Science and Higher Education of the Russian Federation, project no. 3.13378.2019/13.2. We also thank the Initiative and Networking Fund of the Helmholtz Association for funding of the JOSEPH cluster system via the Helmholtz Energy Materials Characterization Platform. We thank J. Wolff, A. Schmalen and S. Schiffer for providing high-quality deposition equipment and know-how for HWCVD. Furthermore, we thank K. Bittkau, O. Thimm, A. Doumit, I. Caspers, A. Mück, S. Lynen, H. Siekmann, H. Gattermann, V. Lauterbach, K. Wambach, U. Breuer and B. Zwaygardt for photothermal deflection spectroscopy measurement, SIMS measurements, laser cutting and cleaning of the wafers, as well as depositions of a-Si:H, ITO and metallization. Finally, we thank H. Gattermann for the proofreading.

## Author information

Authors

### Contributions

M.K., M.P. and K.Q. designed the experiments. M.K. carried out the layer and device fabrication and characterization including use of the ellipsometer, quasi-steady-state-photoconductance, transfer line method, photoluminescence, transmittance and reflectance, current–voltage and quantum efficiency. A.Z. contributed to the SiC deposition. A.L. and W.D. contributed to the a-Si:H, ITO and MgF2 deposition and optimization, and optical properties measurements. B.M. contributed to TCO optimization. S.L., K.Q. and M.P. contributed to screen printing. A.Z and A.E. developed the curing of MgF2. A.E. performed the SIMS measurements. P.C. and M.L. performed HRSTEM measurements and EDX mapping. B.K. performed UPS measurements. P.P., R.S. and O.I. executed the TCAD and GenPro4 simulation. M.K., M.P., K.Q., F.F., T.K., U.R. and K.D. contributed to the definition and presentation of the paper content. M.K., M.P., K.Q. and K.D. organized the research. M.P., F.F., U.R., K.D. and M.K. developed the concept of TPC by specific layer stack. M.K., K.Q., T.K. and U.R. wrote the paper, and all other authors discussed the results and proofread the paper.

### Corresponding authors

Correspondence to Malte Köhler or Manuel Pomaska or Kaifu Qiu or Kaining Ding.

## Ethics declarations

### Competing interests

The authors declare no competing interests.

Peer review information Nature Energy thanks the anonymous reviewers for their contribution to the peer review of this work.

Publisher’s note Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

## Supplementary information

### Supplementary Information

Supplementary Notes 1 and 2, Tables 1–5, Discussions 1–4, Figs. 1–21 and references.

## Rights and permissions

Reprints and Permissions

Köhler, M., Pomaska, M., Procel, P. et al. A silicon carbide-based highly transparent passivating contact for crystalline silicon solar cells approaching efficiencies of 24%. Nat Energy 6, 529–537 (2021). https://doi.org/10.1038/s41560-021-00806-9

• Accepted:

• Published:

• Issue Date:


text:
<meta http-equiv="refresh" content="1; url=/nojavascript/"> Inequalities with Addition and Subtraction ( Read ) | Algebra | CK-12 Foundation
You are viewing an older version of this Concept. Go to the latest version.

# Inequalities with Addition and Subtraction

%
Best Score
Practice Inequalities with Addition and Subtraction
Best Score
%
Solve Inequalities Using Addition or Subtraction
0  0  0

The students at Floyd Middle School have been working hard fundraising. They sold popcorn, had a bake sale and a car wash. Finally with the time for purchasing band uniforms rapidly approaching, Mrs. Kline gathered the whole band together one afternoon to discuss their profit.

“We did very well,” she started. “We raised a total of $12,000 and we had$1,000 in our account, so we have $13,000 to spend on our uniforms. I know that may seem like a lot of money, but uniforms are expensive. We are only going to be able to purchase new jackets for everyone. If we have any money left over, we’ll buy new fingerless gloves because some of the ones we’re using look awful.” “Mrs. Kline, did you already pick the design of the jacket?” Kayla asked from the second row. “Yes. It was one of the ones we voted on last year,” she said holding up a picture of the shiny, new navy jacket. “Now I need a few people to figure out the cost and if we have enough for the gloves too.” Kayla and Juan volunteered to work on the arithmetic. Here is the information Mrs. Kline gave them. The jackets each cost$99.95.

The total budget is $13,000. There are 144 students in the band. “We will need to spend$11,512.80 on the jackets,” Kayla said to Juan.

“Wow, that’s a lot of money. How much can we spend on the gloves?”

That is a great question. It is one that can be answered by writing an inequality. The students need their total to be equal to or less than $13,000. In this Concept, you will learn how to work with inequalities that have addition and/or subtraction in them. Then you will use what you have learned to help Kayla and Juan with the band uniforms. ### Guidance Sometimes, you will have an inequality that is not as straightforward as $x>4$ . With this example, we know that the variable will be equal to any number that is greater than four. This is quite easy to work with and we can write a set of numbers to make this inequality a true statement. What if it isn’t that simple? Sometimes, you will see an inequality like this one. $x+3>7$ Here we need to figure out the set of numbers that will make this a true statement. We are looking for a number that when added to three is greater than seven. To figure this out, we will need to solve this inequality. Solving an inequality is similar to solving an equation. Here are some number properties that can help you solve inequalities. The addition property of inequality states that if the same number is added to each side of an inequality, the sense of the inequality stays the same. In other words, the inequality symbol does not change. If $a>b$ , then $a+c>b+c$ . If $a \ge b$ , then $a+c \ge b+c$ . If $a , then $a+c . If $a \le b$ , then $a+c \le b+c$ . What about subtraction? Remember, subtracting a number, $c$ , is the same as adding its opposite, $-c$ . So, the addition property of inequality applies to subtraction as well. We can also state this as it’s own property. The subtraction property of inequality states that if the same number is subtracted from each side of an inequality, the sense of the inequality stays the same. In other words, the inequality symbol does not change. If $a>b$ , then $a-c > b-c$ . If $a \ge b$ , then $a-c \ge b-c$ . If $a , then $a-c < b-c$ . If $a \le b$ , then $a-c \le b-c$ . Applying these properties makes our work quite simple. You can think of solving inequalities in the same way that you thought of solving equations. The big difference is that your answer will be a set of numbers and not a single number. Just like with equations, you need to be sure that your answer makes the mathematical statement true. If it doesn’t, then you need to rethink your answer. Now let’s look at solving inequalities. Solve this inequality and graph its solution: $n-3<5$ . Solve the inequality as you would solve an equation, by using inverse operations. Since the 3 is subtracted from $n$ , add 3 to both sides of the inequality to solve it. Since you are adding the same number to both sides of the inequality, the addition property of inequality applies. According to that property, we know that the inequality symbol should stay the same when we add the same number, 3, to both sides of the inequality. Think back! To solve inequalities, you may need to remember how to add and subtract integers. Pay attention to the sign when you work with these values. $n-3 &< 5\\n-3+3 &< 5+3\\n+(-3+3) &< 8\\n+0 &< 8\\n &< 8$ Now, graph the solution. The inequality $n<8$ is read as “ $n$ is less than 8.” So, the solution set for this inequality includes all numbers that are less than 8, but it does not include 8. Draw a number line from 0 to 10. Add an open circle at 8 to show that 7 is not a solution for this inequality. Then draw an arrow showing all numbers less than 8. Solve this inequality and graph its solution: $-2 \le x+4$ Use inverse operations to isolate the variable. Since the 4 is added to $x$ , subtract 4 from both sides of the inequality to solve it. Since you are subtracting the same number from both sides of the inequality, the subtraction property of inequality applies. According to that property, the inequality symbol should stay the same when we subtract the same number, 4, from both sides of the inequality. $-2 & \le x+4\\-2-4 & \le x+4-4\\-2+(-4) &\le x+0\\-6 & \le x$ Now, we should graph the solution. However, before we can do that, we need to rewrite the inequality so the variable is listed first. The inequality $-6 \le x$ is read as “-6 is less than or equal to $x$ .” If we list the $x$ first, we must reverse the inequality symbol. That means changing the “less than or equal to” symbol $(\le)$ to a “less than or equal to symbol” $(\ge)$ . So, $-6 \le x$ equivalent to $x \ge -6$ . This makes sense. If -6 is less than or equal to $x$ , then $x$ must be greater than or equal to -6. The inequality $x \ge -6$ is read as “ $x$ is greater than or equal to -6.” So, the solutions of this inequality include -6 and all numbers that are greater than -6. Draw a number line from -10 to 0. Add a closed circle at -6 to show that -6 is a solution for this inequality. Then draw an arrow showing all numbers greater than -6. #### Example A $x+5<-12$ Solution: $x<-17$ #### Example B $y-8\le5$ Solution: $y\le13$ #### Example C $a-5\ge22$ Solution: $a\ge27$ Now let's go back to the dilemma at the beginning of the Concept. First, we write an inequality to represent the uniform cost, unknown cost of gloves, and the total budget for everything. The total of the uniforms and gloves must be less than or equal to the total budget. $\ 11,512 = \text{cost of uniforms}$ $x = \text{budget for gloves}$ $\le$$13,000

Here is the inequality.

$11,512 + x \le 13,000$

We solve the inequality by using inverse operations.

$x &\le 13,000 - 11,512\\x & \le \1487.20$

The students will have a maximum budget of $1487.20 to spend on the gloves. ### Vocabulary Equation a mathematical statement using an equals sign where the quantity on one side of the equals is the same as the quantity on the other side. Inequality a mathematical statement where the value on one side of an inequality symbol can be less than, greater than and sometimes also equal to the quantity on the other side. The key is that the quantities are not necessarily equal. Addition Property of Inequality You can add a quantity to both sides of an inequality and it does not change the sense of the inequality. Subtraction Property of Inequality You can subtract a quantity from both sides of an inequality and it does not change the sense of the inequality. ### Guided Practice Here is one for you to try on your own. At the store, Talia bought one item—a$4.99 bottle of shampoo. Let $d$ represent the amount in dollars that she handed the clerk. She received more than $5 in change. a. Write an inequality to represent $d$ , the number of dollars Talia handed the clerk to pay for the shampoo. b. List three possible values of $d$ . Solution Consider part a first. Use a number, an operation sign, a variable, or an inequality symbol to represent each part of the problem. The fact that this problem involves “change” may help you see that you should write a subtraction expression to represent the first part of this problem. To represent how much change Talia received, you will need to subtract the cost of the shampoo from the amount she handed the clerk. The key words “more than”, in this case, indicate that you should use a $>$ symbol. Use this information to write an inequality for this problem. $& (\text{dollars handed to the clerk}) - (\text{cost of \4.99 bottle of shampoo}) > (\text{\5 in change})\\& \qquad \qquad \qquad \downarrow \qquad \qquad \qquad \downarrow \qquad \qquad \qquad \qquad \downarrow \qquad \qquad \qquad \quad \downarrow \qquad \quad \downarrow\\& \qquad \qquad \qquad d \qquad \qquad \qquad - \qquad \qquad \qquad \quad 4.99 \qquad \qquad \qquad > \quad \quad \ \ 5$ So, this problem can be represented by the inequality $d-4.99 > 5$ . Next, consider part b . Solve the inequality to help you find three possible values for $d$ . To solve this inequality, add 4.99 to both sides. Do not change the inequality symbol. $d-4.99 & > 5\\d - 4.99+4.99 &> 5+4.99\\d+(-4.99+4.99) &> 5.00+4.99\\d+0 &> 9.99\\d &> 9.99$ According to the inequality above, the amount Talia handed the clerk was more than$9.99.

So, three possible values of $d$ are $10.00,$10.99, and $20.00. These are only 3 possible answers. You could choose any amount that is greater than$9.99.

### Practice

Directions: Solve the following inequalities.

1. $x+4>10$
2. $y-11<20$
3. $a+2<1$
4. $b+3 \ge 5$
5. $y-2 \le -4$
6. $x+1 \ge -5$
7. $x-3<11$
8. $x-4>-3$
9. $y+7>22$
10. $a-6\ge-1$
11. $b+14>20$
12. $x-24>-11$
13. $a+3\le-9$
14. $x-12>1$
15. $y+13>-33$

format: plain


text:
# Python writing to Excel file: writerow() takes no keyword arguments

I have this script:

    import requests
from requests import get
from bs4 import BeautifulSoup
import csv
import pandas as pd

f = open('olanda.csv', 'wb')
writer = csv.writer(f)

url = ('https://www......')
response = get(url)
soup = BeautifulSoup(response.text, 'html.parser')
type(soup)

table = soup.find('table', id='tablepress-94').text.strip()

print(table)

writer.writerow(table.split(), delimiter = ',')

f.close()

When it writes to a CSV file it writes everything in a single cell like that:

Sno.,CompanyLocation,1KarifyNetherlands,2Umenz,Benelux,BVNetherlands,3TovertafelNetherlands,4Behandeling,BegrepenNetherlands,5MEXTRANetherlands,6Sleep.aiNetherlands,7OWiseNetherlands,8Healthy,WorkersNetherlands,9&thijs,|,thuis,in,jouw,situatieNetherlands,10HerculesNetherlands, etc.

I wanted to have the output in a single column and each value (separated by comma) in a single row.

I tried to use delimiter = ',' but I got:

TypeError: a bytes-like object is required, not 'str'.

Screesnhot of table:

How can I do this? Thanks!

delimiter param is used when instantiating the writer, not on writerow method.

Furthermore from what I understand, your approach is wrong. For example you want to scrape the html table and store it as csv file.

But what you do is get the text from table

table = soup.find('table', id='tablepress-94').text.strip()

which is a concatenated string of all columns with no structure and try to split by nothing, which is wrong

while you should be getting a dict of table values, eg using:

table = soup.find('table', id='tablepress-94')
# assuming table has a
data = {}
row_index = 0
for row in table.find('tbody').find_all('tr'):
row_index += 1
column_index = 0
columns = row.find_all('td')
for td in columns:
column_index += 1

print(data)
# now output your scarped table data, data into csv properly

• @Steven, please print(column_headers) to make sure they are extracted correctcly or are indeed there and let me know. Possibly you have to adjust the code the correctly extract the table headers if you know the table structure and have some understandfing of html and soup – Nikos M. Jul 27 '20 at 20:34


text:
0
TECHNICAL PAPERS

# Slip Factor for Centrifugal Impellers Under Single and Two-Phase Flow Conditions

[+] Author and Article Information

Laboratorio de Conversión de Energía Mecánica,  Universidad Simón Bolívar, Caracas, Venezuela

J. Fluids Eng 127(2), 317-321 (Oct 12, 2004) (5 pages) doi:10.1115/1.1891153 History: Received February 18, 2004; Revised October 12, 2004

## Abstract

Throughout the history of turbomachines investigators have tried to develop reliable methods for prediction of centrifugal pump behavior. Among the parameters available to estimate the performance of this kind of machine is the slip factor. In spite of being regarded as a variable of great significance in the analysis of turbomachinery, there seem to be a misconception regarding its concept and application. Indeed, empirical correlations have been widely used to estimate the slip factor, even in the case of two-phase flow applications, where it has not been investigated. Moreover, these correlations provide a constant value of the slip factor for a given impeller only at the best efficiency point, which is an important restriction to the pump performance prediction, considering that slip factor varies with the pump flow rate. In this study, three-dimensional computational fluid dynamics simulations were carried out on an impeller of known geometry $(NS=1960)$ from which values of slip factor were calculated for both single- and two-phase flow (water and water-air). These results include curves of the slip factor as a function of the specific capacity and the gas-void fraction. Additionally, results for the slip factor in the case of single-phase flow (water) are given for various centrifugal impellers ($NS=1157$, 1447, 1612, and 3513) in order to illustrate the influence of the flow rate on this parameter. Finally, based on the numerical results, a methodology for prediction of the pump head is presented. Excellent agreement with experimental results has been found. This paper attempts to contribute to a better understanding of the fluid dynamics within centrifugal pump impellers and to shed more light on the path that prediction models should follow in the future.

<>

## Figures

Figure 1

Impeller discharge velocity diagrams

Figure 2

Slip factor for different GVF as a function of the specific capacity (NS=1960)

Figure 3

Theoretical head for different GVF as a function of the specific capacity (NS=1960)

Figure 4

Slip factor for different specific speeds as a function of the specific capacity

Figure 5

Hydraulic losses of the impeller for different GVF as a function of the specific capacity

Figure 6

Hydraulic losses of the diffuser for different GVF as a function of the specific capacity

Figure 7

Comparison between numerical simulations and experimental results for different gas-void fractions (NS=1960)

Figure 8

Comparison between numerical simulations and experimental results for different gas-void fractions (NS=1960)

Figure 9

Comparison between numerical simulations and experimental results for different gas-void fractions (NS=1960)

## Discussions

Some tools below are only available to our subscribers or users with an online account.

### Related Content

Customize your page view by dragging and repositioning the boxes below.

Related Journal Articles
Related Proceedings Articles
Related eBook Content
Topic Collections


text:
{{ message }}
Switch branches/tags
Nothing to show
Christian Versloot
0 contributors

### Users who have contributed to this file

204 lines (112 sloc) 13.6 KB
title date categories tags
He/Xavier initialization & activation functions: choose wisely
2019-09-16
 buffer deep-learning
 activation-functions deep-learning initializers neural-networks weight-initialization

Deep learning models require to be initialized. Their layers have activation functions to make neuron outputs nonlinear. But how to initialize? And how to choose an activation function? We covered those questions in different blogs. Today, we'll cover a different topic:

The intrinsic relationship between the Xavier and He initializers and certain activation functions.

You're right, we focus on a niche within the overlap between weight initialization and activation functions - and cover how Xavier and He initializers require one to choose certain activation functions over others, and vice-versa.

However, if you're interested in the other topics, feel free to also read these blogs:

• The basics of weight initialization.
• Why choosing an initializer depends on your choice for activation functions.
• How He and Xavier initialization must be applied differently.

Update 05/Feb/2021: ensured that article is up to date.

Update 07/Oct/2020: clarified the meaning of $N$ in the initialization strategies.

[toc]

## Recap: the ingredients of this blog

Before I can make my point with respect to the He and Xavier initializers and their relationships to activation functions, we must take a look at the individual ingredients of this blog first. With those, I mean weight initialization and activation functions. We'll briefly cover these next and also provide links to blogs that cover them in more detail.

Subsequently, we move on to He and Xavier initialization and our final point. However, if you're well aware of initializers and activation functions, feel free to skip this section altogether. It must be all very familiar to you.

### What is initialization?

Neural networks are collections of neurons - that's nothing strange.

But how do neurons operate?

By producing an operation called a dot product between a weights vector and an input vector. A bias value is added to this product and the whole is subsequently passed to an activation function.

Since all neurons do this, a system emerges that can adapt to highly complex data.

During optimization, which occurs every time data is fed to the network (either after each sample or after all of them, or somewhere in between), the weights vectors are slightly adapted to simply better cover the patterns represented by the training set.

However, you'll need to start somewhere - the weights vectors cannot be empty once you start training. Hence, they must be initialized. That's weight initialization.

#### Initializers

Weight initialization is performed by means of an initializer. There are many ways of initializing your neural network, of which some are better - or, more nicely, less naïve - than others. For example, you may choose to initialize your weights as zeros, but then your model won't improve.

Additionally, you may also choose to initialize them randomly. We then get somewhere, but face the vanishing and exploding gradient problems.

If you wish to understand more about initializers, click the link above 👆

When you initialize your weights randomly, the values are probably close to zero given the probability distributions with which they are initialized. Since optimization essentially chains the optimizations in the 'downstream' layers (i.e., the ones closer to the output) when calculating the weights improvement in the 'upstream' ones (e.g., the one you're currently trying to optimize), you'll face either two things:

• When your weights and hence your gradients are close to zero, the gradients in your upstream layers vanish because you're multiplying small values and e.g. 0.1 x 0.1 x 0.1 x 0.1 = 0.0001. Hence, it's going to be difficult to find an optimum, since your upstream layers learn slowly.
• The opposite can also happen. When your weights and hence gradients are > 1, multiplications become really strong. 10 x 10 x 10 x 10 = 1000. The gradients may therefore also explode, causing number overflows in your upstream layers, rendering them untrainable (even dying off the neurons in those layers).

In both cases, your model will never reach its theoretical optimum. We'll see that He and Xavier initializers will substantially safeguard yourself from the vanishing and exploding gradients problems. However, let's briefly recap on activation functions first.

Random initialization: vanishing and exploding gradients

### What are activation functions?

As we saw in the recap on weight initialization, neural networks are essentially a system of individual neurons, which produce outputs given an input (being the input vector).

If we don't add activation functions, we find our network to behave poorly: it simply does not converge well to your real-world data.

Why is that the case?

The operation, without the activation function, is linear: you simply multiply values and add a bias value. That's some linear operations.

Hence, without the activation function, your model will behave as if it is linear. That, we don't want, because real world data is pretty much always nonlinear.

Therefore, activation functions enter the playing field.

An activation is a mathematical function that simply takes an input which may or may not be linear (it just takes any real valued number) and converts it into another real valued number. Since the function itself behaves nonlinearly, the neural network will behave as such too. We can now handle much more complex data. Great!

#### ReLU, Sigmoid and Tanh

In today's world, there are three widely used activation functions: Rectified Linear Unit (ReLU), Sigmoid and Tanh. ReLU is most widely used because it is an improvement over Sigmoid and Tanh. Nevertheless, improvement is still possible, as we can see by clicking the link below 👇

Read more about activation functions here: ReLU, Sigmoid and Tanh: today’s most used activation functions

## He and Xavier initialization against gradient issues

In his paper On weight initialization in deep neural networks, Siddharth Krishna Kumar identifies mathematically what the problem is with vanishing and exploding gradients and why He and Xavier (or Glorot) initialization do work against this problem.

He argues as follows:

Deep neural networks face the difficulty that variance of the layer outputs gets lower the more upstream the data you go.

The problem with this is what we've seen in our post about vanishing gradients: slow model convergence.

The problem with this is what we've seen in our post about vanishing gradients: slow model convergence.

In Why are deep neural networks hard to train?, the author of the Neural Networks and Deep Learning website helps us illustrate Kumar's point by means of the Sigmoid activation function.

Suppose that your neural networks are equipped with the Sigmoid activation function. The neuron outputs will flow through this function to become nonlinear, and the Sigmoid derivative will be used during optimization:

Sigmoid and its derivative

As you can see, there are two problems with the Sigmoid function and its behavior during optimization:

• When variance is really high, the absolute value of the gradient will be low and the network will learn very slowly;
• When variance is really low, the gradient will move in a very small range, and hence the network will also learn very slowly.

This especially occurs when weights are drawn from a standard normal distribution, since weights will also be < 1 and > -1.

Kumar argued that it's best to have variances of ≈ 1 through all layers. This way, slow learning can be mitigated quite successfully. The fun thing is, He and Xavier initialization attempt to ensure such variance in layer outputs by default. But first, a brief look into the sensitivity of ReLU.

### Why is ReLU less sensitive to this problem?

In general, we therefore use ReLU as our activation function of general choice.

This is ReLU and its derivative:

As you can see, the derivative of ReLU behaves differently. If the original input is < 0, the derivative is 0, else it is 1. This observation emerges from the way ReLU is designed.

Hence, it does no longer matter whether the variance is 1 or 100; in the both positive and negative numbers drawn from such a sample, the gradient will always be zero or one. Hence, it's not bothered much by vanishing and exploding gradients, contrary to Sigmoid and tanh.

Let's now take a look at He and Xavier initialization.

### Xavier initialization

In his work, Kumar argued that when variance of the layer outputs (and hence the downstream layer inputs) is not ≈ 1, depending on the activation function, models will converge more slowly, especially when these are < 1.

For "activation functions differentiable at 0", Kumar derives a generic weight initialization strategy. With this strategy, which essentially assumes random initialization from e.g. the standard normal distribution but then with a specific variance that yields output variances of 1, he derives the so-called "Xavier initialization" for the Tanh activation function:

$$v^{2} = 1/N$$

### He initialization

When your neural network is ReLU activated, He initialization is one of the methods you can choose to bring the variance of those outputs to approximately one (He et al., 2015).

Although it attempts to do the same, He initialization is different than Xavier initialization (Kumar, 2017; He et al., 2015). This difference is related to the nonlinearities of the ReLU activation function, which make it non-differentiable at $x = 0$. However, Kumar indeed proves mathematically that for the ReLU activation function, the best weight initialization strategy is to initialize the weights randomly but with this variance:

$$v^{2} = 2/N$$

...which is He initialization.

## Summary: choose wisely

Weight initialization is very important, as "all you need is a good init" (Mishkin & Matas, 2015). It's however important to choose a proper weight initialization strategy in order to maximize model performance. We've seen that such strategies are dependent on the activation functions that are used in the model.

For Tanh based activating neural nets, the Xavier initialization seems to be a good strategy, which essentially performs random initialization from a distribution with a variance of $1/N$.

Here, $N$ is the number of input neurons to a particular layer.

For Sigmoid based activation functions, this is not the case, as was derived in the Kumar paper (Kumar, 2017).

ReLU activating networks, which are pretty much the standard ones today, benefit from the He initializer - which does the same thing, but with a different variance, namely $2/N$.

This way, your weight init strategy is pinpointed to your neural net's ideosyncrasies, which at least theoretically makes it better. I'm looking forward to hearing from your experience as to whether you also see these results in practice. Leave a comment below if you're feeling like sharing 👇

Thanks for reading and happy engineering! 😄

## References

Kumar, S. K. (2017). On weight initialization in deep neural networks. CoRR, abs/1704.08863. Retrieved from http://arxiv.org/abs/1704.08863

He, K., Zhang, X., Ren, S., & Sun, J. (2015). Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification. 2015 IEEE International Conference on Computer Vision (ICCV). doi:10.1109/iccv.2015.123

Mishkin, D., & Matas, J. (2015). All you need is a good init. arXiv preprint arXiv:1511.06422. Retrieved from https://arxiv.org/abs/1511.06422

Neural networks and deep learning. (n.d.). Why are deep neural networks hard to train? Retrieved from http://neuralnetworksanddeeplearning.com/chap5.html


text:
# Checking date & time in PHP

Goal: To create a countdown to our next available live stream.

Details: We live stream six times a week all (PST). 1. Sunday at 8:00 a.m. 2. Sunday at 10:00 a.m. 3. Sunday at 12:00 p.m. 4. Sunday at 6:30 p.m. 5. Wednesday at 7:00 p.m. 6. Saturday at 10:00 a.m.

My approach: I check what day it is and what time it is then create the countdown to the next stream.

I'm sure what I have done can be cleaned up and improved, so tell me how.

<?php
// Countdown Stuff
$year = date(Y);$month = date(m);
$month_day = date(d);$day = date(w);
$hour = date(G);$min = date(i);
$addDay = 0; // It's Sunday if ($day == 0 ) {
if ( $hour < 8 ) {$hour = 8;
$min = 0; } else if ($hour < 10 ) {
$hour = 10;$min = 0;
}
else if ( $hour < 12 ) {$hour = 12;
$min = 0; } else if ($hour <= 18 && $min < 30 ) {$hour = 18;
$min = 30; } else {$addDay = 3;
$hour = 19;$min = 0;
}
}
// It's Monday
else if ( $day == 1 ) {$addDay = 2;
$hour = 19;$min = 0;
}
// It's Tuesday
else if ( $day == 2 ) {$addDay = 1;
$hour = 19;$min = 0;
}
// It's Wednesday
else if ( $day == 3) { if ($hour < 19 ) {
$hour = 19;$min = 0;
} else {
$addDay = 3;$hour = 10;
$min = 0; } } // It's Thursday else if ($day == 4 ) {
$addDay = 2;$hour = 10;
$min = 0; } // It's Friday else if ($day == 5 ) {
$addDay = 1;$hour = 10;
$min = 0; } // All that's left is Saturday else { if ($hour < 10 ) {
$hour = 10;$min = 0;
} else {
$addDay = 1;$hour = 8;
$min = 0; } }$build_date = $year . '-' .$month . '-' . $month_day . ' ' .$hour . ':' . $min . ':00';$date = new DateTime($build_date); if ($addDay ) {
$date->modify("+$addDay day");
}

$date = strtotime($date->format("Y-m-d G:i:s"));
$now = strtotime("now");$count = $date -$now;
?>

<script type="text/javascript">
var myTime = <?=$count?>;$('#countdown').countdown({ until: myTime});
</script>

<?php

$schedule = array( 'this Sunday 8am', 'this Sunday 10am', 'this Sunday 12pm', 'this Sunday 6:30pm', 'this Wednesday 7pm', 'this Saturday 10am' );$current_time = strtotime('now');
foreach ($schedule as &$val) {
$val = strtotime($val);
// fix schedule to next week if time resolved to the past
if ($val -$current_time < 0) $val += 604800; } sort($schedule);
$countdown =$schedule[0] - $current_time; ?> <script type="text/javascript"> var myTime = <?php echo$countdown; // just personally prefer full tags ?>;
$('#countdown').countdown({ until: myTime}); </script>  To add to visionary-software-solutions' answer, it would be best to store the schedule in a database or a separate xml/text/json/etc type file. This way, you can have staff simply use an internal webform to change schedules instead of having the PHP dev hard-code the changes every time. In that webpage, you can allow staff to only select a weekday and time, and have the page translate that into a string usable by strtotime() in this countdown script. Edit: fixed strtotime() values. Careful with "this day" vs "next". For some insight into what type of strings strtotime() can take, see: http://www.gnu.org/software/tar/manual/html_node/Date-input-formats.html I don't have time to look over everything, but I noticed you only set $min to something other than 0 once. You could add the following above $build_date, and then remove all the $min = 0;s, and you'd clear up a few lines:

if($min == date('i')) {$min = 0;
}

If it didn't change, which would only happen when you set it to 30 in that one instance, then set it to 0.

A few things that jumped out.

In your date() calls you are passing constants instead of strings e.g. you use date(Y) as opposed to date('Y'), this issues a notice error. PHP will assume that you meant a string, but it is best to be explicit.

The getdate() function will gives you all that information instead of calling date() 6 times.

For what you are wanting to do, I would recommend taking a look at the mktime() function. Once you calculate the next live stream time from your current time, simply pass those values to mktime() and do a time() - mktime() and thats how many seconds you have until the event. mktime produces a UNIX timestamp, so you can pass that to the date() function or into a DateTime object to format, change timezone, etc.

If you are going to have a lot of if/elseif statements like that, it would be cleaner to use a switch statement.

Of course, now if your company decides to change streams from Sunday at 8:00am to Tuesday at 2, you're going to have to go in and hack this code. And if you mess up a ';' or '?php' or junior developer passes "NO WAY" to strtotime()?

Evolve your approach. You should be storing the stream times externally; either in a file or a database. You should be querying those times, doing a strtotime() difference between them and now, then taking the minimum positive element and displaying that.


text:
# self-planting

## Self-planting: digging holes in rough landscapes

Technical paper on the self-planting transition where a simple dynamical rule lead to an interesting algorithmic phase transition.


text:
# A mistake in the code for drawing a line segment in a triangle

I think that this post should be discarded quickly. I have been reluctant to post it. (The code for this post is similar to the code that I posted about labels for nodes not being at the same distance from points.) I draw triangle ABC. I put point S halfway from A to B. I want to put a point T on BC so that the line through S and T is 30 degrees below the horizontal line through S. In the code, I issue the command \path[name path=ST] (S) --++ (-30:5); to do this. I get a line through S and C. If I replace -30 with -90, I get the same picture! What is wrong with the code?

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,positioning,intersections}

\begin{document}

\begin{tikzpicture}

\coordinate[label=225:$A$] (A) at (0,0);
\coordinate[label=90:$B$] (B) at (60:6);

%These commands position vertex C, label it C, and positions the label southeast of the vertex.
\path[overlay,name path=horizontal] (A) -- ++(10,0);
\path[overlay,name path=BC] (B) -- ($(B)!2!75:(A)$);
\path[name intersections={of= horizontal and BC, by=C}];
\coordinate[label={[blue]-45:$C$}] (blah-blah) at (C);

%This command draws the triangle.
\draw (A) -- (B) -- (C) -- cycle;

%This command draws the line segment from the midpoint S on AB to a point T on BC.
\coordinate (S) at ($(A)!0.5!(B)$);
\path[name path=ST] (S) --++ (-30:5);
\path[name intersections={of= ST and BC, by=T}];
\draw[dashed] (S) -- (T);

\end{tikzpicture}

\end{document}

• Try adding draw to your \path commands so you can see what is or is not happening. – cfr May 8 '15 at 1:59
• Do you want T to be on the line BC or on AC? From your picture I think you probably mean AC but in your code you ask for BC. The problem when you use -90 is that the line ST does not intersect the line BC. – Andrew May 8 '15 at 2:41

It's easy to see what happens if you use \draw[blue, name path=ST] (S) --++ (-30:5); instead of \path[name path=ST] (S) --++ (-30:5);

The line is too short and doesn't intersect BC. Just make it longer:

\documentclass{amsart}
\usepackage{tikz}
\usetikzlibrary{calc,positioning,intersections}

\begin{document}

\begin{tikzpicture}

\coordinate[label=225:$A$] (A) at (0,0);
\coordinate[label=90:$B$] (B) at (60:6);

%These commands position vertex C, label it C, and positions the label southeast of the vertex.
\draw[green,overlay,name path=horizontal] (A) -- ++(10,0);
\draw[red, overlay,name path=BC] (B) -- ($(B)!2!75:(A)$);
\path[name intersections={of= horizontal and BC, by=C}];
\coordinate[label={[blue]-45:$C$}] (blah-blah) at (C);

%This command draws the triangle.
\draw (A) -- (B) -- (C) -- cycle;

%This command draws the line segment from the midpoint S on AB to a point T on BC.
\coordinate[label=above left:S] (S) at ($(A)!0.5!(B)$);
\draw[blue, name path=ST] (S) --++ (-30:15);
\path[name intersections={of= ST and BC, by=T}];
\draw[dashed] (S)  -- (T) node [above right]{$T$};

\end{tikzpicture}
\end{document}

• I had supposed that the line through S and T would intersect BC. Oops! Maybe, to my chagrin, I should keep the post. The common-sense advice to use \draw instead of \pat to see what is going on may be helpful to others. – Adelyn May 8 '15 at 14:43


text:
# Some weird interactions between Monomorphism Restriction and Template Haskell

Today I’m going to look at a weird issue I encountered this past weekend while working on a DSL in Haskell.

I’ll start with the code. As this example uses Template Haskell, we need to have the source broken up into two files:

Testa.hs:

{-# LANGUAGE
module Testa where

someth = [| () |]

unit = ()

mrIssue :: (Monad m) => b -> m b
mrIssue = return

Testb.hs:

{-# LANGUAGE
NoMonomorphismRestriction,
module Testb where

import Testa

g = $(someth) foo1 = mrIssue$(someth)

f = ()
foo2 = mrIssue ()

h = unit
foo3 = mrIssue unit

Now, if we fire up ghci Testb.hs, we get the following:

$ghci Testb.hs GHCi, version 6.10.4: http://www.haskell.org/ghc/ :? for help Loading package ghc-prim ... linking ... done. Loading package integer ... linking ... done. Loading package base ... linking ... done. [1 of 2] Compiling Testa ( Testa.hs, interpreted ) [2 of 2] Compiling Testb ( Testb.hs, interpreted ) Loading package syb ... linking ... done. Loading package array-0.2.0.0 ... linking ... done. Loading package packedstring-0.1.0.1 ... linking ... done. Loading package containers-0.2.0.1 ... linking ... done. Loading package pretty-1.0.1.0 ... linking ... done. Loading package template-haskell ... linking ... done. Ok, modules loaded: Testb, Testa. *Testb> :t foo1 foo1 :: (Monad m) => m () *Testb> :t g :1:0: Ambiguous type variable m' in the constraint: Monad m' arising from a use of g' at :1:0 Probable fix: add a type signature that fixes these type variable(s) *Testb>    Notice that, while we’re able to get the type for foo1, for some reason g is ill-typed with an ambiguous type variable in the constraint Monad m. The only problem, of course, is that when we look at our source we don’t see any way in which the type for g should have this constraint! So maybe the problem is that g needs a type signature. But if we go in and modify Testb.hs, giving it   g :: () g =$(someth)

then we get the following from ghci:

Testb.hs:10:7:
Could not deduce (Monad m) from the context ()
arising from a use of mrIssue' at Testb.hs:10:7-23
Possible fix:
add (Monad m) to the context of the type signature for g'
In the expression: mrIssue ($someth) In the definition of foo1': foo1 = mrIssue ($someth)
*Testa>

So now it's upset about the type for foo1. Fine. Let's give it a signature as well:

g :: ()
g = $(someth) foo1 :: (Monad m) => m () foo1 = mrIssue$(someth)

Now we get a new error from ghci:

Testb.hs:11:0:
Contexts differ in length
(Use -XRelaxedPolyRec to allow this)
When matching the contexts of the signatures for
g :: ()
foo1 :: forall (m :: * -> *). (Monad m) => m ()
The signature contexts in a mutually recursive group should all be identical
When generalising the type(s) for g, foo1

If we add RelaxedPolyRec to our list of LANGUAGE extensions, the problem does, indeed, go away. In this case, we can even remove our type signature for g or for foo1, but not both -- we need to have at least one of them present.

Lastly, if we go back to our original source given above, but replace the signature for mrIssue with

mrIssue :: b -> IO b
mrIssue = return

then we can remove the NoMonomorphismRestriction, and everything works just fine (we can :t g and :t foo1 without any problems).

I'm entirely unsure of what's going on here. Any theories?


text:
# Theory of High T$_c$ Ferrimagnetism in a Multi-orbital Mott Insulator

Authors
Type
Published Article
Publication Date
Mar 05, 2013
Submission Date
May 08, 2012
Identifiers
DOI: 10.1103/PhysRevLett.110.087203
Source
arXiv
We propose a model for the multi-orbital material Sr$_2$CrOsO$_6$ (SCOO), an insulator with remarkable magnetic properties and the highest $T_c \simeq 725$ K among {\em all} perovskites with a net moment. We derive a new criterion for the Mott transition $(\widetilde{U}_{1} \widetilde{U}_{2})^{1/2}>2.5W$ using slave rotor mean field theory, where $W$ is the bandwidth and $\widetilde{U}_{1(2)}$ are the effective Coulomb interactions on Cr(Os) including Hund's coupling. We show that SCOO is a Mott insulator, where the large Cr $\widetilde{U}_{1}$ compensates for the small Os $\widetilde{U}_{2}$. The spin sector is described by a frustrated antiferromagnetic Heisenberg model that naturally explains the net moment arising from canting and also the observed non-monotonic magnetization $M(T)$. We predict characteristic magnetic structure factor peaks that can be probed by neutron experiments.


text:
Opened 11 years ago

Closed 11 years ago

# Add Ability to Edit Ticket-Custom

Reported by: Owned by: angrymike anybody high CustomFieldAdminPlugin normal Could not add with plugin 0.10

### Description

Since this plugin works directly on trac.ini file, it should support all features of trac.ini. Including the [ticket-custom] portion. This would make it much easier to update the custom ticket fields.

### comment:1 in reply to:  description Changed 11 years ago by anonymous

Since this plugin works directly on trac.ini file, it should support all features of trac.ini. Including the [ticket-custom] portion. This would make it much easier to update the custom ticket fields.

I would like to have this feature to use, too. Thank you very much for you nice work. :)

### comment:2 in reply to:  description Changed 11 years ago by anonymous

Since this plugin works directly on trac.ini file, it should support all features of trac.ini. Including the [ticket-custom] portion. This would make it much easier to update the custom ticket fields.

Is there any work being done to accomplish this? This feature would be very useful. Thankyou

### comment:3 follow-up:  4 Changed 11 years ago by Alec Thomas

Component: IniAdminPlugin → Request-a-Hack changed from Alec Thomas to anybody

Hi. No there isn't. This plugin is purely for exposing the trac.config options under WebAdmin. Adding a [ticket-custom] editor would be a large amount of work and not really in scope. It's a good idea though, so I'm going to change this to a request-a-hack.

### comment:4 in reply to:  3 Changed 11 years ago by Catalin BALAN

Resolution: → fixed new → closed

### comment:5 Changed 9 years ago by jspivey@…

Can someone please tell me how to make a custom field required?

### comment:6 follow-up:  7 Changed 8 years ago by anonymous

I add one ticket-custom with this plugin, but haven't displayed in the new ticket page, could you teach me the workflow how i could get it use? And from the URL:http://trac.edgewall.org/wiki/TracTicketsCustomFields it seems require the db change?any comments?

### comment:7 in reply to:  6 Changed 8 years ago by Steffen Hoffmann

I add one ticket-custom with this plugin, but haven't displayed in the new ticket page, could you teach me the workflow how i could get it use? And from the URL:http://trac.edgewall.org/wiki/TracTicketsCustomFields it seems require the db change?any comments?

No db change required: 'custom' is a std table in Trac db now, at least since 0.11, and you should really consider upgrading anyway, if your not there yet. What exactly is your problem with adding custom ticket fields? Works for me like a charm: add with CustomFieldAdminPlugin, us it afterwards, doesn't require a Trac Server restart or even black magic :-) So if you're still stuck halfway, you need to provide more details (like mentioned /about with TRAC_ADMIN privileges).

### Modify Ticket

Change Properties