Determine the equivalent spring constant of the system shown in Figure 1.
Figure 1 - Spring system
From Figurre 1 it can be noticed that two springs with stiffness of k1 are parallely connected springs. So we can write the following:
keq1=k1+k1=2k1
To solve this example in Python the sympy library is required. The sympy library usually comes with the the anaconda python distribution. However, if you have installed only Python then you have to install the sympy library.
The first step is to create the symbols k1,...,k5.
These two springs are connected in series with a spring with stiffness k2. The equivalent stiffness of these three springs are:
1keq2=1keq1+1k2=12k1+1k21keq2=k2+2k12k1k2keq2=2k1k2k2+2k1
The springs with equivalent stiffness of k3 are connected in parallel. The stiffness of these two springs can be written as:
keq3=k3+k3=2k3
These two springs are connected in series with previous springs keq2.
1keq31=1keq3+1keq2=12k3+12k1+1k21keq31=12k3+k2+2k12k1k21keq31=k1k2+k2k3+2k1k32k1k2k3
The spring system (keq31) is connected in parallel with spring of stiffness k4 so we can write the following:
keq4=keq31+k4
The previous system is connected in serial with the spring k5. So the keq is equal to:
1keq=1keq4+1k51keq=k5+keq4keq4k5keq=keq4k5k5+keq4keq=(keq31+k4)k5k5+k4+keq31keq=(2k1k2k3k1k2+k2k3+2k1k3+k4)k5k5+k4+2k1k2k3k1k2+k2k3+2k1k3keq=k2k3k4k5+2k1k3k4k5+k1k2k4k5+2k1k2k3k5k2k3k4+k2k3k5+2k1k3k4+2k1k3k5+k1k2k4+k1k2k5+2k1k2k3
Solution in Python
To solve this example in Python the sympy library is required. The sympy library usually comes with the the anaconda python distribution. However, if you have installed only Python then you have to install the sympy library.
pip install sympyWhen sympy libarary is installed type in the follwing code in Python.
from sympy import symbols, simplifyThe symbols function will be used to create the variables in this case the spring constants k1,k2,...,k5. The simplify function will be used to simplify the equations of created equivalent spring stiffness.
The first step is to create the symbols k1,...,k5.
k1,k2,k3,k4,k5 = symbols('k1,k2,k3,k4,k5')After symbols are created we can start solving the example step by step. The keq1 is the equivalent stiffness of two springs k1 in parallel configuration.
keq1 = k1 + k1The output of the previous code will be:
print("keq1 = {}".format(keq1))
keq1 = 2*k1The k2 spring is connected with the two k1 springs in serial configuration. So we have two k1 spring in parallel cofiguration and the k2 spring connected with the previous system in the serial configuration.
keq2 = simplify(1/(1/keq1 + 1/k2))The result of the previous block of code for keq2 is:
print("keq2 = {}".format(keq2))
keq2 = 2*k1*k2/(2*k1 + k2)After the k2 spring there are two k3 springs connceted in parallel. The equivalent spring stiffness of these two spring can be calculated as:
keq3 = k3 + k3The output is given below:
print("keq3 = {}".format(keq3))
keq3 = 2*k3The keq2 and keq3 together are connected in serial configuration. The equivalent stiffness of such system (keq31) can be written as:
keq31 = simplify(1/(1/keq3 + 1/keq2))The otuput is given below.
print("keq31 = {}".format(keq31))
2*k1*k2*k3/(k1*k2 + k3*(2*k1 + k2))The entire system keq31 is placed in parallel configuration with k4 spring. The equivalent stiffness keq4 of such system can be wrritten as:
keq4 = simplify(keq31 + k4)The output of previous two lines of code is given below.
print("keq4 = {}".format(keq4))
keq4 = (2*k1*k2*k3 + k4*(k1*k2 + k3*(2*k1 + k2)))/(k1*k2 + k3*(2*k1 + k2))The previous system keq4 is connected with the k5 in the serial configuration. The spring stiffness of the entire system keq can be calculated as:
keq = simplify(1/(1/keq4 + 1/k5))The spring stiffness of the entire system is obtained after previous two lines of code are exectued.
print("keq = {}".format(keq))
keq = k5*(2*k1*k2*k3 + k4*(k1*k2 + k3*(2*k1 + k2)))/(2*k1*k2*k3 + k4*(k1*k2 + k3*(2*k1 + k2)) + k5*(k1*k2 + k3*(2*k1 + k2)))
Nema komentara:
Objavi komentar