Description
Return balances=available-needed, totalSurplus=sum(max(0,balance)), and totalDeficit=sum(max(0,-balance)).
Garden and resource-design calculations combine measured lengths, areas, water volumes, material fractions, travel, and evidence records. A useful budget needs consistent units and clear overlap, exclusion, and denominator rules. Supplied geometry and efficiencies describe a model rather than verified site performance.
Return balances=available-needed, totalSurplus=sum(max(0,balance)), and totalDeficit=sum(max(0,-balance)).
When to use this tool
Use Garden Resource Surplus Deficit Balance when you have supplied site dimensions or resource records and need the stated geometry, budget, or coverage measure.
How to use the tool and how it works
- Enter available, needed. Keep parallel arrays aligned. Use the units and conventions below.
- Run the tool. Correct any format, range, or cross-field input error before interpreting the output.
- Read balances, totalSurplus, totalDeficit. Use the output convention below.
Require aligned nonnegative available and needed arrays. Return balances=available-needed, totalSurplus=sum(max(0,balance)), and totalDeficit=sum(max(0,-balance)).1
| Input field | Meaning and units | Accepted input |
|---|---|---|
| available | Available | Required. Array of finite number; maximum items 256. |
| needed | Needed | Required. Array of finite number; maximum items 256. |
| Output field | Interpretation | Returned shape |
|---|---|---|
| balances | Balances | Required. Array of finite number; maximum items 256. |
| totalSurplus | Total Surplus | Required. Finite number. |
| totalDeficit | Total Deficit | Required. Finite number. |
{
"input": {
"available": [
10,
5,
8
],
"needed": [
7,
9,
8
]
},
"output": {
"balances": [
3,
-4,
0
],
"totalSurplus": 3,
"totalDeficit": 4
}
} Limitations and assumptions
- Entries need a meaningful common resource unit for totals. Surpluses are not automatically transferred between categories, and the calculation does not establish a feasible resource distribution.
- Inputs must satisfy both the field types and the cross-field conditions above. Invalid input causes an error; a successful false flag or documented placeholder is a different result.
- Numeric calculations use binary floating point unless exact decimal-integer arithmetic is explicitly stated. No hidden measurement tolerance or decimal rounding is added; nonfinite or out-of-contract results are rejected. Signed zero is exported as zero.
Alternative or Complementary methods
Use verified site measurements and suitable physical or resource models for a complete design. Check units, overlap, losses, capacity, and whether an accounting share represents the intended quantity.
References
Similar or alternative tools
- Garden Contour Offset Gradient Term
Signed elevation offset under an explicitly supplied local grade.
- Garden Sector Angle Span Wrap
Measure an explicitly directed modular sector span and equal-endpoint policy.