{"id":233511,"date":"2024-10-25T14:39:48","date_gmt":"2024-10-25T14:39:48","guid":{"rendered":"https:\/\/predict.kikirpa.be\/?page_id=233511"},"modified":"2024-10-25T14:39:48","modified_gmt":"2024-10-25T14:39:48","slug":"moisture-content-calculator","status":"publish","type":"page","link":"https:\/\/predict.kikirpa.be\/index.php\/tools\/moisture-content-calculator\/","title":{"rendered":"Moisture Content Calculator"},"content":{"rendered":"\n<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n    <meta charset=\"UTF-8\">\r\n    <title>Actual and Hygroscopic Moisture Content Calculator<\/title>\r\n    <!-- Include MathJax Library -->\r\n    <script src=\"https:\/\/cdn.jsdelivr.net\/npm\/mathjax@3\/es5\/tex-mml-chtml.js\"><\/script>\r\n    <style>\r\n        body {\r\n            font-family: 'Calibri', 'Arial', sans-serif;\r\n        }\r\n        .container {\r\n            width: 80%;\r\n            margin: 10px auto;\r\n            padding: 40px 100px;\r\n            background-color: white;\r\n            border-radius: 10px;\r\n        }\r\n        .title {\r\n            font-weight: bold;\r\n            font-size: 24px;\r\n            margin: 20px;\r\n            text-align: center;\r\n        }\r\n        .input-group {\r\n            margin: 15px 0;\r\n        }\r\n        .input-group label {\r\n            font-weight: bold;\r\n            width: 100%;\r\n            display: block;\r\n            margin-bottom: 5px;\r\n        }\r\n        .input-group input {\r\n            border-radius: 5px;\r\n            border: 1px solid #ccc;\r\n            width: 100%;\r\n            display: block;\r\n            box-sizing: border-box;\r\n            padding: 10px;\r\n            font-size: 16px;\r\n        }\r\n        button {\r\n            padding: 12px;\r\n            border-radius: 5px;\r\n            border: none;\r\n            color: white;\r\n            font-size: 16px;\r\n            cursor: pointer;\r\n            margin: 20px auto;\r\n            width: 220px;\r\n        }\r\n        .calculate {\r\n            background-color: #4CAF50;\r\n            display: block;\r\n        }\r\n        #results {\r\n            font-weight: bold;\r\n            margin: 20px 0;\r\n        }\r\n        table {\r\n            width: 100%;\r\n            border-collapse: collapse;\r\n            margin-top: 10px;\r\n        }\r\n        table, th, td {\r\n            border: 1px solid black;\r\n        }\r\n        th, td {\r\n            padding: 10px;\r\n            text-align: center;\r\n        }\r\n        \/* Styles for formulas *\/\r\n        .formulas {\r\n            margin-top: 20px;\r\n        }\r\n        .formula {\r\n            font-size: 18px;\r\n            margin-bottom: 10px;\r\n        }\r\n        .formula span {\r\n            font-weight: bold;\r\n        }\r\n        \/* Additional styling for responsiveness *\/\r\n        @media (max-width: 600px) {\r\n            .container {\r\n                padding: 20px 10px;\r\n            }\r\n            .title {\r\n                font-size: 20px;\r\n            }\r\n            button {\r\n                width: 100%;\r\n            }\r\n        }\r\n    <\/style>\r\n<\/head>\r\n<body>\r\n    <div class=\"container\">\r\n        <div class=\"title\">Actual and Hygroscopic Moisture Content Calculator<\/div>\r\n        <p>Note: Multiple samples can be comma or space separated.<\/p>\r\n        \r\n        <!-- Input fields -->\r\n        <div class=\"input-group\">\r\n            <label for=\"sampleIds\">Sample ID:<\/label>\r\n            <input type=\"text\" id=\"sampleIds\" placeholder=\"e.g., Sample1, Sample2\">\r\n        <\/div>\r\n        <div class=\"input-group\">\r\n            <label for=\"sampleContainerMasses\">Mass of Container (\\( m_c \\)) [g]:<\/label>\r\n            <input type=\"text\" id=\"sampleContainerMasses\" placeholder=\"e.g., 10, 12\">\r\n        <\/div>\r\n        <div class=\"input-group\">\r\n            <label for=\"initialRawMassesWithContainer\">Initial Raw Mass with Container (\\( m_i \\)) [g]:<\/label>\r\n            <input type=\"text\" id=\"initialRawMassesWithContainer\" placeholder=\"e.g., 15, 18\">\r\n        <\/div>\r\n        <div class=\"input-group\">\r\n            <label for=\"dryMassesWithContainer\">Dry Mass with Container (\\( m_d \\)) [g]:<\/label>\r\n            <input type=\"text\" id=\"dryMassesWithContainer\" placeholder=\"e.g., 13, 16\">\r\n        <\/div>\r\n        <div class=\"input-group\">\r\n            <label for=\"massesOfSampleAt95RHAnd20CWithContainer\">Mass at Given RH and T with Container (\\( m_s \\)) [g]:<\/label>\r\n            <input type=\"text\" id=\"massesOfSampleAt95RHAnd20CWithContainer\" placeholder=\"e.g., 14, 17\">\r\n        <\/div>\r\n\r\n        <!-- Calculation button -->\r\n        <button class=\"calculate\" onclick=\"calculateAMCHMC()\">Calculate AMC and HMC<\/button>\r\n\r\n        <!-- Results section -->\r\n        <div id=\"results\">\r\n            <table>\r\n                <thead>\r\n                    <tr>\r\n                        <th>Sample ID<\/th>\r\n                        <th>AMC (w.%)<\/th>\r\n                        <th>HMC (w.%)<\/th>\r\n                    <\/tr>\r\n                <\/thead>\r\n                <tbody id=\"resultsBody\"><\/tbody>\r\n            <\/table>\r\n\r\n            <!-- Formulas displayed under the results -->\r\n            <div class=\"formulas\">\r\n                <div class=\"formula\">\r\n                    <span>Actual Moisture Content (AMC) Formula:<\/span><br>\r\n                    $$ \\text{AMC (w.%)} = \\left( \\dfrac{m_i &#8211; m_d}{m_d &#8211; m_c} \\right) \\times 100 $$\r\n                <\/div>\r\n                <div class=\"formula\">\r\n                    <span>Hygroscopic Moisture Content (HMC) Formula:<\/span><br>\r\n                    $$ \\text{HMC (w.%)} = \\left( \\dfrac{m_s &#8211; m_d}{m_d &#8211; m_c} \\right) \\times 100 $$\r\n                <\/div>\r\n                <div class=\"formula\">\r\n                    Where:<br>\r\n                    \\( m_c \\) = Mass of the container [g]<br>\r\n                    \\( m_i \\) = Initial raw mass with container [g]<br>\r\n                    \\( m_d \\) = Dry mass with container [g]<br>\r\n                    \\( m_s \\) = Mass at given RH and T with container [g]\r\n                <\/div>\r\n            <\/div>\r\n        <\/div>\r\n    <\/div>\r\n\r\n    <script>\r\n        function calculateAMCHMC() {\r\n            const resultsBody = document.getElementById('resultsBody');\r\n            resultsBody.innerHTML = '';\r\n\r\n            const sampleIds = document.getElementById('sampleIds').value.replace(\/[\\s,]+\/g, ',').split(',');\r\n            const containerMasses = document.getElementById('sampleContainerMasses').value.replace(\/[\\s,]+\/g, ',').split(',');\r\n            const initialMasses = document.getElementById('initialRawMassesWithContainer').value.replace(\/[\\s,]+\/g, ',').split(',');\r\n            const dryMasses = document.getElementById('dryMassesWithContainer').value.replace(\/[\\s,]+\/g, ',').split(',');\r\n            const mcs95Masses = document.getElementById('massesOfSampleAt95RHAnd20CWithContainer').value.replace(\/[\\s,]+\/g, ',').split(',');\r\n\r\n            sampleIds.forEach((sampleId, index) => {\r\n                if (containerMasses[index] && initialMasses[index] && dryMasses[index] && mcs95Masses[index]) {\r\n                    const m_c = parseFloat(containerMasses[index].trim());\r\n                    const m_i = parseFloat(initialMasses[index].trim());\r\n                    const m_d = parseFloat(dryMasses[index].trim());\r\n                    const m_s = parseFloat(mcs95Masses[index].trim());\r\n\r\n                    if (!isNaN(m_c) && !isNaN(m_i) && !isNaN(m_d) && !isNaN(m_s)) {\r\n                        const drySampleWeight = m_d - m_c;\r\n                        if (drySampleWeight <= 0) {\r\n                            resultsBody.innerHTML += `<tr><td colspan=\"3\" style=\"color: red;\">Error: Dry sample weight must be greater than zero for Sample ID ${sampleId.trim()}.<\/td><\/tr>`;\r\n                            return;\r\n                        }\r\n                        const amcWtPercent = ((m_i - m_d) \/ drySampleWeight) * 100;\r\n                        const hmcWtPercent = ((m_s - m_d) \/ drySampleWeight) * 100;\r\n\r\n                        const row = document.createElement('tr');\r\n                        row.innerHTML = `<td>${sampleId.trim()}<\/td><td>${amcWtPercent.toFixed(2)}<\/td><td>${hmcWtPercent.toFixed(2)}<\/td>`;\r\n                        resultsBody.appendChild(row);\r\n                    } else {\r\n                        resultsBody.innerHTML += `<tr><td colspan=\"3\" style=\"color: red;\">Error calculating for Sample ID ${sampleId.trim()}: Please enter valid numerical values.<\/td><\/tr>`;\r\n                    }\r\n                } else {\r\n                    resultsBody.innerHTML += `<tr><td colspan=\"3\" style=\"color: red;\">Missing data for Sample ID ${sampleId.trim()}.<\/td><\/tr>`;\r\n                }\r\n            });\r\n        }\r\n    <\/script>\r\n<\/body>\r\n<\/html>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Actual and Hygroscopic Moisture Content Calculator Actual and Hygroscopic Moisture Content Calculator Note: Multiple samples can be comma or space separated. Sample ID: Mass of Container (\\( m_c \\)) [g]: Initial Raw Mass with Container (\\( m_i \\)) [g]: Dry Mass with Container (\\( m_d \\)) [g]: Mass at Given RH and T with Container &hellip;<\/p>\n<p class=\"read-more\"> <a class=\"\" href=\"https:\/\/predict.kikirpa.be\/index.php\/tools\/moisture-content-calculator\/\"> <span class=\"screen-reader-text\">Moisture Content Calculator<\/span> Read More &raquo;<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"parent":105,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"default","site-content-layout":"default","ast-global-header-display":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","footnotes":""},"class_list":["post-233511","page","type-page","status-publish","hentry"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/predict.kikirpa.be\/index.php\/wp-json\/wp\/v2\/pages\/233511","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/predict.kikirpa.be\/index.php\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/predict.kikirpa.be\/index.php\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/predict.kikirpa.be\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/predict.kikirpa.be\/index.php\/wp-json\/wp\/v2\/comments?post=233511"}],"version-history":[{"count":1,"href":"https:\/\/predict.kikirpa.be\/index.php\/wp-json\/wp\/v2\/pages\/233511\/revisions"}],"predecessor-version":[{"id":233515,"href":"https:\/\/predict.kikirpa.be\/index.php\/wp-json\/wp\/v2\/pages\/233511\/revisions\/233515"}],"up":[{"embeddable":true,"href":"https:\/\/predict.kikirpa.be\/index.php\/wp-json\/wp\/v2\/pages\/105"}],"wp:attachment":[{"href":"https:\/\/predict.kikirpa.be\/index.php\/wp-json\/wp\/v2\/media?parent=233511"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}