Estimates the DC and AC energy a solar array gives in a year, month by month, with shading, temperature, losses and inverter clipping, and its performance ratio.
How the precision is kept
Each month is one representative day of hourly values times the days in the month, so the method sets the accuracy; the file calls it an early-design estimate. Hourly power and the DC sums are 64-bit. The monthly AC energy is rounded to 0.1 kWh when stored, and the annual AC energy, the specific yield and the performance ratio are then computed from those rounded months and from a kWp rounded to 0.001.
Open item. Keep the monthly AC energy unrounded for the annual sum, the specific yield and the performance ratio, and round only the values that are shown.
Calculations under this policy
8 calculations in 1 source file. The code is read from the released app when this page loads. It is the calculation people run, not a copy kept for this page.
Five 64-bit factors multiplied in order. The value listed in the result's inputs is rounded to three decimals; the calculation uses the unrounded product.
The AC energy of each month after the inverter's rating limits the hourly power.
scale = P_ac ÷ Σ P when Σ P > P_ac; month AC = Σₕ P × scale × days, rounded to 0.1 kWh
Clipping scales every array's hour by the same factor. Each array's monthly AC energy is stored rounded to 0.1 kWh, and that rounded number is what the annual sum reads.
pv-yield.js
lines 71 to 82
BimCraft 0.8.1
const pac = inverter?.pacKw > 0 ? inverter.pacKw : Infinity;
let clippedKwh = 0, unclippedKwh = 0;
const monthTot = days.map(() => ({ dc: 0, ac: 0, poa: 0 }));
days.forEach((d, mi) => {
const k = DAYS_IN_MONTH[mi], scale = new Array(24).fill(1);
for (let h = 0; h < 24; h++) {
const tot = arrays.reduce((s, _, ai) => s + hourly[ai][mi][h], 0);
if (tot > pac) { scale[h] = pac / tot; clippedKwh += (tot - pac) * k; }
unclippedKwh += tot * k;
}
arrays.forEach((_, ai) => { out[ai].monthly[mi].acKwh = r1(hourly[ai][mi].reduce((s, v, h) => s + v * scale[h], 0) * k); });
});
Annual energy, specific yield and performance ratio of an array
64-bit
An array's yearly DC and AC energy, kWh per kWp and performance ratio.
AC = Σ rounded months; specific yield = AC ÷ kWp; PR = AC ÷ (kWp × POA)
AC is the sum of twelve values already rounded to 0.1 kWh, and kWp was rounded to 0.001 when the array record was made; DC uses the unrounded sum. The annual energies are then rounded to whole kWh and PR to three decimals.
The totals add the per-array values above, so they carry the same rounded months and rounded kWp. The plant's shade loss averages percentages already rounded to 0.1, weighted by the rounded kWp and the rounded irradiation.
Cell temperature by the NOCT model (the file cites Duffie and Beckman §23.3); module power linear in irradiance and temperature; the losses multiplied as one chain; the summed AC power of each hour clipped at the inverter rating; performance ratio = AC energy ÷ (kWp × unshaded plane-of-array kWh/m²).
Number types
64-bit numbers.
Limits
One day per month and one value per hour. The annual AC sum can differ from the unrounded sum by up to 0.6 kWh per array (twelve months each rounded to 0.1 kWh). The default losses, a 20 °C air temperature and an albedo of 0.2 are starter values.
Approach: 64-bit, stated limit
The arithmetic is 64-bit, but the method or the data sets the accuracy: a solver tolerance, a mesh, a step size, a datum shift, a table. The limit is stated where the result is shown.