Programa de Pós-Graduação em Engenharia Civil (PPGEC)
1. The vibrating beam equation
2. Free vibration solution
3. Vibration modes and frequencies
4. Solution by approximation
5. Assignment
Prof. Marcelo M. Rocha, Dr.techn. (ORCID)
Porto Alegre, RS, Brazil
# Importing Python modules required for this notebook
# (this cell must be executed with "shift+enter" before any other Python cell)
import numpy as np
import matplotlib.pyplot as plt
The static analysis of a beam under Bernoulli's hypothesis (plane sections remain plane after beam deformation) leads to the well known differential equations:
dQdx=−q(x)dMdx=Q(x)EIψ′=M(x)where q(x) is the distributed transversal loading, Q(x) is the shear, M(x) is the bending moment, ψ(x) is the section rotation, and EI is the flexural stiffness (regarded hereinafter as constant along the beam length).
Disregarding shear strains, γ(x)=0, implies that the section rotation is approximated as:
ψ≈−w′(x)what implies that:
EIw′′≈−M(x)EIw′′′′≈q(x)where w(x) is the beam transversal displacement, also called elastic line. The solution of this last differential equation is straighforward once the load q(x) and the boundary conditions (two for each beam extremity) are specified.
We shall now include the inertial forces in these equations, as well as regard now the section mean shear strain,
γ(x)=ψ(x)+w′(x)=Q(x)GAsas relevant, where GAs is the shear stiffness (also regarded hereinafter as constant along the beam length). Although γ(x) is indeed negligible for actual slender beams, the following analysis may also be applied to other slender structures, like tall buildings, trusses, etc., for which we may define equivalent stiffnesses, (EI)eq and (GAs)eq. The dynamic equilibrium equations now become:
Q′=−q+μ¨wM′=Q−iμ¨ψwhere μ is the beam mass per unit length and iμ is the cross section rotational inertia per unit length. Derivating the equation for γ and replacing the solution EIψ′=M(x) gives the elastic line equation accounting for shear strains:
w′′=−MEI+Q′GAsNow we replace the shear (with inertial loads):
w′′=−MEI+−q+μ¨wGAsand derivate the whole equation replacing for M′:
w′′′=iμ¨ψ−QEI+μ¨w′−q′GAsThe angular acceleration, ¨ψ, may be safely disregarded, for the rotations are usually very small. Derivating the equation a last time and replacing for Q′ finally gives:
EIw′′′′=q−μ¨w+EIGAs(μ¨w′′−q′′)which is the dynamic elastic line equation for a constant section beam under forced vibration due to dynamic load q(x,t), with shear deformation accounted for (although plane section hypothesis still kept along). The last term may be disregarded whenever the shear stiffness is much larger that the bending stiffness.
In this section, we take the vibrating beam equation derived above, disregard the shear deformation and look for free vibration solution, which implies that q(x,t)=0. The beam equation becomes simply:
EIw′′′′=−μ¨wTo solve this equation we separate the time and space independent variables through the hypothesis:
w(x,t)=w0sin(ωt+θ)φ(x)which is pretty much alike we have previously done for multiple degrees of freedom systems. The free vibration equilibrium equation then become:
φ′′′′−p4φ=0where we have defined:
p4=(μEI)ω2It can be shown that, in the general case, the space dependent function φ(x) has the form:
φ(x)=C1(cospx+coshpx)+C2(cospx−coshpx)+C3(sinpx+sinhpx)+C4(sinpx−sinhpx)The corresponding space derivatives will be required to apply the boundary conditions:
φ′(x)=p1[C1(−sinpx+sinhpx)+C2(−sinpx−sinhpx)+C3(cospx+coshpx)+C4(cospx−coshpx)]φ′′(x)=p2[C1(−cospx+coshpx)+C2(−cospx−coshpx)+C3(−sinpx+sinhpx)+C4(−sinpx−sinhpx)]φ′′′(x)=p3[C1(sinpx+sinhpx)+C2(sinpx−sinhpx)+C3(−cospx+coshpx)+C4(−cospx−coshpx)]φ′′′′(x)=p4[C1(cospx+coshpx)+C2(cospx−coshpx)+C3(sinpx+sinhpx)+C4(sinpx−sinhpx)]The last equation above proves that the assumed general solution is correct.
Now, to have a particular solution for the vibrating beam the kinematic boundary conditions must be applied. Let us assume a cantilever beam, fixed at the left end (x=0) and free at the right end (x=L).
The corresponding boundary conditions are:
φ(0)=0φ′(0)=0φ′′(L)=0φ′′′(L)=0The two last conditions implies that bending moment and shear force are zero at the right end, respectively. Applying these conditions at the corresponding derivatives:
φ(0)=C1(1+1)+C2(1−1)+C3(0+0)+C4(0−0)=0φ′(0)=p[C1(−0+0)+C2(−0−0)+C3(1+1)+C4(1−1)]=0which implies that C1=0 and C3=0. The other two conditions become:
φ′′(L)=p2[C2(−cospL−coshpL)+C4(−sinpL−sinhpL)]=0φ′′′(L)=p3[C2(sinpL−sinhpL)+C4(−cospL−coshpL)]=0These two equations can be put into matrix form as:
[(−cospL−coshpL)(−sinpL−sinhpL)(sinpL−sinhpL)(−cospL−coshpL)][C2C4]=[00]In order to obtain a non trivial (non zero) solution for the unknown coefficients C2 and C4, the determinant of the coefficients matrix must be zero. This condition yields a nonlinear equation to be solved for pL. We can use the HP Prime for this purpose, as shown in the figure below.
![]() |
![]() |
There will be infinite solutions αk=(pL)k, k=1,2,…,∞, each one associated to a vibration frequency and a modal shape, [ωk,φk(x)]. The natural vibration frequencies are obtained by recalling the definition of p, what finally gives:
ωk=(αkL)2√EIμFor instance, the fundamental vibration frequency, fn, is given by:
fn≈12π(1.8751L)2√EIμwhich is a very useful formula for estimating the fundamental frequency of slender piles and towers with constant cross section.
x = np.linspace(0, 10, 1000)
The table below was taken from a Sonderausdruck (special edition) of the german Betonkalender (concrete almanac), 1988. It summarizes the solutions for some other support conditions of slender beams. If more accuracy is desiredfor the αk constants, one can solve the so-called characteristic equation with the help of a calculator like the HP Prime, ou HP 50G.
The characteristic equations are the determinants of respective coefficients matrix,
which can also be solved with the fsolve()
method from scipy
, as shown below.
def char_eq(x):
x = x[0]
A = np.array([[-np.cos(x)-np.cosh(x), -np.sin(x)-np.sinh(x)],
[ np.sin(x)-np.sinh(x), -np.cos(x)-np.cosh(x)]])
return np.linalg.det(A) # from coefficientes matrix
# return np.cos(x)*np.cosh(x) + 1 # from characteristic equation
#-----------------------------------------------------------------------
from scipy.optimize import fsolve
ak = fsolve(char_eq, 1)
print('Cantilever beam frequency parameter: {0}'.format(ak[0]))
Cantilever beam frequency parameter: 1.8751040687119394
Observe that the result is exactly the same (within the required precision) as previously obtained with the
HP Prime. One can use directly the characteristic equation, or one can program the determinant calculation
using np.linalg.det()
in the user function char_eq
above.
The solutions for the beam vibration frequencies presented above may also be calculated by means of Rayleigh quotient, as long as an educated guess for the φ(x) function is assumed. As an example, let us take a simply supporte beam, for which we assume:
φ(x)=4x(L−xL2)with φ(L/2)=1, which obviously is not the correct modal shape.
We also assume that the beam is subjected to a constant distributed load, q corresponding to its self weight. The maximum displacement at the beam center is known to be:
wmax=5qL4384EIIn the following we shall estimate both the fundamental vibration frequency and the maximum displacement with the assumed modal shape. The reference kinetic energy is given by:
Tref=12∫L0μφ2(x)dxwhile for the elastic potential energy we need the curvature function, φ′′(x):
V=12∫L0EI[φ′′(x)]2dx=12∫L0qw(x)dxOn the other hand, the modal properties are evaluated with a continuous version of the same formula presented on Class 11. In particular, the modal mass and the modal load are:
→ϕ⊺kM→ϕk⟹Mk=∫L0μφ2(x)dx→ϕ⊺k→F⟹Fk=∫L0qφ(x)dxThe static modal response can be calculated as:
uk=Fk/Kkwhere Kk=ω2kMk.
Let us apply this approach to the beam example above. For the assume modal shape we have the curvature:
φ′′(x)=−8L2Hence:
Tref=12∫L0μ[4x(L−x)L2]2dx=415μLV=12∫L0EI[−8L2]2dx=32L3EIThe Rayleigh quotient results:
ω2k=VTref=32EIL3154μL=120L4(EIμ)which gives a fundamental frequency comparing to the exact solution as:
ωk≈(3.31L)2√EIμ≈(πL)2√EIμwith an error of approximatelly 11%. The modal shape approximation may also be used to estimate the displacement at beam center, for which we calculate the modal mass and the modal load as:
Mk=∫L0μ[4x(L−x)L2]2dx=815μLFk=∫L0q[4x(L−x)L2]dx=23qLThe modal stiffness is then:
Kk=120L4(EIμ)⋅815μL=64EIL3and the modal displacement is:
uk=23qL⋅L364EI=4qL4384EI≈5qL4384EIThe modal displacement is already the displacement at the beam center, for φ(L/2)=1. The implied error is hence 20%, not bad for an arbitrary elastic line shape. The following scripts show how to numerically accomplish these calculations.
L = 1 # bar length (m)
EI = 2.6 # bending stiffness (Nm2)
mu = 0.260 # mass per unity length (kg/m)
q = mu*9.81 # distributed load is self weight (N/m)
# Proposed modal shape for first mode (second order polynomial)
x = np.linspace(0, L, 200)
qk = 4*x*(L - x)/L/L # guessed modal shape
q0 = np.sin(np.pi*x/L) # exact modal shape!!!
plt.figure(1, figsize=(10,4))
plt.plot(x, qk, 'b', x, q0, 'r')
plt.legend(('Trial', 'Exact'))
plt.xlim( 0.0, L ); plt.xlabel('x');
plt.ylim(-0.5, 1.5); plt.ylabel('phi(x)');
plt.title('Proposed modal shape')
plt.grid(True)
The same calculation could be carried out with the correct modal frequency, with much more accurate results:
wk = ((np.pi/L)**2)*np.sqrt(EI/mu) # exact fundamental frequency
fk = wk/(2*np.pi)
Mk = np.sum(mu*qk*qk) # modal mass from guessed modal shape
Kk = wk*wk*Mk # improved modal stiffness
print('Available fundamental vibration frequency: {0:5.2f} Hz'.format(fk))
print('Modal mass (integrated over bar length): {0:5.1f} kg'.format(Mk))
print('Modal stiffness (from mass and frequency): {0:5.0f} N/m'.format(Kk))
Available fundamental vibration frequency: 4.97 Hz Modal mass (integrated over bar length): 27.6 kg Modal stiffness (from mass and frequency): 26880 N/m
Fk = np.sum(q*qk) # modal force
uk = Fk/Kk # modal displacement
wp = np.max(uk*qk) # approximated elastic line
w0 = (5*q*L**4)/(384*EI) # exact elastic line
print('Maximum displacement approximation: {0:6.2f}mm'.format(1000*wp))
print('Theoretical maximum displacement: {0:6.2f}mm'.format(1000*w0))
Maximum displacement approximation: 12.59mm Theoretical maximum displacement: 12.77mm
w = uk*qk
V = np.sum( q*w )/2 # potential energy calculated with external work
Tref = np.sum(mu*w*w)/2
wk = np.sqrt(V/Tref)
fk = wk/(2*np.pi)
print('Fundamental frequency from Rayleigh quotient: {0:5.2f} Hz'.format(fk))
Fundamental frequency from Rayleigh quotient: 4.97 Hz