Invntr
Source

All instruments

spring_design

Helical compression spring of round wire from wire and coil diameter, active coils, moduli, free length and load: rate, deflection, shear stress with the Wahl factor (Bergstrasser and direct-shear alongside), solid length and clash allowance by end type, buckling (critical deflection and the never-buckles free length), surge frequency, safety factor against a given allowable shear stress. Material figures are inputs; no strength table is built in.

Field
Mechanics, CAD and finite elements
Version
0.1.0
Runs as
Compiled (Rust)
Typical run
0.05 s

Compiled from source: run sh packs/install.sh once before admitting it.

Known answers it must pass

Admission replayspring_design 0.1.0 · files aa977d7435de…034a
  1. r0001closed forms k = G d^4/(8 D^3 Na), Kw = (4C-1)/(4C-4) + 0.615/C, tau = Kw 8FD/(pi d^3): d = 2, D = 16, Na = 10, G = 80 GPa, F = 39.0625 N give k = 3.90625 N/mm and y = 10 mm exactly, C = 8, Kw = 31/28 + 0.615/8, KB = 34/29, Ks = 17/16, tau = Kw 625/pi MPa, energy = k y^2/2 = 0.1953125 J (1e-9: exact arithmetic)passed

    rate_N_per_mm3.90625 ± 3.9e-093.90625lockedunder 0.01 % of the tolerance used
    deflection_mm10 ± 1e-0810lockedunder 0.01 % of the tolerance used
    spring_index8 ± 8e-128lockedunder 0.01 % of the tolerance used
    wahl_factor1.18402 ± 1.2e-091.18402lockedunder 0.01 % of the tolerance used
    bergstrasser_factor1.17241 ± 1.2e-091.17241lockedunder 0.01 % of the tolerance used
    direct_shear_factor1.0625 ± 1.1e-091.0625lockedunder 0.01 % of the tolerance used
    shear_stress_uncorrected_MPa198.944 ± 2e-07198.944lockedunder 0.01 % of the tolerance used
    shear_stress_MPa235.553 ± 2.4e-07235.553lockedunder 0.01 % of the tolerance used
    energy_stored_J0.195312 ± 2e-100.195312lockedunder 0.01 % of the tolerance used
  2. r0002solid length and clash, squared and ground ends (Nt = Na + 2, Ls = d Nt, p = (L0 - 2d)/Na): d = 2, Na = 10, L0 = 50 give Nt = 12, Ls = 24 mm, pitch 4.6 mm, travel 26 mm, force at solid 26 k = 101.5625 N; at F = 39.0625 N length 40 mm, margin 16 mm, allowance 62.5/39.0625 = 1.6; allowable 500 MPa gives safety factor 500/(Kw 625/pi) and 500/(Kw 1625/pi) at solid (1e-9: exact arithmetic)passed

    total_coils12 ± 1.2e-1112lockedunder 0.01 % of the tolerance used
    solid_length_mm24 ± 2.4e-1124lockedunder 0.01 % of the tolerance used
    pitch_mm4.6 ± 4.6e-094.6lockedunder 0.01 % of the tolerance used
    travel_to_solid_mm26 ± 2.6e-1126lockedunder 0.01 % of the tolerance used
    force_at_solid_N101.562 ± 1e-07101.562lockedunder 0.01 % of the tolerance used
    length_at_load_mm40 ± 4e-0840lockedunder 0.01 % of the tolerance used
    clash_margin_mm16 ± 1.6e-0816lockedunder 0.01 % of the tolerance used
    clash_allowance1.6 ± 1.6e-091.6lockedunder 0.01 % of the tolerance used
    shear_stress_at_solid_MPa612.437 ± 6.1e-07612.437lockedunder 0.01 % of the tolerance used
    safety_factor2.12267 ± 2.1e-092.12267lockedunder 0.01 % of the tolerance used
    safety_factor_at_solid0.81641 ± 8.2e-100.81641lockedunder 0.01 % of the tolerance used
    solid_at_load= falsefalselockedexact match
    all_ok= truetruelockedexact match
  3. r0003textbook: Shigley, Mechanical Engineering Design, Example 10-1 (no. 16 music wire d = 0.037 in, OD 7/16 in so D = 0.4005 in, squared ends, 12.5 total turns so Na = 10.5, G = 11.85 Mpsi, load 6.46 lbf, L0 = 2.06 in), converted to SI. Book: k = 4.13 lbf/in, y = 1.56 in, C = 10.8, KB = 1.124, Ls = (Nt + 1) d = 0.4995 in, pitch 0.186 in, stress at that load = Ssy = 145.9 kpsi. Tolerances 0.5 % (1 % on y) because the book carries three figures and rounds between steps (its k is 0.35 % above the closed form); Ls is exactpassed

    rate_N_per_mm0.723274 ± 0.00360.720761locked69 % of the tolerance used
    deflection_mm39.624 ± 0.439.6367locked3.2 % of the tolerance used
    spring_index10.8 ± 0.05410.8243locked45 % of the tolerance used
    bergstrasser_factor1.124 ± 0.00111.12408locked6.9 % of the tolerance used
    total_coils12.5 ± 1.3e-1112.5lockedunder 0.01 % of the tolerance used
    solid_length_mm12.6873 ± 1.3e-0812.6873lockedunder 0.01 % of the tolerance used
    pitch_mm4.7244 ± 0.0244.71472locked41 % of the tolerance used
    shear_stress_bergstrasser_MPa1005.95 ± 51002.2locked74 % of the tolerance used
  4. r0004buckling closed form (Shigley eqs. 10-10 to 10-12): E = 200, G = 80 GPa give C1 = 5/6, C2 = 2 pi^2/3; D = 16 mm between flat plates (alpha = 0.5): never buckles below 32 pi sqrt(2/3) = 82.0832 mm; L0 = 100 mm gives lambda = 3.125, y_cr = 100 (5/6)(1 - sqrt(1 - (2 pi^2/3)/3.125^2)) = 35.7358 mm; load 39.0625 N deflects 10 mm so margin = y_cr/10 and no buckling (1e-9: exact arithmetic)passed

    buckling_slenderness3.125 ± 3.1e-123.125lockedunder 0.01 % of the tolerance used
    stable_free_length_mm82.0832 ± 8.2e-0882.0832lockedunder 0.01 % of the tolerance used
    buckling_deflection_mm35.7358 ± 3.6e-0835.7358lockedunder 0.01 % of the tolerance used
    buckling_margin3.57358 ± 3.6e-093.57358lockedunder 0.01 % of the tolerance used
    absolutely_stable= falsefalselockedexact match
    buckles= falsefalselockedexact match
  5. r0005buckling, same spring on pivoted ends (alpha = 1): lambda = 6.25, never-buckles length halves to 16 pi sqrt(2/3) = 41.0416 mm, y_cr = 100 (5/6)(1 - sqrt(1 - (2 pi^2/3)/6.25^2)) = 7.34180 mm, below the 10 mm deflection: buckles, verdict fails (1e-9: exact arithmetic)passed

    buckling_slenderness6.25 ± 6.3e-126.25lockedunder 0.01 % of the tolerance used
    stable_free_length_mm41.0416 ± 4.1e-0841.0416lockedunder 0.01 % of the tolerance used
    buckling_deflection_mm7.3418 ± 7.3e-097.3418lockedunder 0.01 % of the tolerance used
    buckles= truetruelockedexact match
    all_ok= falsefalselockedexact match
  6. r0006textbook: Shigley eq. 10-13 and Example 10-1(g), steel springs never buckle when L0 < 2.63 D/alpha: E = 207, G = 79.3 GPa, D = 0.4005 in = 10.1727 mm, alpha = 0.5 give the book's 2.11 in = 53.594 mm (0.5 %: the book rounds the coefficient to 2.63, the closed form gives 2.626); L0 = 50 mm is below it, so absolutely stablepassed

    stable_free_length_mm53.594 ± 0.2753.4224locked64 % of the tolerance used
    absolutely_stable= truetruelockedexact match
    buckles= falsefalselockedexact match
  7. r0007surge closed form f = (1/2) sqrt(k/m) = d/(2 pi D^2 Na) sqrt(G/(2 rho)), m = rho pi^2 d^2 D Na/4: d = 2 mm, D = 16 mm, Na = 10, G = 81 GPa, rho = 8000 kg/m^3 give sqrt(G/(2 rho)) = 2250 m/s exactly, f = 878.90625/pi = 279.76455 Hz, m = 1.28 pi^2 = 12.63309 g; drive at 10 Hz gives ratio f/10 (1e-9: exact arithmetic)passed

    surge_frequency_Hz279.765 ± 2.8e-07279.765lockedunder 0.01 % of the tolerance used
    active_mass_g12.6331 ± 1.3e-0812.6331lockedunder 0.01 % of the tolerance used
    surge_ratio27.9765 ± 2.8e-0827.9765lockedunder 0.01 % of the tolerance used
  8. r0008surge with one end free, f = (1/4) sqrt(k/m): half the two-plate value, 439.453125/pi = 139.88227 Hz (1e-9: exact arithmetic)passed

    surge_frequency_Hz139.882 ± 1.4e-07139.882lockedunder 0.01 % of the tolerance used
  9. r0009surge check: the two-plate spring above (f = 878.90625/pi Hz) driven at 20 Hz gives ratio 43.9453125/pi = 13.98823 < 15, so the verdict fails on resonance alone (1e-9: exact arithmetic)passed

    surge_ratio13.9882 ± 1.4e-0813.9882lockedunder 0.01 % of the tolerance used
    all_ok= falsefalselockedexact match
  10. r0010overload: F = 150 N exceeds the force at solid 101.5625 N (same spring as the first case), so the spring is solid: deflection capped at the travel 26 mm, length = Ls = 24 mm, clash margin 0, allowance (101.5625 - 150)/150 = -0.3229166667, verdict failspassed

    solid_at_load= truetruelockedexact match
    deflection_mm26 ± 2.6e-0826lockedunder 0.01 % of the tolerance used
    length_at_load_mm24 ± 2.4e-0824lockedunder 0.01 % of the tolerance used
    clash_margin_mm0 ± 1e-090lockedunder 0.01 % of the tolerance used
    clash_allowance-0.322917 ± 3.2e-10-0.322917lockedunder 0.01 % of the tolerance used
    shear_stress_MPa612.437 ± 6.1e-07612.437lockedunder 0.01 % of the tolerance used
    all_ok= falsefalselockedexact match
10 of 10 cases passed · sandbox macos-seatbeltrecorded from the kernel in a fresh lab

Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.

Inputs

NameUnitDefaultMeaning
wire_diameter_mmmm2.0Wire diameter d.
mean_coil_diameter_mmmm16.0Mean coil diameter D = outside diameter minus the wire diameter. Must exceed the wire diameter.
active_coils110.0Active coils Na (the ones that deflect). Fractions allowed.
shear_modulus_GPaGPa79.3Shear modulus G of the wire. Default: carbon spring steel.
elastic_modulus_GPaGPa207.0Elastic modulus E of the wire, used by the buckling check only. Must exceed G. Default: carbon steel.
free_length_mmmm50.0Unloaded length L0. Must exceed the solid length.
load_NN40.0Compressive working load F.
end_typesquared_groundHow the end coils are finished: sets total coils, solid length and pitch.
end_fixityfixed_fixedHow the ends are held, for buckling (alpha = 0.5, 0.707, 1, 2) and surge (1/2 sqrt(k/m), or 1/4 with a free end). fixed_fixed is a spring between flat parallel plates.
density_kg_per_m3kg/m^37850.0Wire density, for the surge frequency. Default: steel.
allowable_shear_MPaMPaAllowable shear stress of the wire (its torsional yield strength, from the datasheet). Leave out and strength is not judged.
min_safety_factor11.2Required allowable / Wahl shear stress at the load.
min_clash_allowance10.15Required (force at solid - load) / load: the reserve before the coils touch.
operating_frequency_HzHzFrequency of the applied load, to compare with the surge frequency. Optional.
min_surge_ratio115.0Required surge frequency / operating frequency (15 to 20 is the usual rule). Judged only when an operating frequency is given.

Readings

NameUnitMeaning
spring_index1
rate_N_per_mmN/mm
deflection_mmmm
length_at_load_mmmm
wahl_factor1
bergstrasser_factor1
direct_shear_factor1
shear_stress_MPaMPa
shear_stress_uncorrected_MPaMPa
shear_stress_bergstrasser_MPaMPa
shear_stress_static_MPaMPa
total_coils1
solid_length_mmmm
pitch_mmmm
travel_to_solid_mmmm
force_at_solid_NN
shear_stress_at_solid_MPaMPa
clash_margin_mmmm
clash_allowance1
solid_at_load
buckling_slenderness1
stable_free_length_mmmm
absolutely_stable
buckling_deflection_mmmm
buckling_margin1
buckles
active_mass_gg
surge_frequency_HzHz
surge_ratio1
safety_factor1
safety_factor_at_solid1
energy_stored_JJ
outer_diameter_mmmm
inner_diameter_mmmm
wire_length_mmmm
all_ok
problems
advisories
files

Try the call

Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.

Terminal
MCP call