Spring Design Optimization
Spring Design Optimization
A compression spring is a spring that is designed to operate with a compressive force, typically
to absorb shock or to return a component to its original position. Compression springs are
usually made from coils of wire and have several important features such as height, an outer
diameter, an inner diameter, and a wire diameter. They can be used in a variety of applications,
such as in car suspensions and valve mechanisms.
Specification and Modelling Equations:
The specifications and modeling equations for compression spring create a number of trade-
offs that must be considered during design. We wish to determine the spring design that
maximizes the force of a spring at its preload height, ho, of 1.0 inches. The spring is to operate
an indefinite number of times through a deflection o, of 0.4 inches, which is an additional
deflection from ho. The stress at the solid height, hs, must be less than Sy to protect the spring
from inadvertent damage.
The variables defining the design of a spring are d, D, n, ho and hf,
Where,
d = wire diameter
D = coil diameter
n = number of coils in the spring
ho = preload height
hf = free height (spring exerting no force)
Page 1 of 3
where K is the Wahl factor that accounts for stress concentration due to curvature of the
spring as well as direct shear:
5𝐷−𝑑 𝑑
𝐾 = 4(𝐷−𝑑) + 0.62 𝐷 … (4)
Solid height, hs, is the height at which the coils of the compressed spring close up. It is
simply,
hs= nd … (5)
If the spring is to operate indefinitely through a deflection o , it must be designed so that the
material does not fail in fatigue. A fatigue criterion for compression spring design is
𝑆
𝜏𝑎 ≤ 𝑆 𝑒 … (6)
𝑓
𝑆𝑦
𝜏 𝑎 + 𝜏𝑚 ≤ … (7)
𝑆𝑓
Where 𝜏𝑚 is the mean shear stress and 𝜏𝑎 is the alternating shear stress, defined to be,
𝜏 +𝜏
𝜏𝑚 = 𝑚𝑎𝑥2 𝑚𝑖𝑛 … (8)
𝜏 −𝜏
𝜏𝑎 = 𝑚𝑎𝑥2 𝑚𝑖𝑛 … (9)
and where Sf is a factor of safety, Se is the endurance limit, and Sy is the yield strength in shear.
Sf and Se are constants, but Sy is a function of material properties Q and w, according to the
relation,
𝑄
𝑆𝑦 = 0.44 𝑑𝑤 … (10)
Also, to be reasonable, the ratio D/ d should be 4 D/ d 16 . The diameters of wire considered
should be 0.01 d 0.2 inches. The maximum allowable width for the spring, i.e., (D + d) , is
0.75 inches. To ensure that the spring does not reach solid height in service, a clash allowance
of 0.05 inches should be provided. This means the solid height should be at least 0.05 inches
below the lowest point of deflection the spring reaches in service.
G = 12 × 106 psi
Sf = 1.5
Se = 45,000 psi
Q = 150,000 psi
w = 0.18
Also assume the number of coils is continuous for optimization. (After optimizing you can
round off to the nearest integer if you wish.)
Formulate the problem and optimize the objective using ‘fmincon’ function. Apply
‘interior-point’ algorithm for solving
Hint:
# Model Parameters
delta_0 = 0.4 # inches (spring deflection)
h_0 = 1.0 # inches (preload height)
Q = 15e4 # psi
G = 12e6 # psi
S_e = 45e3 # psi
S_f = 1.5
w = 0.18
Page 2 of 3
# Variables
# inches (wire diameter)
d_wire = m.Var(value=0.07247, lb = 0.01, ub = 0.2)
# inches (coil diameter)
d_coil = m.Var(value=0.6775, lb = 0.0)
# number of coils in the spring
n_coils = m.Var(value=7.58898, lb = 0.0)
# inches (free height spring exerting no force)
h_f = m.Var(value=1.368117, lb = 1.0)
F = m.Var() # Spring force
# Intermediates
S_y = m.Intermediate((0.44 * Q) / (d_wire**w))
h_s = m.Intermediate(n_coils * d_wire)
k = m.Intermediate((G * d_wire**4)/(8 * d_coil**3 * n_coils))
kW = m.Intermediate((4 * d_coil - d_wire)/(4 * (d_coil-d_wire)) \
+ 0.62 * d_wire/d_coil)
n = m.Intermediate((8 * kW * d_coil)/(pi * d_wire**3))
tau_max = m.Intermediate((h_f - h_0 + delta_0) * k * n)
tau_min = m.Intermediate((h_f - h_0) * k * n)
tau_mean = m.Intermediate((tau_max + tau_min) / 2)
tau_alt = m.Intermediate((tau_max - tau_min) / 2)
h_def = m.Intermediate(h_0 - delta_0)
tau_hs = m.Intermediate((h_f - h_s) * k * n)
# Equations
m.Equations([
F == k * (h_f - h_0),
d_coil / d_wire >= 4,
d_coil / d_wire <= 16,
d_coil + d_wire < 0.75,
h_def - h_s > 0.05,
tau_alt < S_e / S_f,
tau_alt + tau_mean < S_y / S_f,
tau_hs < S_y / S_f
])
$$$
Page 3 of 3