LogicCommons is in beta. If a result, label, or reference looks wrong, tell us here; we read every message.
Methodology
Purpose and model boundary
This calculator estimates how many solar modules fit on a roof you draw. You draw the roof as seen from above on a grid: its outline, then its ridges, hips and valleys, which divide it into facets (the flat planes of the roof), and you set each facet's pitch. You set north on the drawing with its north arrow (until you do, the top of the drawing is taken to face the way you choose), say which facets take modules, mark up to five vents, chimneys or roof windows no module may cover, and give the setbacks, the module's size and rating, the energy one kilowatt of modules yields in a year facing the equator at your latitude, your site's latitude and how clear its sky is. The spreadsheet reads the drawing's edges and facets, works out which way each facet slopes and faces and how steeply, lays whole modules on each facet used in rows down its slope inside the setbacks, and returns the modules that fit, the array's DC size, a yearly energy estimate from the yield you type scaled for each facet by its direction and tilt, the energy per kilowatt of the array, the share of the facets used the modules cover, and each facet's rows, modules, direction, tilt and energy in a table. It is not a solar design, a structural check, a shading study or a quote: it does not rack or space the modules, lay out fire pathways, model shading, size an inverter or wiring, or price anything.
Inputs and units
The drawing is the first input. Its outline is sent as an ordered list of up to 100 corner points, as on the Area Calculator, and it is the roof edge, the drip line: nothing is added outside it. With Roof, the drawing tool marks each outline piece as an eave, a rake, a high side, a headwall or a sidewall, and draws the roof lines inside it: ridges, hips, valleys, pitch changes and the wall lines where a lower roof meets a wall (a headwall or a sidewall). Roof shape draws a whole gable or hip roof at once, and Set pitch gives a facet its pitch as a rise in 12, in degrees or as a percent. The drawing sends three tables: the grid step, every roof edge (its ID, its type, its two ends and the facet on each side of it), and every facet with its pitch as typed. It sends no length, area, rise or slope direction: the spreadsheet computes them all from the edges. Up to five exclusions of up to 20 points each mark the vents, chimneys and roof windows no module may cover (Add exclusion); draw any clearance you need around one as part of it. The US/Metric switch on the drawing chooses the unit the points and edges are written in, feet for US and metres for Metric, and the unit of every result that has one; it never converts a pitch.
To draw a complex roof, draw its outline and choose Roof ▾, Roof shape ▸, Generate roof: it draws every ridge, hip and valley of an outline whose corners are all square at once, or says why it cannot. A gable end is Mark edges ▸ Rake on that outline piece, and a wing's pitch is Set pitch on its facets, then Replace with generated roof keeping each facet's pitch.
North is set on the drawing itself, with the north arrow at its top right: drag the arrow until it points to north, or type how many degrees clockwise from the drawing's up north lies, from 0 to 359.9 with at most one decimal (0 when north is straight up, 90 when it points right), and clear it to leave north not set. The drawing sends that bearing as the North bearing (clockwise from the drawing's up), and sends it blank until you set it: it never assumes that north is up. Line the drawing up with a map that has north at its top to read the bearing.
The inputs beside the drawing are:
- Top of the drawing faces: North (the default), East, South or West, so the spreadsheet can tell which way each facet faces. It is shown and used only while north is not set on the drawing: once you set north, the choice is hidden and the arrow decides, and clearing north shows it again.
- Facets that take modules: Every facet (the default), Facing south, Not facing north, Facing north or Not facing south. Facing south takes a facet whose downhill direction is within 45 degrees of south, Not facing north one within 90 degrees of south, and the north options the same way round; a facet exactly on the limit is taken. A flat facet always takes modules.
- Pitch where the drawing sets none (rise in 12): the pitch used for a facet the drawing gives no pitch, from 0 to 36 in 12. It is the same figure in both systems. The page opens on one facet with no pitch, so until you set each facet's pitch this one pitch is used over the whole plan, and the status says so.
- Setback from the roof's edges: the strip kept clear of modules inside every outline piece (eaves, rakes, high sides, headwalls and sidewalls), in feet (US) or metres (Metric), measured in plan.
- Setback from ridges, hips and valleys: the strip kept clear on each side of every roof line (ridge, hip, valley, pitch change and wall line), in feet or metres, measured in plan.
- Module width (across the slope): the module's side laid along a facet's level edges, in feet or metres.
- Module length (up the slope): the module's side laid up the slope, in feet or metres. Modules are laid in portrait; to lay them in landscape, type the two sides the other way round.
- Module rating: the module's DC nameplate power in kilowatts, as on its datasheet (0.4 kW is 400 W). The same figure in both systems.
- Annual yield per kW, facing the equator at your latitude: the energy one kilowatt of modules produces in a year at your site when it faces the equator (due south in the northern hemisphere, due north in the southern) tilted at your latitude, in kWh per kW. Each facet's own direction and tilt then scale it. The same figure in both systems.
- Latitude (north positive): your site's latitude in degrees, north positive and south negative, from -60 to 60. It sets the sun's path for each facet's yield, and which way the reference array faces.
- Clearness index (cloudiness), from 0.30 to 0.75. Cloudiness of your site: the share of the sunlight above the atmosphere that reaches the ground, averaged over the year. 0.5 is a typical value; use a lower figure for a cloudier climate and a higher one for a sunnier climate.
The two setbacks and the module width and length have one input for each system, each with its own default: 3 ft, 1.5 ft, 3.4 ft and 5.6 ft in US, and 0.9144 m, 0.4572 m, 1.03632 m and 1.70688 m in Metric, the US figures converted exactly at 0.3048 m to the foot. The direction of the drawing (North), the choice of facets (Every facet), the pitch (6 in 12), the module rating (0.4 kW), the yield (1,300 kWh per kW), the latitude (40) and the clearness index (0.50) are shared by both systems, and the page opens with north not set. Switching between US and Metric shows the other system's inputs with their own values and never converts a number you typed; the value you typed for the system you left is kept for when you switch back, and it is not sent while it is hidden.
The defaults are the figures of the worked examples this calculator was built against, not values from a code, a datasheet or a site survey, so review them before use. The setback from ridges, hips and valleys opens at 18 in, the residential code's clear setback on each side of a horizontal ridge (IRC R324.6.2); applying it to hips, valleys, pitch changes and wall lines too is this calculator's product choice, not the code's. Your fire and building officials set the real setbacks, your module's datasheet gives its size and rating, and the yield per kW depends on the location, shading and system losses, so use an estimate for your site facing the equator at your latitude; the latitude of 40 and the clearness index of 0.50 the page opens with are examples, not your site's.
Governing relationships
The plan area is the area inside the drawn outline, measured by the shoelace formula as on the Area Calculator, and each exclusion's area is measured the same way. Each facet's plan area is measured from its own edges, their points read to the nearest 25 micrometres (see Validation and status logic), and the facets must cover the outline exactly: a request whose facets and outline disagree is refused.
Which way a facet slopes comes from its level edges: it slopes down toward an eave and away from a ridge, a high side, a headwall or the upper side of a pitch change. Its slope is its pitch as a rise over run: a rise in 12 of p is p ÷ 12, an angle of d degrees is tan(d), and a percent of q is q ÷ 100. Over one unit of run a facet rises by its slope, so by the Pythagorean theorem its surface is √(1 + slope²) times its plan: the facet's pitch factor. Every edge's rise follows from the slope and the facet's downhill direction, taken from each facet it bounds, so hips and valleys between different pitches are measured where the drawing puts them, and the two sides must agree. A flat facet is laid square to the drawing.
Which way a facet faces is its downhill direction read against north. With north set on the drawing, the drawing's up faces 360 − bearing degrees clockwise from north, so a bearing of 90 (north pointing right) makes the drawing's up face west; until north is set, the drawing's up faces the way the Top of the drawing faces choice says. A facet's azimuth is its downhill direction in degrees clockwise from north, and its tilt is the angle of its slope, tilt = arctan(slope); a flat facet has a tilt of 0 and no azimuth.
Each facet's energy is the yield per kW you type scaled by its orientation factor: the sunlight a year on a surface of the facet's azimuth and tilt, divided by the sunlight a year on the reference surface, which faces the equator (due south at a positive latitude, due north at a negative one) tilted at your latitude. Both are computed the same way, month by month, by the textbook monthly method:
- for each month's average day (Klein 1977), the sun's declination, the sunset hour angle and the sunlight above the atmosphere on level ground at your latitude;
- the sunlight on level ground, that times the clearness index;
- its diffuse share, from the monthly correlation of Erbs, Klein and Duffie (1982);
- the sunlight on the surface by the isotropic-sky method of Liu and Jordan: the direct part times the month's average ratio of direct sunlight on the surface to that on level ground (taken over the hours the sun is above both the horizon and the surface: Klein (1977) gives this ratio for a surface facing the equator or turned east or west of it with the sun in front of it at noon; this calculator takes the same integral for every azimuth, so it also covers a surface facing away from the equator), the diffuse part times (1 + cos tilt) ÷ 2, and the sunlight reflected from the ground, at a reflectance of 0.2, times (1 − cos tilt) ÷ 2.
The twelve months are added up for the facet and for the reference surface, and the orientation factor is their ratio, so a facet facing the equator at your latitude has a factor of 100% and the yield you typed. With Klein's own diffuse correlation in place of the Erbs correlation, the method reproduces Klein's (1977) monthly tables of the sunlight above the atmosphere, of that ratio for surfaces facing south and west of south, and of the sunlight on surfaces facing south, west of south and, in the southern hemisphere, north; the Erbs step and a surface facing away from the equator have no printed figure to check against, and the few printed figures it does not reproduce are listed in the calculator's review record.
Each facet is laid out in its own frame: across its slope, along its level edges, and down its slope, both measured in plan. Every edge of the facet keeps modules back from it by its setback, in plan: an outline piece by the setback from the roof's edges, a roof line by the setback from ridges, hips and valleys. A setback measured in plan leaves at least as much clear along the slope.
- Rows run down the slope from the facet's highest point: from the setback line of a level edge along its top, such as a ridge, or from its apex where it has none. Each row is one module deep: in plan
row depth = module length ÷ pitch factor, so on the slope it is exactly one module long. Rows are taken down to the facet's lowest point, up to 12 rows on a facet. The displayedRowsvalue counts only rows that retain at least one module after vent and chimney blocking; a fully blocked row is not displayed as a row. - In each row, every edge of the facet rules out the stretch of the row that comes within its setback of the edge, measured to the edge itself, so the zone kept clear along an edge has rounded ends. Each free stretch left between them that lies inside the facet holds
(the stretch's length) ÷ module widthmodules, rounded down to a whole module and packed from the stretch's left end as seen from below the facet looking up its slope (on a drawing whose top faces north, the left end for a facet facing south or a flat facet, the right end for one facing north), up to 24 in a row, counted from the left. - Each count is rounded to six decimal places before it is rounded down, so a fit that is whole but for the last binary digit of the arithmetic is not lost.
- Each vent or chimney blocks every module its smallest surrounding rectangle on the drawing overlaps with some area, that rectangle's corners taken into the facet's frame; a vent that only touches a module's edge does not block it, and a module two vents overlap is counted once. A vent across a ridge blocks modules on both sides; one inside a setback blocks nothing.
Every facet is laid out this way, whatever its shape: an L or a T, a facet notched by the valleys around a wing, bay or garage, and a facet holding a dormer, whose own edges keep their setbacks too. Every module is at least its setback from every edge of its facet and inside it. The layout packs each row from the top of the facet and from the left end of each free stretch; it is not a search for the most modules that could fit, so a layout shifted along a row or down the slope can sometimes hold more.
For each facet used, and added up:
Modules = the modules laid on the facets used, less those a vent or chimney blocks
Array size (kW DC) = modules × module rating
Each facet's energy (kWh) = its modules × module rating × annual yield per kW × its orientation factor
Annual energy (kWh) = the sum of each facet's energy over the facets used
Annual energy per kW of the array (kWh per kW) = annual energy ÷ array size
Area of the facets used, on the slope = the sum of each facet's plan area × its pitch factor, with no overhang and nothing taken out for the vents and chimneys
Pitch factor = area of the facets used on the slope ÷ their plan area, an average weighted by area
Share of the facets used covered = modules × module width × module length ÷ area of the facets used on the slope
The residential code asks a clear setback of 18 in on each side of a horizontal ridge when the array covers no more than 33% of the roof's plan area, and 36 in above that (IRC R324.6.2), and it exempts roofs of 2:12 or less. So when some ridge joins a facet steeper than 2:12, the modules' plan area (each module's area on the slope ÷ its facet's pitch factor) is more than 33% of the roof's plan area, and the setback from ridges, hips and valleys is under 36 in (914 mm), the status says so; the modules are not moved. Pathways from the eave to the ridge (IRC R324.6.1) are not laid out.
Nothing else is rounded in the spreadsheet: every figure is computed from unrounded values.
For the drawing the page opens with, the canvas's 20 by 15 ft rectangle as one facet with no pitch, the typed 6 in 12 applies. The facet slopes toward its top edge, so it faces north: 3 ft in from every edge leaves 9 ft in plan down the slope and 14 ft across it. A 5.6 ft module is 5.6 ÷ 1.1180 = 5.01 ft deep in plan, so 1 row fits, of 14 ÷ 3.4 = 4.12, so 4 modules: 1.6 kW DC, 23% of the 335.41 sq ft on the slope. North is not set, so the drawing's up faces north and the facet faces due north, tilted 26.57 degrees (6 in 12); at the latitude of 40 and the clearness index of 0.50 the page opens with, its orientation factor is 66.70%, so the array yields 1.6 kW × 1,300 kWh per kW × 0.66701 = 1,387.38 kWh a year, 867.11 kWh per kW. Drawn as a 30 by 20 ft gable at 6 in 12 with Facing south, the south plane runs from 1.5 ft below the ridge to 3 ft short of the eave, 5.5 ft in plan, and 24 ft across between the rakes: 1 row of 7 modules, 2.8 kW and 39.74% of that plane; it faces due south, with an orientation factor of 99.87%, so 3,635.20 kWh a year. With every facet taken, the north plane adds 7 more, and 14 modules cover more than 33% of the roof in plan, so the status asks you to check the ridge setback. The same count on a 30 by 32 ft gable at 2 in 12 lays 28 modules, more than 33% of the plan, and reads OK, because a roof of 2:12 or less is exempt. A flat 40 by 40 ft L with a 20 by 20 ft corner out is laid across both its arms, 36 modules, and reads OK.
Calculation sequence
- The spreadsheet measures the plan area of the outline and the area of each exclusion.
- It reads the three roof tables, the setbacks and the module width and length of the selected system, the north bearing the drawing sends and the direction of the drawing, the facets that take modules, the typed pitch, the module rating, the yield, the latitude and the clearness index.
- It checks that every roof edge has an ID, a known type, both ends and its facets. It reads every roof point and outline point to the nearest point of a 25 micrometre grid and refuses a point that is more than 1,500 ft (450 m) from the origin along x or y once rounded to that grid. It then checks that no other edge shares an edge's ID, that each edge's two ends differ, that every facet an edge names is listed under exactly that ID, and every facet's pitch, and measures each facet's plan area from its own edges. The facets must cover the outline exactly, once.
- Each facet's slope comes from its pitch, or from the typed pitch when the drawing gives it none, and its downhill direction from its level edges. Every edge's rise follows from them, and each edge is checked against its type and against the facets on both its sides.
- Each facet's direction is read against north: the bearing the drawing sends, or, while north is not set, the direction of the drawing's top. The choice of facets decides which take modules, and each facet's azimuth and tilt give its orientation factor.
- On each facet, the rows down the slope from its highest point and, in each row, the stretches the edges' setbacks leave free inside the facet and the modules each holds; then the modules each vent or chimney blocks.
- Modules, array size, each facet's energy, the annual energy over the facets used and the annual energy per kW of the array; their area on the slope, the pitch factor and the share covered.
- The "Each facet" table lists every facet, in the order of the Facets table, with the way it faces, its rows and modules, the modules lost to vents and chimneys, whether it takes modules, its azimuth, its tilt, its orientation factor and its energy a year.
- The status line is chosen, as described below. When it begins
NOT VALID:, every computed figure reads zero and the "Each facet" table is blank; the plan area and the exclusion areas are still measured from the drawing.
Outputs and interpretation
Modules, Array size (DC), Annual energy and the share of the facets used covered are the four headline results, under "Array", with the Annual energy per kW of the array beside them. The array size is in kW, the annual energy in kWh and the energy per kW in kWh per kW in both systems, the modules are a whole number and the share is a percentage. Under "Where north comes from" the page shows the spreadsheet's note on north: while north is not set, "North is not set on the drawing, so the drawing's top is taken to face the way 'Top of the drawing faces' says."; once it is set, "North is set on the drawing, so 'Top of the drawing faces' is not used." Like every computed figure, the note reads NOT VALID while the status is NOT VALID, and the page then shows the status in place of the results.
Under "Layout" the page shows the facets used, the modules lost to vents and chimneys, the area of the facets used on the slope, in square feet (US) or square metres (Metric), and the pitch factor, with no unit. The "Each facet" table lists every facet with the way it faces (N, NE, E, SE, S, SW, W or NW, or flat), its rows and modules, the modules lost to vents and chimneys, whether it takes modules, its azimuth in degrees clockwise from north (blank for a flat facet), its tilt in degrees, its orientation factor as a percentage and its energy in kWh a year; its headings are the spreadsheet's. A facet that does not take modules still shows what it would hold and yield, and only the facets used add to the annual energy. Under "From the drawing" the page shows the plan area inside the drawn outline and, so you can check the drawing, the plan area less exclusions and each exclusion's area.
A result belongs to the drawing and the inputs it was calculated for. When you change either after pressing Calculate, the result is kept but marked stale until you press Calculate again.
Validation and status logic
The drawing tool checks every edit before it is kept: the Area Calculator's rules for the outline and exclusions, and roof mode's own (at most 40 facets and 160 roof edges, a roof line from edge to edge or node to node, a pitch from 0 to 36 in 12, 71.5 degrees or 300 percent). It always writes the tables in consecutive rows, every edge with its type and its facets. The spreadsheet checks the tables again, because a request need not come from the drawing.
The status line is the spreadsheet's own verdict, the first of these that applies. Where a line names a facet (<facet>), a roof edge (<edge>), a line's type (<type>) or a figure, the spreadsheet puts in the first one in the list; <more> is "1 more facet" or the number of further facets, <x> and <y> are where a corner sits and <length> a length, each to two decimals, except that a point past the bound is written as the drawing sent it, to 15 significant digits; <number> is an outline point's place in the list, <bound> is 1,500 ft or 450 m, and <unit> is ft or m:
NOT VALID: choose US or MetricNOT VALID: draw at least three outline pointsNOT VALID: every outline point needs both coordinatesNOT VALID: every point of exclusion 1 needs both coordinatesNOT VALID: every point of exclusion 2 needs both coordinatesNOT VALID: every point of exclusion 3 needs both coordinatesNOT VALID: every point of exclusion 4 needs both coordinatesNOT VALID: every point of exclusion 5 needs both coordinatesNOT VALID: each exclusion needs zero or at least three complete pointsNOT VALID: outline and exclusion points must fill consecutive rows, with no blank row between themNOT VALID: roof edge <edge> has a point, (<x>, <y> <unit>), more than <bound> from the origin along x or y; draw the roof again on the pageNOT VALID: outline point <number>, (<x>, <y> <unit>), is more than <bound> from the origin along x or y; draw the outline again on the pageNOT VALID: the facet outline encloses no areaNOT VALID: the roof edges and facets are missing; draw the roof on the page's FloorCanvasNOT VALID: roof edges and facets must fill consecutive rows, with no blank row between themNOT VALID: every roof edge needs an ID, a known type, both ends and its facetsNOT VALID: roof edge ID <edge> is given to more than one row; give each roof edge its own ID, or draw the roof again on the pageNOT VALID: roof edge <edge> starts and ends at the same point; delete it or draw the roof again on the pageNOT VALID: roof edge <edge> names a facet the Facets table does not listNOT VALID: the pitch of <facet> must be a number with its unit (rise/12 up to 36, degrees up to 71.5, percent up to 300)NOT VALID: facet <facet> is listed in Facets but no roof edge bounds it; delete it or draw the roof again on the pageNOT VALID: a <type> inside <facet> ends in the open; join it or delete it (<edge>)NOT VALID: <facet> has no level edge (an eave, ridge, high side, headwall or pitch change) to set which way it slopesNOT VALID: the facets do not cover the drawn outline; draw the roof again on the pageNOT VALID: the edges of <facet> do not close into a loop at (<x>, <y> <unit>); draw the roof again on the pageNOT VALID: roof edges <edge> and <edge> are the same line drawn twice, so their facets overlap; draw the roof again on the pageNOT VALID: roof edge <edge> crosses, overlaps or touches another roof edge away from their shared corners, so facets overlap; draw the roof again on the pageNOT VALID: the outline pieces total <length> <unit> but the drawn outline's perimeter is <length> <unit>; the facets must cover the outline exactly once; draw the roof again on the pageNOT VALID: outline piece <edge> does not lie on the drawn outline; draw the roof again on the pageNOT VALID: <facet> is not on the side of roof edge <edge> that the edge names; draw the roof again on the pageNOT VALID: the outline touches itself at (<x>, <y> <unit>); draw the roof again on the page with an outline that does not touch itselfNOT VALID: the outline crosses or touches itself on its side from (<x>, <y>) to (<x>, <y> <unit>); draw the outline again on the page so that it does not cross or touch itselfNOT VALID: enter the pitch used where the drawing sets none, from 0 to 36 in 12NOT VALID: module width must be greater than zeroNOT VALID: module length must be greater than zeroNOT VALID: enter setbacks of zero or moreNOT VALID: enter a module rating of zero or moreNOT VALID: enter an annual yield per kW of zero or moreNOT VALID: choose which way the top of the drawing facesNOT VALID: choose which facets take modulesNOT VALID: enter the north bearing from 0 up to 360 degrees, or leave it blankNOT VALID: enter your site's latitude, from -60 to 60 degrees (north positive)NOT VALID: enter a clearness index from 0.30 to 0.75CHECK: <facet> has no pitch on the drawing, so the pitch typed here (<pitch> in 12) is used; set each facet's pitch with Set pitchCHECK: <facet> and <more> have no pitch on the drawing, so the pitch typed here (<pitch> in 12) is used; set each facet's pitch with Set pitchCHECK: The roof drawing has unresolved or inconsistent facets (see the notes under the drawing); hip and valley lengths may be wrong.CHECK: the level edges of <facet> do not agree on which way it slopes; check the type of <edge>CHECK: <edge>, marked <type>, does not fit the slope of <facet>; check its type or the facet's pitchCHECK: <facet> and <facet> give <type> <edge> different rises (<rise> and <rise> <unit>); check their pitches or where it is drawnCHECK: <facet> and <facet> meet at different heights along <edge> (<height> and <height> <unit>); check their pitches, or whether their eaves are at one levelCHECK: <facet> has more than 16 edges, so no modules are laid on itCHECK: <facet> has room for more than the 12 rows or 24 columns this layout counts on a facetCHECK: the modules cover more than 33% of the roof in plan, where the residential code asks a 36 in (914 mm) clear setback on each side of a ridge; check your ridge setbackOK
A facet with no pitch is not refused: the pitch you type is used for it and the status says which facet, so the page's opening drawing computes at once. North not set is not refused either: the Top of the drawing faces choice is shown, used and checked only while north is not set, and the note under "Where north comes from" says which of the two is in use. The rises of a hip or valley are compared from both of its facets, within half an inch (1 cm) plus the drawing's grid step times the steeper slope; a gable end left as an eave, a hip drawn where the planes do not meet, or a ridge off the line where two planes meet each raises a CHECK: that names the edge, because the figures are computed but the drawing does not describe one roof. A module width or length of zero is refused, because the fit divides by it; a pitch, a setback, a module rating or a yield of zero is accepted, and a rating or yield of zero gives an array size or energy of zero. No module fitting is an answer, not a warning: a facet too small for its setbacks shows 0. A CHECK: verdict comes with the figures; a NOT VALID: verdict is shown in place of them, and every computed figure reads zero while the drawn areas still show.
The roof checks are exact. Every roof point and every outline point is first read to the nearest point of a 25 micrometre grid, 12,192 steps to the foot or 40,000 to the metre. Every point is read at the nearest point of a 25 micrometre grid, at most about 17.7 micrometres from the value the page sends (12.5 along x and along y), so a point on the drawing tool's 1/8 in, 1 mm or 0.5 mm grid is read exactly. A drawing converted by the page's US/Metric switch is read the same way. A point that is more than 1,500 ft (450 m) from the origin along x or y once rounded to that grid is refused and named as the drawing sent it, to 15 significant digits; within that bound the spreadsheet's arithmetic on the grid points is exact. Every roof figure is computed from the grid points; the plan area, the plan area less exclusions and the exclusion areas are measured from the points as sent. Facets are named by their exact IDs: letter case counts, and *, ? and ~ are ordinary characters, so a line whose facet is named F* names no facet unless one is listed as F*. On the grid every test that decides whether the facets cover the outline is done in whole numbers, with no tolerance and no exception near a corner: two corners are the same only when their grid points are, two roof edges may meet only at a shared end (a crossing, an end on another edge's interior, such as an unsplit T-junction, or a line along another is refused), each outline piece must lie exactly on one side of the outline, each facet is read just to its side of the middle of each of its edges, and the outline's own sides may not cross or touch. Where a roof line lands inside a side of the outline, the drawing tool writes that point into the outline too, so the outline and the roof line are read at the same grid point. Together with the loop, drawn-twice and naming checks, these prove that the facets partition the outline as read on the grid: no two overlap and together they leave no gap, so each facet's area is its share of that outline's.
Assumptions and limitations
- Modules are packed in rows from the top of each facet and from the left end of each free stretch of a row; the count is exact for that packing but is not the most that could ever fit, since a layout shifted along a row or down the slope can sometimes hold one more.
- Modules are laid in portrait, edge to edge in rows down each facet's slope, with no spacing or racking and no landscape rows; swap the width and length for landscape.
- A facet holds at most 12 rows of 24 modules as counted here, and a facet of more than 16 edges gets none; the status says when either limit is reached.
- The setbacks are measured in plan, which leaves at least as much clear along the slope. The setback from ridges, hips and valleys applies to every roof line; the residential code names only the horizontal ridge, so its use at hips, valleys, pitch changes and wall lines is this calculator's product choice. Review the setbacks before use: your fire and building officials set them.
- The 33% check reads the residential code's ridge setback rule (IRC R324.6.2) for a roof steeper than 2:12, and does not move the modules; a sprinkler system, which raises 33% to 66% in the code, is not asked. Fire pathways from the eave to the ridge (IRC R324.6.1) are not laid out.
- Each facet's energy is the yield per kW you type scaled by its orientation factor, from monthly average days with one clearness index for the whole year, an isotropic sky and a ground reflectance of 0.2. It takes no account of shading by trees, buildings or other facets, of the modules' temperature or of the system's losses, which the yield per kW you type must carry; it compares directions and tilts at one site, and is not a production guarantee. The sun's path is computed for latitudes from -60 to 60 degrees.
- Each vent or chimney blocks the smallest upright rectangle around it on the drawing, taken into each facet's frame, which can block more modules than its own outline would, never fewer.
- The heights of the facets assume every outline eave is at one level; the check on meeting heights says when they are not.
- A facet slopes one way, set by its level edges; a curved or warped roof is drawn as flat facets.
- No shading, inverter, wiring or other electrical design, and no pricing.
- The spreadsheet does not assume that the facets come from the drawing tool, and with the roof drawn it tests the outline too. It reads every roof point and outline point to the nearest 25 micrometres, checks the roof tables against the outline exactly on those points, and refuses them unless every point, once rounded to that grid, is within 1,500 ft (450 m) of the origin along x and y, every roof edge has an ID no other edge has and two different ends, every facet an edge names is listed under exactly that ID, every facet listed is bounded by some edge, the facets' plan areas sum to the outline's, each facet's lines close into a loop, no line is drawn twice or crosses, overlaps or touches another away from their shared corners, the outline pieces total its perimeter (within 1/2 in, 1 cm) and each lies exactly on one side of the outline, each facet is on the side its lines name, the outline does not touch itself at a corner (no corner where two outline pieces start, or two end), and no side of the outline crosses or touches another. It does not check the order the edges and facets are listed in. Every figure and the choice among OK, CHECK and NOT VALID are independent of that order: each facet's downhill direction and the eave its heights are measured from come from its reference level edge (an outline eave if it has one, else any of its level edges, the one that sorts first by its corners), not from the first one listed. Row order can change which qualifying edge or facet a status line names, since it reports the first one in the list, and the Facets order sets the order of the "Each facet" table's rows. The calculator is offered on its web page only, because the roof is drawn there.
- An edge that crosses another, has another's end on its interior, or passes within 1/2 in (1 cm) of another edge's midpoint is refused as touching, so a very narrow facet, about 1 in (2 cm) wide or less, can be refused. The drawing tool can draw one (on its 1 in, 1 cm or 2 cm grid, or as a corner almost on a long line at a shallow angle); draw facets wider than that.
- Drawing needs a mouse, a pen or a touch screen; a drawing prepared elsewhere can be loaded with Import.
Restrictions and non-computing states
This calculator accepts a pitch from 0 to 36 in 12, setbacks from 0 to 50 ft (15 m), a module width and length from 0 to 10 ft (3 m), of which zero is refused by the status line, a module rating from 0 to 2 kW and a yield from 0 to 3,000 kWh per kW, a latitude from -60 to 60 degrees and a clearness index from 0.30 to 0.75; the drawing sends a north bearing from 0 to 359.9 degrees, or blank. A figure outside its bounds is refused before the spreadsheet is asked. The drawing always sends its three roof tables, so they are required: a request without them is refused before the spreadsheet is asked. An input of the system that is not selected is not read. Nothing is sent until you press Calculate, and pressing it again on an unchanged drawing with unchanged inputs sends nothing.
Errors and warnings
A blank required input keeps Calculate from sending, and pressing it names the input and moves to it. If the calculation service refuses an input, the status line names it. If the service does not answer, the page says so, keeps your drawing, your inputs and the last result, and lets you press Calculate again. A CHECK: status means the figures are returned with a reason to look again; a NOT VALID: status means they cannot be computed and none are shown.
References
Sources and further reading
- National Institute of Standards and Technology, Guide for the Use of the International System of Units (SI), NIST Special Publication 811, Appendix B.8. nist.gov. The exact foot (0.3048 m) and inch (2.54 cm) behind the drawing's two systems, and the exact square foot (0.09290304 m²). The Metric setbacks and module sizes this calculator opens with are the US figures converted with that foot: 3 ft is 0.9144 m, 1.5 ft is 0.4572 m, 3.4 ft is 1.03632 m and 5.6 ft is 1.70688 m.
- Eric W. Weisstein, "Polygon Area," MathWorld, Wolfram Research. mathworld.wolfram.com/PolygonArea.html. The shoelace formula for the area of a polygon from its corners, which the spreadsheet uses for the outline, for each facet and for each vent or chimney.
- Eric W. Weisstein, "Pythagorean Theorem," MathWorld, Wolfram Research. mathworld.wolfram.com/PythagoreanTheorem.html. a² + b² = c², which gives the length of a slope from its run and rise, and so each facet's pitch factor and the depth in plan of one row of modules.
- International Residential Code 2021, section R324.6, roof access and pathways, and R324.6.2, setback at ridge, as adopted by the Colorado Division of Fire Prevention and Control and published by UpCodes. up.codes/s/roof-access-and-pathways, up.codes/s/setback-at-ridge. An 18 in (457 mm) clear setback on both sides of a horizontal ridge for an array of not more than 33% of the plan view total roof area, 36 in (914 mm) above that, and the exception for roofs of 2 units in 12 or less: the basis of the ridge setback's default and of the 33% check. Pathways from the lowest roof edge to the ridge are required too; this calculator does not lay them out. Review before use: your fire and building officials set the setbacks that apply to your roof.
- S. A. Klein, "Calculation of monthly average insolation on tilted surfaces," Solar Energy 19 (1977) 325-329, and its University of Wisconsin-Madison Solar Energy Laboratory report, UNT Digital Library. digital.library.unt.edu/ark:/67531/metadc1408964. The monthly average days, the sunlight above the atmosphere on level ground, the monthly ratio of direct sunlight on a tilted surface to that on level ground for a surface facing the equator or turned east or west of it (this calculator takes the same integral over the hours the sun is above both the horizon and the surface for every azimuth), and Liu and Jordan's isotropic-sky sum of the direct, diffuse and ground-reflected sunlight on the surface: the method behind each facet's orientation factor. Its monthly tables are the figures the method was checked against.
- D. G. Erbs, S. A. Klein and J. A. Duffie, "Estimation of the diffuse radiation fraction for hourly, daily and monthly-average global radiation," Solar Energy 28 (1982) 293-302. The monthly correlation that gives the diffuse share of the sunlight on level ground from the clearness index and the sunset hour angle.
- B. Y. H. Liu and R. C. Jordan, "Daily insolation on surfaces tilted toward the equator," Trans. ASHRAE 67 (1962). The isotropic-sky sum of the direct, diffuse and ground-reflected sunlight on a tilted surface.
Links were current at build time. If one moves, search the document's title rather than reporting a broken link as a defect.
The default pitch, setbacks, module size, module rating and annual yield are the figures of the worked examples and the requirement this calculator was built to, and the default latitude (40) and clearness index (0.50) are example values, not values from these sources or from any datasheet or site survey; the Metric setbacks and module sizes are the US ones converted exactly. These sources describe the units, the geometry, the sun's path and the sunlight on a tilted surface, and the code's setbacks; they do not certify a particular roof, module or array. Your fire and building officials set the real setbacks, your module's datasheet its size and rating, and an estimate for your own site its yearly yield: use those, and check the layout before ordering.
Found a problem, or have an idea?
Tell us if a result looks wrong, a label is unclear, or something is missing. We read every message.