{"id":15891,"date":"2025-05-20T02:11:23","date_gmt":"2025-05-20T02:11:23","guid":{"rendered":"https:\/\/www.mechstream.com\/?p=15891"},"modified":"2025-05-20T02:16:19","modified_gmt":"2025-05-20T02:16:19","slug":"compression-spring-design-calculator","status":"publish","type":"post","link":"https:\/\/www.mechstream.com\/ar\/compression-spring-design-calculator\/","title":{"rendered":"\u062d\u0627\u0633\u0628\u0629 \u062a\u0635\u0645\u064a\u0645 \u0632\u0646\u0628\u0631\u0643 \u0627\u0644\u0636\u063a\u0637"},"content":{"rendered":"<p>\u0627\u0643\u062a\u0634\u0641 \u062d\u0627\u0633\u0628\u0629 \u062a\u0635\u0645\u064a\u0645 \u0646\u0648\u0627\u0628\u0636 \u0627\u0644\u0636\u063a\u0637 \u0627\u0644\u0645\u062b\u0627\u0644\u064a\u0629\u060c \u0623\u062f\u0627\u062a\u0643 \u0627\u0644\u0645\u0641\u0636\u0644\u0629 \u0644\u0645\u0648\u0627\u0635\u0641\u0627\u062a \u0627\u0644\u0646\u0648\u0627\u0628\u0636 \u0627\u0644\u062f\u0642\u064a\u0642\u0629 \u0648\u062a\u062d\u0633\u064a\u0646\u0647\u0627. \u062a\u062a\u064a\u062d \u0647\u0630\u0647 \u0627\u0644\u062d\u0627\u0633\u0628\u0629 \u0627\u0644\u0634\u0627\u0645\u0644\u0629 \u0644\u0644\u0645\u0647\u0646\u062f\u0633\u064a\u0646 \u0648\u0627\u0644\u0645\u0635\u0645\u0645\u064a\u0646 \u0625\u062f\u062e\u0627\u0644 \u0627\u0644\u0645\u0639\u0627\u064a\u064a\u0631 \u0627\u0644\u0631\u0626\u064a\u0633\u064a\u0629 \u0648\u0627\u0644\u062d\u0635\u0648\u0644 \u0639\u0644\u0649 \u0646\u062a\u0627\u0626\u062c \u0645\u0641\u0635\u0644\u0629 \u0644\u062a\u0635\u0645\u064a\u0645 \u0646\u0648\u0627\u0628\u0636 \u0627\u0644\u0636\u063a\u0637\u060c \u0645\u0645\u0627 \u064a\u0636\u0645\u0646 \u0623\u062f\u0627\u0621\u064b \u0648\u0645\u0648\u062b\u0648\u0642\u064a\u0629 \u0639\u0627\u0644\u064a\u064a\u0646. \u0628\u0641\u0636\u0644 \u0645\u064a\u0632\u0627\u062a\u0647\u0627 \u0633\u0647\u0644\u0629 \u0627\u0644\u0627\u0633\u062a\u062e\u062f\u0627\u0645 \u0648\u062d\u0633\u0627\u0628\u0627\u062a\u0647\u0627 \u0627\u0644\u062f\u0642\u064a\u0642\u0629\u060c \u0633\u0647\u0651\u0644 \u0639\u0645\u0644\u064a\u0629 \u0627\u0644\u062a\u0635\u0645\u064a\u0645 \u0648\u062d\u0642\u0642 \u0623\u0642\u0635\u0649 \u0623\u062f\u0627\u0621 \u0644\u0644\u0646\u0627\u0628\u0636. \u0645\u062b\u0627\u0644\u064a\u0629 \u0644\u062a\u0637\u0628\u064a\u0642\u0627\u062a \u0645\u062a\u0639\u062f\u062f\u0629\u060c \u062a\u0633\u0627\u0639\u062f \u062d\u0627\u0633\u0628\u062a\u0646\u0627 \u0639\u0644\u0649 \u062a\u062d\u0633\u064a\u0646 \u0627\u0644\u0643\u0641\u0627\u0621\u0629 \u0648\u062a\u0642\u0644\u064a\u0644 \u0623\u062e\u0637\u0627\u0621 \u0627\u0644\u062a\u0635\u0645\u064a\u0645. \u062c\u0631\u0628\u0647\u0627 \u0627\u0644\u0622\u0646 \u0648\u0637\u0648\u0651\u0631 \u0623\u0633\u0644\u0648\u0628\u0643 \u0641\u064a \u062a\u0635\u0645\u064a\u0645 \u0627\u0644\u0646\u0648\u0627\u0628\u0636.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter size-full\"><img fetchpriority=\"high\" decoding=\"async\" width=\"403\" height=\"412\" src=\"https:\/\/www.mechstream.com\/wp-content\/uploads\/2025\/05\/QQ20250520-100724-\u5df2\u7f16\u8f91.png\" loading=\"lazy\" alt=\"\u062d\u0627\u0633\u0628\u0629 \u062a\u0635\u0645\u064a\u0645 \u0632\u0646\u0628\u0631\u0643 \u0627\u0644\u0636\u063a\u0637\" class=\"wp-image-15892\" srcset=\"https:\/\/www.mechstream.com\/wp-content\/uploads\/2025\/05\/QQ20250520-100724-\u5df2\u7f16\u8f91.png 403w, https:\/\/www.mechstream.com\/wp-content\/uploads\/2025\/05\/QQ20250520-100724-\u5df2\u7f16\u8f91-293x300.png 293w, https:\/\/www.mechstream.com\/wp-content\/uploads\/2025\/05\/QQ20250520-100724-\u5df2\u7f16\u8f91-98x100.png 98w\" sizes=\"(max-width: 403px) 100vw, 403px\" \/><\/figure>\n<\/div>\n\n\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n    <meta charset=\"UTF-8\">\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n    <title>\u062d\u0627\u0633\u0628\u0629 \u062a\u0635\u0645\u064a\u0645 \u0632\u0646\u0628\u0631\u0643\u0627\u062a \u0627\u0644\u0636\u063a\u0637 | \u0623\u062f\u0627\u0629 \u062a\u0635\u0645\u064a\u0645 \u0632\u0646\u0628\u0631\u0643\u0627\u062a \u0627\u062d\u062a\u0631\u0627\u0641\u064a\u0629<\/title>\n    <style>\n        \/* Reset and base styles *\/\n        * {\n            margin: 0;\n            padding: 0;\n            box-sizing: border-box;\n        }\n\n        body {\n            font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif;\n            line-height: 1.6;\n            color: #333;\n        }\n\n        \/* Calculator container *\/\n        .calculator-container {\n            background: #fff;\n            border-radius: 8px;\n            box-shadow: 0 2px 4px rgba(0,0,0,0.1);\n            margin-bottom: 30px;\n        }\n\n        \/* Section styles *\/\n        .section {\n            margin-bottom: 30px;\n        }\n\n        h2 {\n            color: #000;\n            margin-bottom: 15px;\n            font-size: 1.5em;\n        }\n\n        \/* Parameter explanations *\/\n        .parameter-list {\n            display: grid;\n            grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));\n            gap: 15px;\n            margin-bottom: 20px;\n        }\n\n        .parameter-item {\n            background: #f8f9fa;\n            padding: 10px;\n            border-radius: 4px;\n        }\n\n        \/* Input form *\/\n        .input-form {\n            display: grid;\n            gap: 15px;\n            margin-bottom: 20px;\n            \/* Default to one column *\/\n            grid-template-columns: 1fr;\n        }\n\n        \/* Two columns on screens wider than 768px *\/\n        @media (min-width: 769px) {\n            .input-form {\n                grid-template-columns: repeat(2, 1fr);\n            }\n        }\n\n        .input-group {\n            display: flex;\n            flex-direction: column;\n        }\n\n        .input-group label {\n            margin-bottom: 5px;\n            font-weight: 500;\n        }\n\n        .input-group input,\n        .input-group select {\n            padding: 8px;\n            border: 1px solid #ddd;\n            border-radius: 4px;\n            font-size: 16px;\n        }\n\n        \/* Calculate button *\/\n        .calculate-btn {\n            background: #007bff;\n            color: white;\n            border: none;\n            padding: 12px 24px;\n            border-radius: 4px;\n            cursor: pointer;\n            font-size: 16px;\n            transition: background 0.3s;\n            width: 25%;\n            max-width: 200px;\n            margin: 20px auto;\n            display: block;\n            \/* Make the button span all columns in the grid *\/\n            grid-column: 1 \/ -1;\n        }\n\n        .calculate-btn:hover {\n            background: #0056b3;\n        }\n\n        \/* Results section *\/\n        .results {\n            display: none;\n            background: #e9ecef;\n            padding: 20px;\n            border-radius: 4px;\n            margin-top: 20px;\n        }\n\n        .results.active {\n            display: block;\n        }\n\n        .result-item {\n            margin-bottom: 10px;\n            font-size: 1.1em;\n        }\n\n        .result-value {\n            font-weight: bold;\n            color: #007bff;\n        }\n\n        \/* Responsive adjustments *\/\n        @media (max-width: 768px) {\n            .input-form {\n                \/* One column on small screens - handled by default *\/\n            }\n\n            .parameter-list {\n                grid-template-columns: 1fr;\n            }\n        }\n    <\/style>\n<\/head>\n<body>\n    <div class=\"calculator-container\">\n        <!-- Parameter Explanations -->\n        <div class=\"section section-parameters\">\n            <h2>\u062d\u062f\u0648\u062f<\/h2>\n            <div class=\"parameter-list\">\n                <div class=\"parameter-item\">\n                    <strong>\u0642\u0637\u0631 \u0627\u0644\u0633\u0644\u0643 (\u062f):<\/strong> \u0642\u0637\u0631 \u0627\u0644\u0633\u0644\u0643 \u0627\u0644\u0632\u0646\u0628\u0631\u0643\u064a.\n                <\/div>\n                <div class=\"parameter-item\">\n                    <strong>\u0645\u062a\u0648\u0633\u0637 \u0642\u0637\u0631 \u0627\u0644\u0645\u0644\u0641 (\u062f):<\/strong> \u0645\u062a\u0648\u0633\u0637 \u0642\u0637\u0631 \u0645\u0644\u0641\u0627\u062a \u0627\u0644\u0632\u0646\u0628\u0631\u0643.\n                <\/div>\n                <div class=\"parameter-item\">\n                    <strong>\u0639\u062f\u062f \u0627\u0644\u0645\u0644\u0641\u0627\u062a \u0627\u0644\u0646\u0634\u0637\u0629 (Na):<\/strong> \u0639\u062f\u062f \u0627\u0644\u0645\u0644\u0641\u0627\u062a \u0627\u0644\u062a\u064a \u062a\u0633\u0627\u0647\u0645 \u0641\u064a \u0639\u0645\u0644 \u0627\u0644\u0632\u0646\u0628\u0631\u0643.\n                <\/div>\n                <div class=\"parameter-item\">\n                    <strong>\u0645\u0644\u0641\u0627\u062a \u0627\u0644\u0645\u0642\u0639\u062f \u0627\u0644\u0623\u064a\u0633\u0631 (\u0646\u064a\u0648\u0632\u064a\u0644\u0646\u062f\u0627):<\/strong> \u0639\u062f\u062f \u0627\u0644\u0645\u0644\u0641\u0627\u062a \u063a\u064a\u0631 \u0627\u0644\u0646\u0634\u0637\u0629 \u0639\u0644\u0649 \u0627\u0644\u0637\u0631\u0641 \u0627\u0644\u0623\u064a\u0633\u0631.\n                <\/div>\n                <div class=\"parameter-item\">\n                    <strong>\u0645\u0644\u0641\u0627\u062a \u0627\u0644\u0645\u0642\u0639\u062f \u0627\u0644\u0623\u064a\u0645\u0646 (Nzr):<\/strong> \u0639\u062f\u062f \u0627\u0644\u0645\u0644\u0641\u0627\u062a \u063a\u064a\u0631 \u0627\u0644\u0646\u0634\u0637\u0629 \u0639\u0644\u0649 \u0627\u0644\u0637\u0631\u0641 \u0627\u0644\u0623\u064a\u0645\u0646.\n                <\/div>\n                <div class=\"parameter-item\">\n                    <strong>\u0627\u0644\u0637\u0648\u0644 \u0627\u0644\u062d\u0631 (L0):<\/strong> \u0637\u0648\u0644 \u0627\u0644\u0632\u0646\u0628\u0631\u0643 \u0639\u0646\u062f\u0645\u0627 \u0644\u0627 \u064a\u0643\u0648\u0646 \u062a\u062d\u062a \u0627\u0644\u062d\u0645\u0644.\n                <\/div>\n                <div class=\"parameter-item\">\n                    <strong>\u0645\u0639\u0627\u0645\u0644 \u0627\u0644\u0642\u0635 (G):<\/strong> \u062e\u0627\u0635\u064a\u0629 \u0627\u0644\u0645\u0627\u062f\u0629 \u0627\u0644\u062a\u064a \u062a\u0634\u064a\u0631 \u0625\u0644\u0649 \u0627\u0644\u0635\u0644\u0627\u0628\u0629 \u0641\u064a \u0627\u0644\u0642\u0635.\n                <\/div>\n                <div class=\"parameter-item\">\n                    <strong>\u0627\u0644\u0642\u0648\u0629 \u0627\u0644\u0645\u0637\u0628\u0642\u0629 (\u0646\u064a\u0648\u062a\u0646):<\/strong> \u0627\u0644\u0642\u0648\u0629 \u0627\u0644\u062e\u0627\u0631\u062c\u064a\u0629 \u0627\u0644\u0645\u0637\u0628\u0642\u0629 \u0639\u0644\u0649 \u0627\u0644\u0632\u0646\u0628\u0631\u0643. (\u0627\u0644\u0645\u062f\u062e\u0644 N \u0623\u0648 L1\u060c \u0648\u0644\u064a\u0633 \u0643\u0644\u064a\u0647\u0645\u0627)\n                <\/div>\n                <div class=\"parameter-item\">\n                    <strong>\u0627\u0644\u0637\u0648\u0644 \u062a\u062d\u062a \u0627\u0644\u062d\u0645\u0644 (L1):<\/strong> \u0637\u0648\u0644 \u0627\u0644\u0632\u0646\u0628\u0631\u0643 \u0639\u0646\u062f \u062a\u0637\u0628\u064a\u0642 \u0642\u0648\u0629 \u0639\u0644\u064a\u0647. (\u0627\u0644\u0645\u062f\u062e\u0644 N \u0623\u0648 L1\u060c \u0648\u0644\u064a\u0633 \u0643\u0644\u064a\u0647\u0645\u0627)\n                <\/div>\n            <\/div>\n        <\/div>\n\n        <!-- Calculator Form -->\n        <div class=\"section section-calculator\">\n            <h2>\u0627\u0644\u0622\u0644\u0629 \u0627\u0644\u062d\u0627\u0633\u0628\u0629<\/h2>\n            <form id=\"springCalculator\" class=\"input-form\" action=\"\">\n                <div class=\"input-group\">\n                    <label for=\"wireDiameter\">\u0642\u0637\u0631 \u0627\u0644\u0633\u0644\u0643 (\u062f) <span class=\"unit\">\u0645\u0645<\/span><\/label>\n                    <input type=\"number\" id=\"wireDiameter\" step=\"0.01\" required>\n                <\/div>\n                <div class=\"input-group\">\n                    <label for=\"meanDiameter\">\u0645\u062a\u0648\u0633\u0637 \u0642\u0637\u0631 \u0627\u0644\u0645\u0644\u0641 (\u062f) <span class=\"unit\">\u0645\u0645<\/span><\/label>\n                    <input type=\"number\" id=\"meanDiameter\" step=\"0.01\" required>\n                <\/div>\n                <div class=\"input-group\">\n                    <label for=\"numberOfActiveCoils\">\u0639\u062f\u062f \u0627\u0644\u0645\u0644\u0641\u0627\u062a \u0627\u0644\u0646\u0634\u0637\u0629 (Na)<\/label>\n                    <input type=\"number\" id=\"numberOfActiveCoils\" step=\"0.1\" required>\n                <\/div>\n                <div class=\"input-group\">\n                    <label for=\"freeLength\">\u0627\u0644\u0637\u0648\u0644 \u0627\u0644\u062d\u0631 (L0) <span class=\"unit\">\u0645\u0645<\/span><\/label>\n                    <input type=\"number\" id=\"freeLength\" step=\"0.1\" required>\n                <\/div>\n                <div class=\"input-group\">\n                    <label for=\"shearModulus\">\u0645\u0639\u0627\u0645\u0644 \u0627\u0644\u0642\u0635 (G) <span class=\"unit\">\u0646\u064a\u0648\u062a\u0646\/\u0645\u0645\u00b2<\/span><\/label>\n                    <input type=\"number\" id=\"shearModulus\" step=\"100\" required>\n                <\/div>\n                <div class=\"input-group\">\n                    <label for=\"appliedForce\">\u0627\u0644\u0642\u0648\u0629 \u0627\u0644\u0645\u0637\u0628\u0642\u0629 (\u0646\u064a\u0648\u062a\u0646) <span class=\"unit\">\u0646<\/span><\/label>\n                    <input type=\"number\" id=\"appliedForce\" step=\"0.1\">\n                <\/div>\n                <div class=\"input-group\">\n                    <label for=\"lengthUnderLoad\">\u0627\u0644\u0637\u0648\u0644 \u062a\u062d\u062a \u0627\u0644\u062d\u0645\u0644 (L1) <span class=\"unit\">\u0645\u0645<\/span><\/label>\n                    <input type=\"number\" id=\"lengthUnderLoad\" step=\"0.1\">\n                <\/div>\n                <div class=\"input-group\">\n                    <label for=\"leftSeatCoils\">\u0645\u0644\u0641\u0627\u062a \u0627\u0644\u0645\u0642\u0639\u062f \u0627\u0644\u0623\u064a\u0633\u0631 (\u0646\u064a\u0648\u0632\u064a\u0644\u0646\u062f\u0627)<\/label>\n                    <input type=\"number\" id=\"leftSeatCoils\" step=\"0.1\" value=\"0\">\n                <\/div>\n                <div class=\"input-group\">\n                    <label for=\"rightSeatCoils\">\u0645\u0644\u0641\u0627\u062a \u0627\u0644\u0645\u0642\u0639\u062f \u0627\u0644\u0623\u064a\u0645\u0646 (Nzr)<\/label>\n                    <input type=\"number\" id=\"rightSeatCoils\" step=\"0.1\" value=\"0\">\n                <\/div>\n                <button type=\"submit\" class=\"calculate-btn\">\u0627\u062d\u0633\u0628<\/button>\n            <input type=\"hidden\" name=\"trp-form-language\" value=\"ar\"\/><\/form>\n        <\/div>\n\n        <!-- Results Section -->\n        <div id=\"results\" class=\"results section-results\">\n            <h2>\u0646\u062a\u0627\u0626\u062c \u0627\u0644\u062d\u0633\u0627\u0628<\/h2>\n            <div class=\"result-item\">\n                \u0645\u0639\u062f\u0644 \u0627\u0644\u0631\u0628\u064a\u0639 (\u0643): <span class=\"result-value\" id=\"springRate\">0<\/span> \u0646\u064a\u0648\u062a\u0646\/\u0645\u0645\n            <\/div>\n            <div class=\"result-item\">\n                \u0627\u0631\u062a\u0641\u0627\u0639 \u0635\u0644\u0628: <span class=\"result-value\" id=\"solidHeight\">0<\/span> \u0645\u0645\n            <\/div>\n            <div class=\"result-item\" id=\"maxLoadResult\">\n                \u0627\u0644\u062d\u062f \u0627\u0644\u0623\u0642\u0635\u0649 \u0644\u0644\u062d\u0645\u0644: <span class=\"result-value\" id=\"maxLoad\">0<\/span> \u0646\n            <\/div>\n            <div class=\"result-item\" id=\"maxDeflectionResult\">\n                \u0623\u0642\u0635\u0649 \u0627\u0646\u062d\u0631\u0627\u0641: <span class=\"result-value\" id=\"maxDeflection\">0<\/span> \u0645\u0645\n            <\/div>\n            <div class=\"result-item\" id=\"forceAtL1Result\" style=\"display: none;\">\n                \u0627\u0644\u0642\u0648\u0629 \u0639\u0646\u062f \u0627\u0644\u0637\u0648\u0644 L1: <span class=\"result-value\" id=\"forceAtL1\">0<\/span> \u0646\n            <\/div>\n            <div class=\"result-item\" id=\"deflectionAtNResult\" style=\"display: none;\">\n                \u0627\u0644\u0627\u0646\u062d\u0631\u0627\u0641 \u0639\u0646\u062f \u0627\u0644\u0642\u0648\u0629 N: <span class=\"result-value\" id=\"deflectionAtN\">0<\/span> \u0645\u0645\n            <\/div>\n            <div class=\"result-item\">\n                \u0627\u0644\u0642\u0637\u0631 \u0627\u0644\u062f\u0627\u062e\u0644\u064a (Di): <span class=\"result-value\" id=\"innerDiameter\">0<\/span> \u0645\u0645\n            <\/div>\n            <div class=\"result-item\">\n                \u0645\u0624\u0634\u0631 \u0627\u0644\u0631\u0628\u064a\u0639 (\u062c): <span class=\"result-value\" id=\"springIndex\">0<\/span>\n            <\/div>\n            <div class=\"result-item\">\n                \u0625\u062c\u0645\u0627\u0644\u064a \u0627\u0644\u0645\u0644\u0641\u0627\u062a (Nt): <span class=\"result-value\" id=\"totalCoils\">0<\/span>\n            <\/div>\n            <div class=\"result-item\">\n                \u0639\u0627\u0645\u0644 \u0648\u0627\u0644: <span class=\"result-value\" id=\"wahlFactor\">0<\/span>\n            <\/div>\n            <div class=\"result-item\" id=\"deflectionResult\" style=\"display: none;\">\n                \u0627\u0644\u0627\u0646\u062d\u0631\u0627\u0641 (L): <span class=\"result-value\" id=\"deflection\">0<\/span> \u0645\u0645\n            <\/div>\n        <\/div>\n    <\/div>\n\n    <script>\n        document.getElementById('springCalculator').addEventListener('submit', function(e) {\n            e.preventDefault();\n\n            \/\/ Get input values\n            const d = parseFloat(document.getElementById('wireDiameter').value);\n            const D = parseFloat(document.getElementById('meanDiameter').value);\n            const Na = parseFloat(document.getElementById('numberOfActiveCoils').value);\n            const L0 = parseFloat(document.getElementById('freeLength').value);\n            const G = parseFloat(document.getElementById('shearModulus').value);\n            const N = document.getElementById('appliedForce').value !== '' ? parseFloat(document.getElementById('appliedForce').value) : null;\n            const L1 = document.getElementById('lengthUnderLoad').value !== '' ? parseFloat(document.getElementById('lengthUnderLoad').value) : null;\n            const Nzl = parseFloat(document.getElementById('leftSeatCoils').value) || 0;\n            const Nzr = parseFloat(document.getElementById('rightSeatCoils').value) || 0;\n\n\n            \/\/ Calculate spring rate (k)\n            \/\/ Formula: k = (G * d^4) \/ (8 * D^3 * Na)\n            const k = (G * Math.pow(d, 4)) \/ (8 * Math.pow(D, 3) * Na);\n\n            \/\/ Calculate solid height\n            \/\/ Assuming squared ends, total coils = Na + 2. For other ends, this might differ. Using Na for a simplified solid height based on active coils * diameter\n            const totalCoils = Na + Nzl + Nzr;\n            const solidHeight = totalCoils * d;\n\n\n            \/\/ Calculate maximum deflection (Deflection to Solid Height)\n            const maxDeflection = L0 - solidHeight;\n\n            \/\/ Calculate maximum load (Load at Solid Height)\n            const maxLoad = k * maxDeflection;\n\n            \/\/ Calculate Inner Diameter (Di)\n            const innerDiameter = D - d;\n\n\n            \/\/ Display results that are always calculated\n            document.getElementById('springRate').textContent = k.toFixed(2);\n            document.getElementById('solidHeight').textContent = solidHeight.toFixed(2);\n            document.getElementById('maxLoad').textContent = maxLoad.toFixed(2);\n            document.getElementById('maxDeflection').textContent = maxDeflection.toFixed(2);\n            document.getElementById('innerDiameter').textContent = innerDiameter.toFixed(2);\n\n\n            \/\/ Calculate results based on N or L1 input\n            document.getElementById('forceAtL1Result').style.display = 'none';\n            document.getElementById('deflectionAtNResult').style.display = 'none';\n            document.getElementById('deflectionResult').style.display = 'none';\n\n            let calculatedDeflection = 0;\n\n            if (N !== null) {\n                \/\/ Calculate deflection at Applied Force N\n                calculatedDeflection = N \/ k;\n                document.getElementById('deflectionAtN').textContent = calculatedDeflection.toFixed(2);\n                document.getElementById('deflectionAtNResult').style.display = 'block';\n\n            } else if (L1 !== null) {\n                 \/\/ Calculate deflection (delta L) = L0 - L1\n                calculatedDeflection = L0 - L1;\n                \/\/ Calculate force at Length L1\n                const forceAtL1 = k * calculatedDeflection;\n                document.getElementById('forceAtL1').textContent = forceAtL1.toFixed(2);\n                document.getElementById('forceAtL1Result').style.display = 'block';\n            }\n\n            \/\/ Display Deflection (L)\n            document.getElementById('deflection').textContent = calculatedDeflection.toFixed(2);\n            document.getElementById('deflectionResult').style.display = 'block';\n\n            \/\/ Calculate Spring Index (C)\n            const springIndex = D \/ d;\n            document.getElementById('springIndex').textContent = springIndex.toFixed(2);\n\n            \/\/ Display Total Coils (Nt)\n            document.getElementById('totalCoils').textContent = totalCoils.toFixed(1); \/\/ Assuming totalCoils was calculated earlier\n\n            \/\/ Calculate Wahl Factor (A common stress correction factor)\n            \/\/ Formula: Kw = (4C - 1) \/ (4C - 4) + 0.615 \/ C\n            const wahlFactor = (4 * springIndex - 1) \/ (4 * springIndex - 4) + 0.615 \/ springIndex;\n            document.getElementById('wahlFactor').textContent = wahlFactor.toFixed(3);\n\n\n            \/\/ Show results section\n            document.getElementById('results').classList.add('active');\n        });\n    <\/script>\n<\/body>\n<\/html>","protected":false},"excerpt":{"rendered":"<p>Discover the ultimate Compression Spring Design Calculator, your go-to tool for precise spring specifications and optimization. This comprehensive calculator allows engineers and designers to input&#8230;<\/p>","protected":false},"author":2,"featured_media":15893,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"pmpro_default_level":"","_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3434],"tags":[3679,3421,3675],"class_list":["post-15891","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-spring-calculator","tag-compression-calculator","tag-engineering-tool","tag-spring-design","pmpro-has-access"],"acf":[],"jetpack_featured_media_url":"https:\/\/www.mechstream.com\/wp-content\/uploads\/2025\/05\/Compression-Spring-Design-Calculator.png","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.mechstream.com\/ar\/wp-json\/wp\/v2\/posts\/15891","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.mechstream.com\/ar\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.mechstream.com\/ar\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.mechstream.com\/ar\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.mechstream.com\/ar\/wp-json\/wp\/v2\/comments?post=15891"}],"version-history":[{"count":0,"href":"https:\/\/www.mechstream.com\/ar\/wp-json\/wp\/v2\/posts\/15891\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.mechstream.com\/ar\/wp-json\/wp\/v2\/media\/15893"}],"wp:attachment":[{"href":"https:\/\/www.mechstream.com\/ar\/wp-json\/wp\/v2\/media?parent=15891"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.mechstream.com\/ar\/wp-json\/wp\/v2\/categories?post=15891"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.mechstream.com\/ar\/wp-json\/wp\/v2\/tags?post=15891"}],"curies":[{"name":"\u0648\u0648\u0631\u062f\u0628\u0631\u064a\u0633","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}