Race Tech Spring Weight Calculator

Race Tech Spring Weight Calculator – Expert Guide & Tool :root { –primary-color: #004a99; –success-color: #28a745; –background-color: #f8f9fa; –text-color: #333; –secondary-text-color: #6c757d; –border-color: #dee2e6; –card-background: #ffffff; –shadow: 0 4px 8px 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); line-height: 1.6; margin: 0; padding: 0; display: flex; flex-direction: column; align-items: center; } .container { width: 100%; max-width: 960px; margin: 20px 0; padding: 0 15px; box-sizing: border-box; } header { background-color: var(–primary-color); color: white; padding: 20px 0; text-align: center; width: 100%; } header h1 { margin: 0; font-size: 2.5em; text-transform: capitalize; } main { width: 100%; display: flex; flex-direction: column; align-items: center; } .loan-calc-container { background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); padding: 30px; margin-bottom: 30px; width: 100%; box-sizing: border-box; } .loan-calc-container h2 { text-align: center; color: var(–primary-color); margin-top: 0; margin-bottom: 25px; } .input-group { margin-bottom: 20px; width: 100%; } .input-group label { display: block; margin-bottom: 8px; font-weight: bold; color: var(–primary-color); } .input-group input[type="number"], .input-group input[type="text"], .input-group select { width: 100%; padding: 12px; border: 1px solid var(–border-color); border-radius: 4px; box-sizing: border-box; font-size: 1em; } .input-group input[type="number"]:focus, .input-group input[type="text"]:focus, .input-group select:focus { outline: none; border-color: var(–primary-color); box-shadow: 0 0 0 3px rgba(0, 74, 153, 0.2); } .input-group .helper-text { font-size: 0.85em; color: var(–secondary-text-color); margin-top: 5px; display: block; } .input-group .error-message { color: #dc3545; font-size: 0.85em; margin-top: 5px; display: block; min-height: 1.1em; /* Prevent layout shifts */ } .button-group { display: flex; justify-content: space-between; gap: 10px; margin-top: 30px; } .button-group button { padding: 12px 20px; border: none; border-radius: 5px; font-size: 1em; font-weight: bold; cursor: pointer; transition: background-color 0.3s ease, transform 0.2s ease; flex-grow: 1; } .button-group button.calculate-btn { background-color: var(–primary-color); color: white; } .button-group button.calculate-btn:hover { background-color: #003366; transform: translateY(-2px); } .button-group button.reset-btn { background-color: var(–secondary-text-color); color: white; } .button-group button.reset-btn:hover { background-color: #5a6268; transform: translateY(-2px); } .button-group button.copy-btn { background-color: var(–success-color); color: white; } .button-group button.copy-btn:hover { background-color: #218838; transform: translateY(-2px); } #results { margin-top: 30px; padding: 25px; border: 1px solid var(–border-color); border-radius: 8px; background-color: var(–card-background); box-shadow: var(–shadow); text-align: center; } #results h3 { margin-top: 0; color: var(–primary-color); margin-bottom: 20px; } .result-item { margin-bottom: 15px; } .result-item label { font-weight: bold; color: var(–primary-color); display: block; margin-bottom: 5px; font-size: 1.1em; } .result-value { font-size: 2em; font-weight: bold; color: var(–success-color); } .primary-result .result-value { font-size: 3em; color: var(–primary-color); background-color: #e7f3ff; padding: 15px 25px; border-radius: 6px; display: inline-block; margin-top: 10px; } .formula-explanation { font-size: 0.9em; color: var(–secondary-text-color); margin-top: 20px; padding-top: 15px; border-top: 1px dashed var(–border-color); } table { width: 100%; border-collapse: collapse; margin-top: 30px; margin-bottom: 30px; box-shadow: var(–shadow); } thead th { background-color: var(–primary-color); color: white; padding: 12px; text-align: left; font-weight: bold; } tbody td { padding: 12px; border-bottom: 1px solid var(–border-color); background-color: var(–card-background); } tbody tr:last-child td { border-bottom: none; } caption { font-size: 1.1em; color: var(–primary-color); margin-bottom: 15px; font-weight: bold; text-align: left; } .chart-container { margin-top: 30px; margin-bottom: 30px; background-color: var(–card-background); padding: 20px; border-radius: 8px; box-shadow: var(–shadow); text-align: center; } .chart-container h3 { margin-top: 0; color: var(–primary-color); margin-bottom: 20px; } canvas { max-width: 100%; height: auto !important; border-radius: 6px; } .article-content { background-color: var(–card-background); border-radius: 8px; box-shadow: var(–shadow); padding: 30px; margin-bottom: 30px; width: 100%; box-sizing: border-box; } .article-content h2, .article-content h3 { color: var(–primary-color); margin-top: 30px; margin-bottom: 15px; } .article-content h2 { font-size: 2em; border-bottom: 2px solid var(–primary-color); padding-bottom: 5px; } .article-content h3 { font-size: 1.5em; } .article-content p { margin-bottom: 15px; } .article-content ul, .article-content ol { margin-left: 20px; margin-bottom: 15px; } .article-content li { margin-bottom: 8px; } .faq-item { border: 1px solid var(–border-color); border-radius: 5px; padding: 15px; margin-bottom: 15px; background-color: #fdfdfd; } .faq-item strong { color: var(–primary-color); display: block; margin-bottom: 8px; font-size: 1.1em; } .related-links ul { list-style: none; padding: 0; } .related-links li { margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px dashed var(–border-color); } .related-links li:last-child { border-bottom: none; } .related-links a { color: var(–primary-color); text-decoration: none; font-weight: bold; font-size: 1.1em; } .related-links a:hover { text-decoration: underline; } .related-links span { display: block; font-size: 0.9em; color: var(–secondary-text-color); margin-top: 5px; } footer { text-align: center; padding: 20px; margin-top: 30px; width: 100%; font-size: 0.9em; color: var(–secondary-text-color); border-top: 1px solid var(–border-color); } @media (max-width: 768px) { .button-group { flex-direction: column; } .button-group button { width: 100%; } header h1 { font-size: 1.8em; } .loan-calc-container, .article-content { padding: 20px; } }

Race Tech Spring Weight Calculator

Motorcycle Suspension Spring Rate Calculator

Determine the optimal spring rate for your motorcycle's suspension based on rider weight, bike type, and intended use. Precise spring rates are crucial for optimal handling, comfort, and performance.

Your body weight in kilograms (including gear).
Motocross/Dirt Bike Enduro/Dual Sport Road/Street Bike Adventure/Touring Bike Select the general category of your motorcycle.
Adjust for aggressive riding (+), cautious riding (-), or luggage (+). Enter a percentage (e.g., 5 for 5%, -5 for -5%).

Your Optimal Spring Rate

Formula: Recommended Spring Rate = (Rider Weight * 9.81 m/s² / 1000) * Bike Type Multiplier * (1 + Usage Modifier / 100)
*(Note: The initial conversion to kgf/mm simplifies calculation, then converts to N/mm for accuracy. The displayed calculation reflects the final N/mm.)*

Spring Rate vs. Rider Weight

Shows estimated spring rate for different rider weights within the selected bike type and usage modifier.

Spring Rate Conversion Guide
N/mm kg/mm lb/in
0.800.08245.7
0.850.08748.5
0.900.09251.4
0.950.09754.2
1.000.10257.1
1.050.10759.9
1.100.11262.8
1.150.11765.7
1.200.12268.5
1.250.12771.4
1.300.13374.2
1.350.13877.1
1.400.14379.9

What is a Race Tech Spring Weight Calculator?

A Race Tech spring weight calculator is an essential tool for motorcycle riders and mechanics seeking to optimize suspension performance. It helps determine the ideal linear spring rate for a motorcycle's front forks and rear shock absorber. The "Race Tech" name refers to a leading manufacturer and developer of high-performance suspension components and services, implying a method rooted in industry best practices and empirical data. This calculator bridges the gap between a rider's weight, their bike's characteristics, and how the suspension should react to maintain optimal geometry, traction, and rider comfort. It's crucial for anyone looking to fine-tune their bike's handling, whether for casual trail riding, competitive racing, or long-distance touring. Common misconceptions include believing a "stiffer" spring is always better or that a generic spring rate suits all riders of similar weight. In reality, spring rate selection is a nuanced process involving multiple factors.

Race Tech Spring Weight Calculator Formula and Mathematical Explanation

The core principle behind calculating the correct spring rate is to ensure the suspension supports the combined weight of the rider and the motorcycle effectively, while also accounting for dynamic forces experienced during riding. The formula aims to achieve the desired "sag" – the amount the suspension compresses under static load. Proper sag is critical for balanced handling and ensures the suspension has adequate travel for both compression and extension.

The formula used is a refined approach to establish a starting point for spring rate selection:

Step-by-Step Derivation:

  1. Convert Rider Weight to Force: Rider weight is given in kilograms (kg). To convert this to a force (Newtons), we multiply by the acceleration due to gravity (approximately 9.81 m/s²). However, for practical spring rate calculations, a common intermediate step is to consider the force in kilogram-force (kgf), which is numerically similar to mass in kg under standard gravity. The calculator implicitly uses this relationship and converts to Newtons per millimeter (N/mm) for industry standard.
  2. Apply Bike Type Multiplier: Different types of motorcycles have different weight distributions and typical riding dynamics. A multiplier is applied to adjust the rider's weight contribution relative to the bike's overall mass and intended use. For example, a heavier adventure bike might require a slightly different baseline than a lightweight motocross bike.
  3. Incorporate Usage Modifier: This percentage adjustment accounts for variables not captured by basic weight and bike type. Aggressive riding styles, jumping, carrying luggage, or off-road use can significantly alter the forces acting on the suspension. A positive modifier increases the required spring rate (making it stiffer), while a negative modifier decreases it (making it softer).
  4. Calculate Final Spring Rate: The adjusted rider weight (force) is then used to determine the spring rate required to achieve optimal sag. The fundamental relationship is Force = Spring Rate × Displacement (Sag). Rearranging this, Spring Rate = Force / Sag. Since sag is typically a fraction of the total suspension travel, and spring rates are often quoted in N/mm, the formula integrates these units.

Formula Summary:

Recommended Spring Rate (N/mm) = (Rider Weight (kg) * 9.81 m/s²) * Bike Type Multiplier * (1 + Usage Modifier %)

*(The calculator's internal logic may use variations for precision, but this represents the core concept.)*

Variables Table:

Variable Meaning Unit Typical Range / Input Type
Rider Weight Total weight of the rider and their protective gear. kg 30 – 150+ (Adjust for rider and gear)
Bike Type Multiplier Factor adjusting for the motorcycle's intended use and weight distribution. Unitless 0.95 (Motocross) – 1.10 (Adventure)
Usage Modifier Percentage adjustment for riding style, load, or terrain. % -10% to +15% (Typical range)
Gravity (g) Acceleration due to gravity. m/s² ~9.81 (Constant)
Recommended Spring Rate The calculated optimal stiffness of the suspension spring. N/mm Output Value (e.g., 0.80 – 1.40 N/mm)

Practical Examples (Real-World Use Cases)

Example 1: Motocross Rider

  • Scenario: A motocross rider weighing 75 kg (including gear) rides a motocross bike. They are an intermediate rider, pushing the pace but not an extreme expert.
  • Inputs:
    • Rider Weight: 75 kg
    • Bike Type: Motocross Bike (Multiplier: 0.95)
    • Usage Modifier: +5% (Slightly more aggressive riding, occasional jumps)
  • Calculation:
    • Base Force = 75 kg * 9.81 m/s² ≈ 735.75 N
    • Adjusted Force = 735.75 N * 0.95 (Bike Type) * (1 + 5/100) = 735.75 * 0.95 * 1.05 ≈ 731.17 N
    • Let's assume a target sag of ~30-33mm for motocross. Using a derived spring rate formula that implicitly considers sag:
    • Calculator Output: Approximately 0.91 N/mm (Front Fork Spring) or 8.9 kg/mm (Rear Shock Spring, if using kg/mm equivalent).
  • Interpretation: This spring rate provides a good starting point for the rider. It's firm enough to handle jumps and aggressive cornering without bottoming out excessively, yet compliant enough to absorb track chatter and maintain traction. Fine-tuning might still be needed based on track conditions and personal preference.

Example 2: Adventure Touring Rider with Luggage

  • Scenario: A rider weighing 90 kg (including gear) is undertaking an extended adventure tour on a large adventure bike. They will be carrying significant luggage and potentially a passenger on some legs.
  • Inputs:
    • Rider Weight: 90 kg
    • Bike Type: Adventure/Touring Bike (Multiplier: 1.10)
    • Usage Modifier: +12% (Significant extra weight from luggage, possible passenger, and long-distance comfort needs)
  • Calculation:
    • Base Force = 90 kg * 9.81 m/s² ≈ 882.9 N
    • Adjusted Force = 882.9 N * 1.10 (Bike Type) * (1 + 12/100) = 882.9 * 1.10 * 1.12 ≈ 1084.5 N
    • Calculator Output: Approximately 1.25 N/mm (Front Fork Spring) or 12.7 kg/mm (Rear Shock Spring, if using kg/mm equivalent).
  • Interpretation: The calculated spring rate is significantly higher than the motocross example. This increased stiffness is necessary to support the substantially higher overall load (rider + luggage + bike weight influence). It prevents excessive sag, maintaining proper ride height and handling characteristics even when heavily loaded, crucial for safety and stability on long journeys.

How to Use This Race Tech Spring Weight Calculator

Using the Race Tech Spring Weight Calculator is straightforward and designed to give you a precise starting point for your suspension setup. Follow these steps:

  1. Enter Rider Weight: Accurately input your total weight in kilograms, including your riding gear (helmet, suit, boots, etc.). This is the most critical input.
  2. Select Bike Type: Choose the category that best represents your motorcycle from the dropdown menu. This selection applies a pre-defined multiplier based on typical suspension characteristics and weight distribution for that bike class.
  3. Adjust Usage Modifier: This is where you fine-tune the calculation.
    • For aggressive riding, racing, or off-road use: Enter a positive percentage (e.g., 5 for 5%).
    • For carrying heavy luggage or a passenger: Enter a positive percentage (e.g., 10 for 10%).
    • For very casual or cautious riding: You might enter a small negative percentage (e.g., -3 for -3%), although this is less common.
    • If unsure: Start with 0%.
  4. Calculate: Click the "Calculate Spring Rate" button.

Reading Your Results:

  • Recommended Spring Rate (N/mm): This is the primary output – the target stiffness for your springs in Newtons per millimeter. This is the most common unit used by suspension tuners and manufacturers today.
  • Base Rider Weight Factor: This intermediate value shows the force your rider weight generates, adjusted by gravity.
  • Bike Type Multiplier: This indicates the factor applied based on your bike selection.
  • Usage Adjustment: This shows the numerical value of the percentage you entered, converted into the force adjustment.

Use the provided conversion table if you need to cross-reference N/mm with kg/mm or lb/in.

Decision-Making Guidance:

The calculated spring rate is a recommendation, not an absolute rule. It's the best starting point based on the data provided. Always consider:

  • Feeling During Ride: Does the bike feel too harsh (bottoming out) or too soft (wallowing, excessive sag)? Adjustments are usually made in small increments (e.g., +/- 0.05 N/mm or one step on the conversion chart).
  • Consult a Professional: For critical applications like racing or if you're unsure, consult a qualified suspension technician. They can analyze your specific needs, riding style, and bike setup for the most accurate tuning.
  • Front vs. Rear: This calculator provides a general recommendation. Ideally, both front and rear springs should be calculated and matched for optimal balance. Often, the rear shock spring rate differs significantly from the fork spring rate. This tool provides a single primary recommendation, assuming it can be applied or adjusted for both.

Key Factors That Affect Race Tech Spring Weight Results

While the calculator provides a solid estimate, several real-world factors can influence the ideal spring rate and overall suspension performance:

  1. Rider Skill Level: Expert riders often push suspension harder, requiring stiffer springs to prevent bottoming out during aggressive maneuvers or large impacts. Novice riders might benefit from slightly softer springs for better comfort and feedback on smaller bumps.
  2. Suspension Linkage Ratios (Rear Shock): The rising rate of a motorcycle's rear suspension linkage significantly impacts how the shock spring performs. A linkage that progressively stiffens the suspension will require a different initial spring rate compared to a more linear linkage, even with the same rider and bike weight.
  3. Suspension Valving (Internal Damping): While spring rate determines how much the suspension compresses under load (static sag) and initial impact, the internal valving controls how quickly it compresses and rebounds (damping). Incorrect damping can make even correctly sprung suspension feel harsh or uncontrolled.
  4. Tyre Pressure and Type: Tyre pressure affects the overall suspension feel. Lower pressures can provide more compliance but may reduce stability. The type of tyre (e.g., knobbie vs. slick) also influences grip and how the bike reacts to the terrain.
  5. Chassis Geometry and Adjustments: Modifications to the motorcycle's geometry (e.g., triple clamp offset, swingarm length, ride height adjustments) can alter weight distribution and handling dynamics, potentially requiring spring rate compensation.
  6. Terrain and Track Conditions: The type of surface ridden is crucial. A motocross track with large jumps and rough landings needs different spring rates than a smooth road race circuit or a technical off-road trail.
  7. Wear and Tear: Over time, suspension components can wear, affecting performance. Bushings, seals, and even the springs themselves can degrade, leading to a loss of damping or spring force, necessitating maintenance or replacement.
  8. Spring Free Length and Condition: Springs can lose tension over time or if subjected to extreme loads. While this calculator assumes a new, properly functioning spring, the actual condition of existing springs matters.

Frequently Asked Questions (FAQ)

Q1: What is the difference between spring rate (N/mm) and sag?

A: Spring rate (measured in N/mm) is a measure of the spring's stiffness – how much force is required to compress it by one millimeter. Sag is the amount the suspension compresses under the static weight of the rider and bike. The spring rate is chosen to achieve a specific amount of sag, which is crucial for proper suspension balance and performance.

Q2: Can I use the same spring rate for my front forks and rear shock?

A: Not typically. While this calculator provides a single primary recommendation, fork and shock springs often have different requirements due to their mounting points, linkage ratios (for the rear), and how they interact with the chassis. It's best to consult manufacturer specifications or a suspension tuner for specific front and rear spring recommendations.

Q3: My calculator result seems high/low. What should I do?

A: Double-check your inputs, especially rider weight and the usage modifier. If they are correct, the calculator provides a scientifically derived starting point. Consider your personal riding experience: if you're a very light rider on a heavy bike or vice-versa, the result might seem unusual. Trust the calculation as a baseline and be prepared for minor adjustments.

Q4: What does a negative Usage Modifier mean?

A: A negative usage modifier suggests a lighter load or less aggressive riding than average for the selected bike type. For example, a rider who primarily cruises on smooth roads with minimal gear might use a slight negative adjustment. However, it's generally advisable to use a zero modifier unless you have a specific reason.

Q5: How often should I check or change my suspension springs?

A: Suspension springs themselves don't typically "wear out" quickly, but their performance can be affected by the condition of other suspension components (oil, seals, bushings). A general guideline is to service suspension internals every 20-50 hours of riding for motocross/off-road and potentially longer for street/touring. Spring replacement is usually only needed if they are damaged or if you've significantly changed your weight or riding requirements.

Q6: Does this calculator account for the bike's actual weight?

A: Indirectly. The 'Bike Type Multiplier' is influenced by the typical weight and design of different motorcycle categories. While the calculator focuses on rider weight as the primary variable load, the multiplier helps normalize for the bike's baseline contribution to suspension load and dynamics.

Q7: I'm a beginner. Should I use a softer or stiffer spring?

A: For beginners, a spring rate closer to the calculated recommendation, perhaps leaning slightly softer if unsure, is often beneficial. This provides more comfort and predictability. Overly stiff suspension can be jarring and make it harder to feel what the bike is doing.

Q8: Where can I find the spring rate of my current suspension?

A: Check your motorcycle's owner's manual, the manufacturer's service manual, or look for markings directly on the springs themselves (often in kg/mm or lb/in). You can then use the conversion table on this page to see the equivalent N/mm rate.

© 2023 Your Website Name. All rights reserved.

Disclaimer: This calculator provides estimates based on common formulas. Always consult with a professional suspension technician for critical applications.

var ctx = null; var springRateChartInstance = null; function getInputValue(id, type = 'number') { var element = document.getElementById(id); if (!element) return NaN; var value = element.value; if (value === "") return NaN; if (type === 'number') { var numValue = parseFloat(value); return isNaN(numValue) ? NaN : numValue; } return value; } function setErrorMessage(id, message) { var errorElement = document.getElementById(id); if (errorElement) { errorElement.textContent = message; } } function clearErrorMessages() { setErrorMessage('riderWeightError', "); setErrorMessage('bikeTypeError', "); setErrorMessage('usageFactorError', "); } function validateInputs() { var riderWeight = getInputValue('riderWeight'); var bikeType = getInputValue('bikeType'); var usageFactor = getInputValue('usageFactor'); var isValid = true; if (isNaN(riderWeight) || riderWeight <= 0) { setErrorMessage('riderWeightError', 'Please enter a valid positive rider weight.'); isValid = false; } if (isNaN(usageFactor)) { setErrorMessage('usageFactorError', 'Please enter a valid number for the usage modifier.'); isValid = false; } // No specific validation for bikeType select as it always has a value return isValid; } function calculateSpringWeight() { clearErrorMessages(); if (!validateInputs()) { document.getElementById('primaryResult').textContent = '–'; document.getElementById('baseWeightFactor').textContent = '–'; document.getElementById('bikeTypeMultiplier').textContent = '–'; document.getElementById('usageAdjustment').textContent = '–'; return; } var riderWeight = getInputValue('riderWeight'); // in kg var bikeTypeMultiplier = parseFloat(document.getElementById('bikeType').value); var usageFactor = getInputValue('usageFactor'); // in % // Constants var gravity = 9.81; // m/s^2 // Intermediate Calculations var baseForceN = riderWeight * gravity; // Force in Newtons var usageMultiplier = 1 + (usageFactor / 100); var adjustedForceN = baseForceN * bikeTypeMultiplier * usageMultiplier; // This is a simplified model. In reality, spring rate = Force / Sag. // Since sag is usually a percentage of travel, and we don't have travel input, // we use a common industry approximation that scales force to a typical N/mm rate. // A common target sag is ~30-33mm for forks, ~100-110mm for rear shocks. // The formula effectively incorporates a typical sag value implicitly. // For simplicity and direct output, we'll scale the adjusted force. // A common factor relates adjusted force (N) to N/mm rate. // Let's assume an implicit sag of ~30mm for demonstration purposes for forks, or ~100mm for shocks. // A better approach uses actual suspension travel, but for a simplified calculator: // Let's use a direct proportionality factor that maps the adjusted force to a typical N/mm range. // This factor is derived empirically or based on average suspension travel and sag percentages. // Example: If 500N needs ~0.5 N/mm spring for 100mm travel = 500N / 100mm = 5 N/mm? No. // Spring rate = Force / Displacement. If 500N causes 30mm sag, rate = 500 / 30 = 16.6 N/mm. // This seems too high compared to common values. // Let's re-evaluate the formula based on common Race Tech practice, often kg/mm or lb/in. // Race Tech often uses kg/mm for rear shocks and lb/in for forks. // Let's target N/mm directly, and use a conversion factor. // A rider force of ~735N (75kg) might need ~0.8 N/mm fork spring. // A rider force of ~882N (90kg) might need ~1.0 N/mm fork spring. // The ratio seems roughly linear with Force. Force = SpringRate * Sag. // So, SpringRate = Force / Sag. If Sag is constant (e.g., 30mm), then SpringRate is proportional to Force. // Let's use a scaling factor: SpringRate (N/mm) = AdjustedForce (N) / TypicalSag (mm). // Assume TypicalSag = 30mm for simplicity as a general indicator. var typicalSagMM = 30; // This is a simplification. Real sag varies by bike and setup. var recommendedSpringRate = adjustedForceN / typicalSagMM; // Clamp results to a reasonable range if needed, though the inputs should guide this. if (recommendedSpringRate 3.0) recommendedSpringRate = 3.0; // Maximum practical spring rate // Display Results document.getElementById('primaryResult').textContent = recommendedSpringRate.toFixed(2); document.getElementById('baseWeightFactor').textContent = baseForceN.toFixed(1); document.getElementById('bikeTypeMultiplier').textContent = bikeTypeMultiplier.toFixed(2); document.getElementById('usageAdjustment').textContent = usageFactor.toFixed(0) + '%'; updateChart(); } function resetCalculator() { document.getElementById('riderWeight').value = 80; document.getElementById('bikeType').value = '1.00'; // Default to Road/Street Bike document.getElementById('usageFactor').value = 0; clearErrorMessages(); calculateSpringWeight(); // Recalculate with defaults } function copyResults() { var riderWeight = getInputValue('riderWeight'); var bikeType = parseFloat(document.getElementById('bikeType').value); var usageFactor = getInputValue('usageFactor'); var primaryResult = document.getElementById('primaryResult').textContent; var baseWeightFactor = document.getElementById('baseWeightFactor').textContent; var bikeTypeMultiplier = document.getElementById('bikeTypeMultiplier').textContent; var usageAdjustment = document.getElementById('usageAdjustment').textContent; if (primaryResult === '–') { alert("Please calculate the results before copying."); return; } var resultsText = "— Motorcycle Suspension Spring Rate Calculation —\n\n"; resultsText += "Inputs:\n"; resultsText += "- Rider Weight: " + riderWeight.toFixed(1) + " kg\n"; resultsText += "- Bike Type Multiplier: " + bikeTypeMultiplier.toFixed(2) + "\n"; resultsText += "- Usage Modifier: " + usageFactor.toFixed(0) + "%\n\n"; resultsText += "Key Assumptions:\n"; resultsText += "- Formula Used: Adjusted Force / Typical Sag (approx. 30mm)\n\n"; resultsText += "Results:\n"; resultsText += "Recommended Spring Rate: " + primaryResult + " N/mm\n"; resultsText += "Base Rider Weight Force: " + baseWeightFactor + " N\n"; resultsText += "Applied Bike Type Multiplier: " + bikeTypeMultiplier.toFixed(2) + "\n"; resultsText += "Applied Usage Adjustment: " + usageAdjustment + "\n"; try { navigator.clipboard.writeText(resultsText).then(function() { alert('Results copied to clipboard!'); }, function(err) { console.error('Could not copy text: ', err); prompt("Copy these results manually:", resultsText); }); } catch (e) { console.error('Clipboard API not available', e); prompt("Copy these results manually:", resultsText); } } function initializeChart() { var canvas = document.getElementById('springRateChart'); if (!canvas) return; ctx = canvas.getContext('2d'); springRateChartInstance = new Chart(ctx, { type: 'line', data: { labels: [], // Will be populated by updateChart datasets: [{ label: 'Recommended Spring Rate (N/mm)', data: [], // Will be populated by updateChart borderColor: 'var(–primary-color)', backgroundColor: 'rgba(0, 74, 153, 0.1)', fill: false, tension: 0.1 }, { label: 'Force (N)', data: [], // Will be populated by updateChart borderColor: 'var(–success-color)', backgroundColor: 'rgba(40, 167, 69, 0.1)', fill: false, tension: 0.1, yAxisID: 'forceAxis' // Use a secondary y-axis for force }] }, options: { responsive: true, maintainAspectRatio: false, scales: { x: { title: { display: true, text: 'Rider Weight (kg)' } }, y: { title: { display: true, text: 'Spring Rate (N/mm)' }, beginAtZero: true }, forceAxis: { // Configuration for the secondary y-axis type: 'linear', position: 'right', title: { display: true, text: 'Rider Force (N)' }, grid: { drawOnChartArea: false, // Only affects the grid lines for this axis }, beginAtZero: true } }, plugins: { tooltip: { mode: 'index', intersect: false, }, legend: { position: 'top', } }, interaction: { mode: 'nearest', axis: 'x', intersect: false } } }); } function updateChart() { if (!springRateChartInstance) { initializeChart(); if (!springRateChartInstance) return; // Still couldn't initialize } var riderWeightInput = document.getElementById('riderWeight'); var bikeTypeMultiplierInput = parseFloat(document.getElementById('bikeType').value); var usageFactorInput = getInputValue('usageFactor'); var dataPoints = 10; // Number of points to generate for the chart var minWeight = 30; // Minimum weight for chart range var maxWeight = 150; // Maximum weight for chart range var weightStep = (maxWeight – minWeight) / (dataPoints – 1); var labels = []; var springRates = []; var forces = []; var gravity = 9.81; var typicalSagMM = 30; // Consistent with calculation for (var i = 0; i < dataPoints; i++) { var currentWeight = minWeight + (i * weightStep); labels.push(currentWeight.toFixed(0)); var baseForceN = currentWeight * gravity; var usageMultiplier = 1 + (usageFactorInput / 100); var adjustedForceN = baseForceN * bikeTypeMultiplierInput * usageMultiplier; var recommendedSpringRate = adjustedForceN / typicalSagMM; // Clamp values for chart display if they go out of practical range if (recommendedSpringRate < 0) recommendedSpringRate = 0; if (adjustedForceN < 0) adjustedForceN = 0; springRates.push(recommendedSpringRate); forces.push(adjustedForceN); } springRateChartInstance.data.labels = labels; springRateChartInstance.data.datasets[0].data = springRates; springRateChartInstance.data.datasets[1].data = forces; springRateChartInstance.update(); } // Initial calculation on load document.addEventListener('DOMContentLoaded', function() { calculateSpringWeight(); // Ensure chart is initialized and updated if inputs are present updateChart(); });

Leave a Comment