Later we will need to find the root of a non-linear equation, so we import the function bisect
from the library scipy.optimize
.
In [1]:
from scipy.optimize import bisect
In [2]:
def TR(b,z):
return sqrt(1+4*b*b*z*z)/sqrt((1-b*b)**2+4*b*b*z*z)
The data of the problem is input in the next cell, the requested value of the TR is computed here too.
Note that in the following we make reference to a first stage 0
where $\zeta_0=0$ and
a second stage 1
where $\zeta_1=5\%$.
In [3]:
m_0 = 4200.00
f_orig = 3600.00
freq = 15.00
f_tran = 400.00
tr_req = f_tran/f_orig
z_0 = 0.00
c_0 = 0.00
z_1 = 0.05
The value of the frequency ratio in stage 0 can be computed using bisect. Note that bisect
find the zero of a function in an interval where the function changes its sign.
In [4]:
beta_0 = bisect(lambda x: TR(x,z_0) - tr_req, 1.5, 100)
In the cell above, lambda x: TR(x, z_0) - tr_req
defines on the fly a function of one parameter
(here x
) that returns the value of the difference of the TR, computed for z=z_0
,
and the target level of the TR.
Having $\beta$, we can compute $k$ at stage 0, k_0
.
From $k = m \omega_n^2$ and $\omega_n = \omega/\beta$ we can write
In [5]:
k_0 = m_0 * (2*pi*freq/beta_0)**2
In the second stage, we have $\zeta=5\%=\zeta_1$, so we can immediately compute $\beta_1$:
In [6]:
beta_1 = bisect(lambda x: TR(x,z_1)-tr_req, 1.5,100)
As requested, the stiffness must be the same as in the first stage, so we must change the mass, introducing some ballast. The new value of the mass must be computed as follows:
In [7]:
k_1 = k_0
m_1 = k_1 / (2*pi*freq/beta_1)**2
Having the new values of $k$ and $m$ we can compute $c$
In [8]:
c_1 = 2 * 0.05 * sqrt(m_1*k_1)
Finally we print our results
In [9]:
print " damping stiffness"
print " Stage mass kg N×s/m kN/m beta 1/TR"
print "------ -------- -------- -------- -------- --------"
fmt = " %d %7.2f %7.1f %7.2f %7.5f %7.5f"
print fmt % ( 1, m_0, c_0, k_0/1000, beta_0, 1/TR(beta_0,z_0))
print fmt % ( 2, m_1, c_1, k_1/1000, beta_1, 1/TR(beta_1,z_1))