function calculateDiversionRate() {
// Get inputs
var recycled = parseFloat(document.getElementById('weightRecycled').value);
var composted = parseFloat(document.getElementById('weightComposted').value);
var reused = parseFloat(document.getElementById('weightReused').value);
var landfill = parseFloat(document.getElementById('weightLandfill').value);
// Validate inputs
if (isNaN(recycled)) recycled = 0;
if (isNaN(composted)) composted = 0;
if (isNaN(reused)) reused = 0;
if (isNaN(landfill)) landfill = 0;
// Logic
var totalDiverted = recycled + composted + reused;
var totalGenerated = totalDiverted + landfill;
var diversionRate = 0;
if (totalGenerated > 0) {
diversionRate = (totalDiverted / totalGenerated) * 100;
} else {
diversionRate = 0;
}
// Display Results
document.getElementById('displayDiverted').innerText = totalDiverted.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 2});
document.getElementById('displayGenerated').innerText = totalGenerated.toLocaleString(undefined, {minimumFractionDigits: 0, maximumFractionDigits: 2});
document.getElementById('displayRate').innerText = diversionRate.toFixed(2);
document.getElementById('resultsArea').style.display = 'block';
// Dynamic Message
var messageEl = document.getElementById('calcMessage');
if (diversionRate >= 90) {
messageEl.innerText = "Excellent! You are approaching Zero Waste standards.";
messageEl.style.color = "#27ae60";
} else if (diversionRate >= 50) {
messageEl.innerText = "Good job! You are diverting the majority of your waste.";
messageEl.style.color = "#f39c12";
} else {
messageEl.innerText = "There is room for improvement. Look for more recycling opportunities.";
messageEl.style.color = "#c0392b";
}
}
function resetCalculator() {
document.getElementById('weightRecycled').value = ";
document.getElementById('weightComposted').value = ";
document.getElementById('weightReused').value = ";
document.getElementById('weightLandfill').value = ";
document.getElementById('resultsArea').style.display = 'none';
}
Understanding Waste Diversion Rate
The Diversion Rate is a critical metric in sustainability and waste management. It measures the percentage of waste materials that are prevented from ending up in a landfill or incinerator through alternative methods such as recycling, composting, or reuse.
Tracking this metric is essential for businesses seeking LEED certification, municipalities monitoring recycling programs, or organizations aiming for "Zero Waste" status. A higher diversion rate indicates a more efficient resource management system and a lower environmental footprint.
The Formula
The diversion rate is calculated by dividing the weight of diverted materials by the total weight of all waste generated, then multiplying by 100 to get a percentage.
Diversion Rate % = (Weight of Diverted Waste ÷ Total Waste Generated) × 100
Where:
Diverted Waste: The sum of Recycled + Composted + Reused materials.
Total Waste Generated: The sum of Diverted Waste + Landfill (Trash) Waste.
Calculation Example
Let's look at a practical example for a small office building over the course of one month: