How to Calculate Weight Retained in Sieve Analysis

Calculate Weight Retained in Sieve Analysis – Step-by-Step Guide :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –card-background: #ffffff; –border-color: #ddd; –shadow-color: rgba(0, 0, 0, 0.1); } body { font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; background-color: var(–background-color); color: var(–text-color); margin: 0; padding: 0; line-height: 1.6; } .container { max-width: 1000px; margin: 20px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: 0 2px 10px var(–shadow-color); display: flex; flex-direction: column; align-items: center; } h1, h2, h3 { color: var(–primary-color); text-align: center; margin-bottom: 20px; } h1 { font-size: 2.5em; } h2 { font-size: 1.8em; margin-top: 30px; border-bottom: 2px solid var(–primary-color); padding-bottom: 5px; } h3 { font-size: 1.3em; margin-top: 25px; } .calc-wrapper { width: 100%; max-width: 600px; margin: 20px 0; padding: 25px; background-color: var(–card-background); border-radius: 8px; box-shadow: 0 2px 10px var(–shadow-color); } .input-group { margin-bottom: 20px; width: 100%; } .input-group label { display: block; font-weight: bold; margin-bottom: 8px; color: var(–primary-color); } .input-group input[type="number"], .input-group select { width: calc(100% – 22px); padding: 10px; border: 1px solid var(–border-color); border-radius: 5px; font-size: 1em; margin-bottom: 5px; box-sizing: border-box; } .input-group .helper-text { font-size: 0.85em; color: #666; margin-top: 5px; } .error-message { color: red; font-size: 0.9em; margin-top: 5px; display: none; min-height: 1.2em; /* Prevent layout shifts */ } .button-group { display: flex; justify-content: space-between; margin-top: 30px; gap: 10px; } .button-group button { padding: 12px 20px; border: none; border-radius: 5px; cursor: pointer; font-size: 1em; font-weight: bold; transition: background-color 0.3s ease, transform 0.2s ease; flex-grow: 1; } .button-group button:hover { opacity: 0.9; transform: translateY(-1px); } .button-calculate { background-color: var(–primary-color); color: white; } .button-reset { background-color: #6c757d; color: white; } .button-copy { background-color: #17a2b8; color: white; margin-top: 10px; } .results-display { margin-top: 30px; padding: 25px; background-color: var(–primary-color); color: white; border-radius: 8px; text-align: center; box-shadow: 0 4px 15px rgba(0, 74, 153, 0.4); } .results-display h3 { color: white; margin-bottom: 15px; } .results-display .main-result-value { font-size: 2.5em; font-weight: bold; display: block; margin-bottom: 10px; } .results-display .main-result-label { font-size: 1.1em; display: block; margin-bottom: 20px; } .intermediate-results { margin-top: 20px; padding: 15px; background-color: rgba(255, 255, 255, 0.15); border-radius: 5px; display: flex; flex-direction: column; gap: 10px; } .intermediate-results div { display: flex; justify-content: space-between; font-size: 0.95em; } .intermediate-results span:first-child { font-weight: bold; } table { width: 100%; border-collapse: collapse; margin-top: 30px; margin-bottom: 30px; box-shadow: 0 2px 5px var(–shadow-color); } th, td { padding: 12px 15px; text-align: left; border-bottom: 1px solid var(–border-color); } thead { background-color: var(–primary-color); color: white; } tbody tr:nth-child(even) { background-color: #f2f2f2; } tbody tr:hover { background-color: #e9ecef; } caption { caption-side: bottom; font-style: italic; color: #666; margin-top: 10px; text-align: center; font-size: 0.9em; } canvas { margin-top: 30px; background-color: var(–card-background); border-radius: 8px; box-shadow: 0 2px 10px var(–shadow-color); display: block; /* Remove extra space below canvas */ } .article-content { width: 100%; max-width: 960px; margin: 30px auto; padding: 20px; background-color: var(–card-background); border-radius: 8px; box-shadow: 0 2px 10px var(–shadow-color); text-align: left; } .article-content p { margin-bottom: 15px; } .article-content a { color: var(–primary-color); text-decoration: none; } .article-content a:hover { text-decoration: underline; } .article-content ul, .article-content ol { margin-left: 20px; margin-bottom: 15px; } .article-content li { margin-bottom: 8px; } .related-tools { margin-top: 40px; padding: 25px; background-color: var(–card-background); border-radius: 8px; box-shadow: 0 2px 10px var(–shadow-color); } .related-tools h3 { color: var(–primary-color); border-bottom: 2px solid var(–primary-color); padding-bottom: 5px; } .related-tools ul { list-style: none; padding: 0; } .related-tools li { margin-bottom: 15px; } .related-tools a { font-weight: bold; } .related-tools p { font-size: 0.9em; color: #555; margin-top: 5px; } /* Responsive adjustments */ @media (max-width: 768px) { .container { margin: 10px; padding: 15px; } h1 { font-size: 1.8em; } h2 { font-size: 1.5em; } .calc-wrapper, .article-content, .related-tools { padding: 20px; } .button-group { flex-direction: column; gap: 15px; } .button-group button { width: 100%; } .results-display .main-result-value { font-size: 2em; } }

How to Calculate Weight Retained in Sieve Analysis

Sieve Analysis Weight Calculator

Input the details of your sieve analysis to calculate the weight retained on each sieve and determine the cumulative percentage retained.

The initial total weight of the material being tested.

Analysis Results

0.00% Overall Percentage Passing Smallest Sieve
Total Weight Retained (g) 0.00
Total Percentage Retained (%) 0.00%
Material Loss (%) 0.00%

Formula: Weight Retained = Initial Weight – Weight Passing

Percentage Retained = (Weight Retained / Total Sample Weight) * 100

Percentage Finer = 100 – Total Percentage Retained

Particle Size Distribution Chart
Sieve Size (mm) Weight Retained (g) Percentage Retained (%) Cumulative Percentage Retained (%) Percentage Passing (%)
Sieve Analysis Data Summary

Understanding how to calculate weight retained in sieve analysis is fundamental in various engineering disciplines, especially in civil engineering and geology, for characterizing granular materials. This process determines the particle size distribution of a sample, which is crucial for predicting material behavior and performance. This guide provides a comprehensive explanation and an interactive calculator to help you perform these calculations accurately.

What is Sieve Analysis?

Sieve analysis is a common laboratory test used to determine the particle size distribution of a granular material by passing a sample through a series of sieves with progressively smaller mesh openings. The amount of material retained on each sieve is measured, allowing for the calculation of the percentage of particles that fall within specific size ranges. This information is critical for applications in construction (e.g., soil, aggregates for concrete, asphalt), mining, and environmental science.

Who should use it: This technique is essential for civil engineers, geotechnical engineers, geologists, materials scientists, and researchers working with soils, aggregates, sands, gravels, and other granular materials. Anyone involved in material specification, quality control, or performance prediction based on particle size will find sieve analysis invaluable.

Common misconceptions: A frequent misunderstanding is that sieve analysis gives the exact size of every particle. Instead, it groups particles into ranges based on sieve openings. Another misconception is that the total weight retained must always equal the initial sample weight; minor losses or gains are expected due to fine dust or breakage, though significant deviations indicate procedural errors.

Sieve Analysis Formula and Mathematical Explanation

The core of sieve analysis involves calculating the weight of material retained on each sieve and then determining the percentages relative to the total sample weight. Here's a breakdown of the process:

Step 1: Measure Total Sample Weight

Begin by accurately weighing the entire sample of granular material you intend to test. This is your baseline measurement.

W_total = Total Sample Weight

Step 2: Perform Sieve Shaking

Stack the sieves in order, from the largest mesh opening at the top to the smallest at the bottom. Place the weighed sample on the top sieve. Agitate the stack of sieves for a sufficient duration (e.g., 10-15 minutes) to ensure all particles pass through the appropriate sieve openings. The bottom of the stack should have a pan to collect any material passing the finest sieve.

Step 3: Weigh Material on Each Sieve

Carefully remove each sieve and weigh the material retained on it. Record these weights.

W_retained_i = Weight retained on sieve 'i'

Step 4: Calculate Weight Loss or Gain

After weighing all retained materials, weigh the material collected in the bottom pan (fines). Sum all the weights of the retained materials and the fines. Compare this sum to the initial total sample weight.

W_sum_measured = Sum of all W_retained_i + Weight of fines in pan

W_loss = W_total – W_sum_measured

A small loss or gain is acceptable (typically ±1-2%), but significant discrepancies may require repeating the test.

Step 5: Calculate Percentage Retained for Each Sieve

For each sieve, calculate the percentage of the total sample that was retained on it:

% Retained_i = (W_retained_i / W_total) * 100

Step 6: Calculate Cumulative Percentage Retained

This is the total percentage of the sample retained on a specific sieve AND all sieves above it (with larger openings).

% Cumulative Retained_i = Sum of % Retained for sieve 'i' and all sieves above it.

Alternatively, you can calculate it cumulatively:

% Cumulative Retained_i = % Cumulative Retained_{i-1} + % Retained_i (where sieve i-1 is the sieve directly above sieve i)

The cumulative percentage retained on the top-most sieve will be equal to the percentage retained on that sieve.

Step 7: Calculate Percentage Passing

The percentage passing the smallest sieve (which is the percentage of fines collected in the pan if it's the last item) is calculated as:

% Passing_i = 100 – % Cumulative Retained_i

For the very last sieve (smallest opening), the % Passing is typically the % of fines collected in the pan.

The overall percentage passing the smallest sieve is often the most critical overall metric.

Variables Table

Variable Meaning Unit Typical Range
W_total Initial total weight of the sample grams (g) 100 – 5000 g (depends on application)
W_retained_i Weight of material retained on sieve 'i' grams (g) 0 – W_total
W_sum_measured Sum of all measured weights (retained + pan) grams (g) Close to W_total
% Retained_i Percentage of sample retained on sieve 'i' % 0 – 100%
% Cumulative Retained_i Total percentage of sample retained on sieve 'i' and all larger sieves % 0 – 100%
% Passing_i Percentage of sample that passed sieve 'i' % 0 – 100%
Sieve Size Aperture size of the sieve mesh mm or inches 0.075 mm (No. 200) to > 100 mm

Practical Examples

Example 1: Soil Sample for Foundation Design

A geotechnical engineer is testing a soil sample for a new building foundation. They use a standard set of sieves and obtain the following results:

  • Total Sample Weight (W_total): 1500 g

After sieving and weighing:

  • Sieve 4.75 mm (No. 4): 350 g retained
  • Sieve 2.36 mm (No. 8): 420 g retained
  • Sieve 1.18 mm (No. 16): 300 g retained
  • Sieve 0.60 mm (No. 30): 210 g retained
  • Sieve 0.30 mm (No. 50): 150 g retained
  • Sieve 0.15 mm (No. 100): 40 g retained
  • Pan (fines < 0.15 mm): 30 g collected

Calculations:

  • Sum of Measured Weights = 350 + 420 + 300 + 210 + 150 + 40 + 30 = 1500 g. (Perfect match, no loss).
  • % Retained (4.75mm) = (350 / 1500) * 100 = 23.33%
  • % Retained (2.36mm) = (420 / 1500) * 100 = 28.00%
  • % Retained (1.18mm) = (300 / 1500) * 100 = 20.00%
  • % Retained (0.60mm) = (210 / 1500) * 100 = 14.00%
  • % Retained (0.30mm) = (150 / 1500) * 100 = 10.00%
  • % Retained (0.15mm) = (40 / 1500) * 100 = 2.67%
  • % Retained (Pan) = (30 / 1500) * 100 = 2.00%
  • Cumulative % Retained (4.75mm) = 23.33%
  • Cumulative % Retained (2.36mm) = 23.33% + 28.00% = 51.33%
  • Cumulative % Retained (1.18mm) = 51.33% + 20.00% = 71.33%
  • Cumulative % Retained (0.60mm) = 71.33% + 14.00% = 85.33%
  • Cumulative % Retained (0.30mm) = 85.33% + 10.00% = 95.33%
  • Cumulative % Retained (0.15mm) = 95.33% + 2.67% = 98.00%
  • Percentage Passing (Pan) = 100% – 98.00% = 2.00%

Interpretation: The soil is predominantly coarse-grained, with over 51% retained on the 2.36 mm sieve. Only 2% of the material is finer than 0.15 mm. This classification helps determine the soil's suitability for specific foundation types, drainage characteristics, and compaction requirements.

Example 2: Aggregate Gradation for Concrete

A materials engineer is checking the aggregate gradation for a concrete mix to ensure it meets specifications. They have a sample:

  • Total Sample Weight (W_total): 5000 g

After sieving:

  • Sieve 37.5 mm (1.5″): 0 g retained
  • Sieve 19.0 mm (3/4″): 750 g retained
  • Sieve 9.5 mm (3/8″): 1600 g retained
  • Sieve 4.75 mm (No. 4): 1150 g retained
  • Sieve 2.36 mm (No. 8): 800 g retained
  • Sieve 0.075 mm (No. 200): 700 g (This includes material passing the No. 8 sieve down to the No. 200 sieve)
  • Pan (< 0.075 mm): 0 g (Assume no material passed the No. 200 sieve for this simplified example, or it was negligible)

Calculations:

  • Sum of Measured Weights = 0 + 750 + 1600 + 1150 + 800 + 700 = 5000 g. (Perfect match).
  • % Retained (19.0mm) = (750 / 5000) * 100 = 15.00%
  • % Retained (9.5mm) = (1600 / 5000) * 100 = 32.00%
  • % Retained (4.75mm) = (1150 / 5000) * 100 = 23.00%
  • % Retained (2.36mm) = (800 / 5000) * 100 = 16.00%
  • % Retained (0.075mm) = (700 / 5000) * 100 = 14.00%
  • Cumulative % Retained (19.0mm) = 15.00%
  • Cumulative % Retained (9.5mm) = 15.00% + 32.00% = 47.00%
  • Cumulative % Retained (4.75mm) = 47.00% + 23.00% = 70.00%
  • Cumulative % Retained (2.36mm) = 70.00% + 16.00% = 86.00%
  • Cumulative % Retained (0.075mm) = 86.00% + 14.00% = 100.00%
  • Percentage Passing (0.075mm) = 100% – 100.00% = 0.00%

Interpretation: The aggregate has a good distribution of sizes, with significant amounts in the larger ranges (19.0 mm, 9.5 mm) and a substantial portion passing the 4.75 mm sieve but retained on the 0.075 mm sieve. This suggests it could be suitable for concrete, but further comparison against specific concrete mix design standards (e.g., ASTM C33) is required.

How to Use This Sieve Analysis Calculator

Our interactive calculator simplifies the process of how to calculate weight retained in sieve analysis. Follow these steps:

  1. Enter Total Sample Weight: Input the initial weight of your material sample in grams into the 'Total Sample Weight (g)' field.
  2. Add Sieve Data: Click the "Add Sieve" button. For each sieve used in your test, enter the sieve size (in mm or other consistent units) and the weight of material retained on that specific sieve (in grams). Make sure to add the weight collected in the final pan as well.
  3. Calculate Results: Once all your data is entered, click the "Calculate Results" button.
  4. Review Results: The calculator will display:
    • Total Weight Retained (g): The sum of all weights you entered. This should ideally match your initial total sample weight.
    • Total Percentage Retained (%): The sum of the percentage retained on each sieve. This should be close to 100%.
    • Material Loss (%): The difference between your initial total sample weight and the sum of the measured weights, expressed as a percentage.
    • Overall Percentage Passing Smallest Sieve: This is the primary result, indicating the proportion of your sample finer than the smallest sieve opening.
  5. View Table and Chart: A detailed table and a visual chart (particle size distribution curve) will be generated, showing the breakdown by sieve size.
  6. Copy Results: Use the "Copy Results" button to easily transfer the main findings and key metrics to your reports.
  7. Reset: Use the "Reset" button to clear all fields and start over.

Decision-Making Guidance: The results of the sieve analysis, particularly the percentage passing key sieve sizes and the overall shape of the particle size distribution curve, are used to classify materials (e.g., soil type, aggregate quality) and predict their engineering properties like permeability, workability, and strength. For instance, a well-graded aggregate (a wide range of particle sizes) generally leads to denser, stronger concrete.

Key Factors That Affect Sieve Analysis Results

Several factors can influence the outcome of a sieve analysis and must be carefully managed:

  1. Sample Size: The total sample weight must be representative of the material being tested. If the sample is too small, it might not capture the full range of particle sizes present. If it's too large for the sieves used, it can lead to blinding (clogging) of the mesh.
  2. Sieve Selection: The choice of sieve sizes is critical. They must cover the expected range of particle sizes for the material and application. Using sieves that are too close together may not provide sufficient detail, while gaps in the sieve series might miss important size fractions. A standard set of sieves based on ASTM or relevant national standards is recommended.
  3. Sieving Duration and Method: Insufficient sieving time means particles may not have had enough opportunity to pass through their corresponding openings, leading to higher retained weights. Over-sieving (especially with certain materials) could potentially cause particle degradation, affecting results. Mechanical sieving machines are preferred for consistency over manual shaking.
  4. Moisture Content: For some materials, especially fine-grained soils, testing dry can lead to agglomeration (clumping) of particles, causing them to be retained on larger sieves than their actual size. Wet sieving is often necessary for materials prone to clogging fine sieves.
  5. Sieve Condition: Worn, damaged, or dirty sieves can produce inaccurate results. Sieves should be regularly inspected for bent wires, enlarged openings, or accumulated debris. Calibration and cleaning are essential.
  6. Data Recording Accuracy: Errors in weighing the sample or the retained materials directly impact all subsequent calculations. Precise measurements and careful recording are paramount. Double-checking recorded weights against the initial total weight is a crucial quality control step.
  7. Material Properties: The inherent properties of the material, such as particle shape (e.g., angular vs. rounded aggregates), specific gravity, and susceptibility to breakage, can influence how easily particles pass through sieves.

Frequently Asked Questions (FAQ)

Q1: What is the standard procedure for sieve analysis?
A1: The standard procedure, often based on ASTM D6913 or similar standards, involves selecting a representative sample, weighing it, arranging a series of sieves by size, sieving the material, weighing the retained material on each sieve, and then calculating percentages.
Q2: How do I know which sieve sizes to use?
A2: Sieve selection depends on the material and its intended use. For general soil classification, ASTM D422 (now largely superseded by D6913) or related standards provide common sieve series. For aggregates, standards like ASTM C136 specify typical sieve sizes.
Q3: What is considered an acceptable percentage of material loss?
A3: Typically, a material loss or gain of 1% to 2% is considered acceptable. Larger deviations usually indicate errors in weighing, sample handling, or the sieving process itself, potentially requiring the test to be repeated.
Q4: Can I use this for any granular material?
A4: Sieve analysis is suitable for most granular materials like soils, sand, gravel, crushed stone, and powders. For materials that are sticky or tend to agglomerate, wet sieving might be necessary. It's not suitable for materials that dissolve or degrade significantly when agitated.
Q5: What does a "well-graded" material mean?
A5: A well-graded material contains a wide range of particle sizes, with relatively uniform amounts of each size. This typically results in a dense, strong material with good compaction characteristics and low permeability, desirable for many construction applications.
Q6: What is the difference between % Retained and Cumulative % Retained?
A6: % Retained is the proportion of the total sample found on a single sieve. Cumulative % Retained is the total proportion of the sample found on that sieve PLUS all sieves above it (i.e., all larger particles).
Q7: How do I interpret the particle size distribution curve?
A7: The curve plots % Finer (or % Passing) against particle size on a logarithmic scale. A steep slope indicates a narrow range of sizes (poorly graded), while a more gradual, extended curve indicates a wider range of sizes (well-graded).
Q8: Can sieve analysis determine the exact size of each particle?
A8: No. Sieve analysis categorizes particles into size ranges defined by the sieve openings. It does not measure the exact dimension of individual particles.

© 2023 Your Company Name. All rights reserved.

var initialTotalSampleWeight = 1000; // Sensible default var sieveCounter = 0; function addSieveInput() { sieveCounter++; var container = document.getElementById('sieveInputsContainer'); var newSieveDiv = document.createElement('div'); newSieveDiv.setAttribute('class', 'input-group sieve-entry'); newSieveDiv.setAttribute('id', 'sieveEntry' + sieveCounter); newSieveDiv.innerHTML = '' + " + '
' + '' + " + '
' + '
Weight retained on this sieve
' + ''; container.appendChild(newSieveDiv); } function removeSieveInput(idToRemove) { var entryToRemove = document.getElementById('sieveEntry' + idToRemove); if (entryToRemove) { entryToRemove.parentNode.removeChild(entryToRemove); } // Recalculate immediately after removal calculateSieveAnalysis(); } function resetCalculator() { document.getElementById('totalSampleWeight').value = initialTotalSampleWeight; document.getElementById('sieveInputsContainer').innerHTML = "; sieveCounter = 0; document.getElementById('resultsDisplay').style.display = 'none'; document.getElementById('chartContainer').style.display = 'none'; document.getElementById('sieveDataTableContainer').style.display = 'none'; clearAllErrorMessages(); } function validateInput(inputId, errorId, minValue, maxValue) { var input = document.getElementById(inputId); var errorElement = document.getElementById(errorId); var value = parseFloat(input.value); var isValid = true; errorElement.style.display = 'none'; // Hide previous error if (isNaN(value)) { errorElement.textContent = 'Please enter a valid number.'; errorElement.style.display = 'block'; isValid = false; } else if (value < 0) { errorElement.textContent = 'Value cannot be negative.'; errorElement.style.display = 'block'; isValid = false; } else if (minValue !== undefined && value maxValue) { errorElement.textContent = 'Value cannot exceed ' + maxValue + '.'; errorElement.style.display = 'block'; isValid = false; } return isValid; } function clearAllErrorMessages() { var errorElements = document.querySelectorAll('.error-message'); for (var i = 0; i < errorElements.length; i++) { errorElements[i].style.display = 'none'; errorElements[i].textContent = ''; } } function calculateSieveAnalysis() { clearAllErrorMessages(); var totalSampleWeightInput = document.getElementById('totalSampleWeight'); if (!validateInput('totalSampleWeight', 'totalSampleWeightError', 0)) { return; } var W_total = parseFloat(totalSampleWeightInput.value); var sieveEntries = document.querySelectorAll('.sieve-entry'); var sieveData = []; var totalWeightRetainedSum = 0; var validInputs = true; for (var i = 0; i W_total) { // Basic check document.getElementById(weightRetainedErrorId).textContent = 'Weight retained cannot exceed total sample weight.'; document.getElementById(weightRetainedErrorId).style.display = 'block'; validInputs = false; } if (validInputs) { sieveData.push({ size: sieveSize, retained: weightRetained }); totalWeightRetainedSum += weightRetained; } } if (!validInputs) return; // Stop if any validation failed // Sort sieve data by size in descending order (largest sieve first) sieveData.sort(function(a, b) { return b.size – a.size; }); var resultsDisplay = document.getElementById('resultsDisplay'); var chartContainer = document.getElementById('chartContainer'); var sieveDataTableContainer = document.getElementById('sieveDataTableContainer'); var cumulativeRetainedPercentage = 0; var percentagePassingSmallestSieve = 0; var totalPercentageRetained = 0; var materialLoss = W_total – totalWeightRetainedSum; var materialLossPercentage = (materialLoss / W_total) * 100; var tableHtml = "; var percentagePassingValues = []; var percentageRetainedValues = []; var sieveSizesForChart = []; for (var i = 0; i < sieveData.length; i++) { var weightRetained = sieveData[i].retained; var percentageRetained = (weightRetained / W_total) * 100; cumulativeRetainedPercentage += percentageRetained; var percentagePassing = 100 – cumulativeRetainedPercentage; // Ensure percentagePassing doesn't go below 0 due to rounding/loss percentagePassing = Math.max(0, percentagePassing); percentagePassingValues.push(percentagePassing); percentageRetainedValues.push(percentageRetained); sieveSizesForChart.push(sieveData[i].size); tableHtml += '' + '' + sieveData[i].size.toFixed(2) + '' + '' + weightRetained.toFixed(2) + '' + '' + percentageRetained.toFixed(2) + '%' + '' + cumulativeRetainedPercentage.toFixed(2) + '%' + '' + percentagePassing.toFixed(2) + '%' + ''; if (i === sieveData.length – 1) { percentagePassingSmallestSieve = percentagePassing; // This is the value for the smallest sieve } } totalPercentageRetained = cumulativeRetainedPercentage; // Cumulative sum of percentages should be 100% if no loss/gain document.getElementById('totalWeightRetained').textContent = totalWeightRetainedSum.toFixed(2) + ' g'; document.getElementById('totalPercentageRetained').textContent = totalPercentageRetained.toFixed(2) + '%'; document.getElementById('materialLoss').textContent = materialLossPercentage.toFixed(2) + '%'; document.getElementById('percentageFiner').textContent = percentagePassingSmallestSieve.toFixed(2) + '%'; // Primary result resultsDisplay.style.display = 'block'; sieveDataTableContainer.style.display = 'block'; chartContainer.style.display = 'block'; document.getElementById('sieveTableBody').innerHTML = tableHtml; // Chart Generation var ctx = document.getElementById('sieveChart').getContext('2d'); // Destroy previous chart instance if it exists if (window.sieveChartInstance) { window.sieveChartInstance.destroy(); } window.sieveChartInstance = new Chart(ctx, { type: 'line', data: { // Use sieve sizes for X-axis, but reverse order for correct curve labels: sieveSizesForChart.slice().reverse().map(function(size) { return size.toFixed(2); }), datasets: [{ label: 'Percentage Passing (%)', data: percentagePassingValues.slice().reverse().map(function(val) { return parseFloat(val.toFixed(2)); }), // Reverse for correct curve borderColor: 'rgba(0, 74, 153, 1)', backgroundColor: 'rgba(0, 74, 153, 0.2)', fill: true, tension: 0.1 }] }, options: { responsive: true, maintainAspectRatio: false, scales: { x: { type: 'logarithmic', // Use logarithmic scale for sieve sizes title: { display: true, text: 'Particle Size (mm)' } }, y: { title: { display: true, text: 'Percentage Passing (%)' }, min: 0, max: 100 } }, plugins: { tooltip: { callbacks: { title: function(tooltipItems) { return 'Size: ' + tooltipItems[0].label + ' mm'; }, label: function(tooltipItem) { var datasetLabel = tooltipItem.dataset.label || "; return datasetLabel + ': ' + tooltipItem.raw + '%'; } } } } } }); } function copyResults() { var totalSampleWeight = document.getElementById('totalSampleWeight').value; var totalWeightRetained = document.getElementById('totalWeightRetained').textContent; var totalPercentageRetained = document.getElementById('totalPercentageRetained').textContent; var materialLoss = document.getElementById('materialLoss').textContent; var percentageFiner = document.getElementById('percentageFiner').textContent; var copyText = "— Sieve Analysis Results —\n\n"; copyText += "Total Sample Weight: " + totalSampleWeight + " g\n"; copyText += "Total Weight Retained: " + totalWeightRetained + "\n"; copyText += "Total Percentage Retained: " + totalPercentageRetained + "\n"; copyText += "Material Loss: " + materialLoss + "\n"; copyText += "\n— Key Result —\n"; copyText += "Overall Percentage Passing Smallest Sieve: " + percentageFiner + "\n"; copyText += "\n— Formula Used —\n"; copyText += "Weight Retained = Initial Weight – Weight Passing\n"; copyText += "Percentage Retained = (Weight Retained / Total Sample Weight) * 100\n"; copyText += "Percentage Passing = 100 – Total Percentage Retained\n"; copyText += "\n— Sieve Data Table —\n"; var tableRows = document.querySelectorAll('#sieveTableBody tr'); var headerRow = document.querySelectorAll('#sieveTableBody th'); if (headerRow.length > 0) { copyText += "Sieve Size (mm)\tWeight Retained (g)\t% Retained\tCum. % Retained\t% Passing\n"; } tableRows.forEach(function(row) { var cells = row.querySelectorAll('td'); if (cells.length === 5) { copyText += cells[0].textContent + '\t' + cells[1].textContent + '\t' + cells[2].textContent + '\t' + cells[3].textContent + '\t' + cells[4].textContent + '\n'; } }); var textArea = document.createElement("textarea"); textArea.value = copyText; document.body.appendChild(textArea); textArea.select(); try { document.execCommand("copy"); alert("Results copied to clipboard!"); } catch (err) { console.error("Failed to copy results: ", err); alert("Failed to copy results. Please copy manually."); } document.body.removeChild(textArea); } // Initialize with one sieve input by default document.addEventListener('DOMContentLoaded', function() { document.getElementById('totalSampleWeight').value = initialTotalSampleWeight; addSieveInput(); // Add one default sieve input addSieveInput(); // Add another default sieve input });

Leave a Comment