Universidade Federal do Rio Grande do Sul (UFRGS)
Programa de Pós-Graduação em Engenharia Civil (PPGEC)
1. The Lagrange's equation
2. Example: generic s.d.o.f. system
3. Example: generic m.d.o.f. system
4. Example: simply supported beam
4.1. Discrete flexibility and distributed mass
4.2. Discrete mass and distributed flexibility
4.3. Distributed mass and distributed flexibility
5. Example: nonlinear simple pendulum
6. Example: tower with flexible foundation
7. Example: nonlinear double pendulum
8. Assignments
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
from scipy.integrate import odeint
Now we shall use the Lagrange's equation for solving a simply supported beam, considering three different models:
The three beam models are useful for illustrating the use of Lagrange's equation with different energy evaluation approaches. At the end, the three solutions may be compared for evaluating the best estimates of discrete parameters kθ and M such that the three models give the same beam natural vibration frequency.
For the sake of compatibility with the other two models, we define the generalized coordinate u as being the vertical displacement at beam center. The potential elastic energy depends on the relative rotation, θ, between the two segments:
θ=arcsin(2uL)≈2uLwhere the small displacements assumption (sinβ≈β) has been used. Hence:
V=12kθθ2≈2kθL2u2The kinetic energy is obtained by integrating the velocities along the two bars:
T=2⋅12∫L/20(˙r2x+˙r2y)μdξwith:
rx=ξcos(2uL)ry=ξsin(2uL)Observe that, without the small displacements assumption, the dummy variable ξ is a line differential, not the projection in x direction. Corresponding time derivatives are:
˙rx=drxdududt=−2ξLsin(2uL)˙u≈−4u˙uL2ξ≈0˙ry=drydududt=2ξLcos(2uL)˙u≈2˙uLξwhere the small displacements assumption is made (sinβ≈β and cosβ≈1) and the velocity in direction x is neglected. Replacing these results in the kinetic energy yields:
T≈4˙u2L2∫L/20ξ2μdξ=μL6˙u2Now the two terms of Lagrange's equation can be calculated. Firstly the kinectic energy:
∂T∂˙u=μL3˙uand then for the potential elastic energy:
∂V∂u=4kθL2uApplying Lagrange's equation gives finally the equilibrium equation:
μL3¨u+4kθL2u=0which means that the natural vibration frequency is:
ωn=√12kθμL3In this case we must assume a deflected shape. A good option is the elastic line resulting from a point load at beam center:
w(ξ)=PL312EI(34ξ−ξ3),ξ≤12where the variable ξ is a non-dimensional coordinate, ξ=x/L. This function is valid up to beam center and its symmetry must be accounted for. The assumed shape must be rescaled, such that the displacement at beam center is our generalized coordinate, u. The maximumum central deflection from the function above is:
wmax=PL348EIRe-scaling gives:
w(ξ)=4u(34ξ−ξ3),ξ≤12The rotation and the curvature functions are, respectively:
w′(ξ)=4Lu(34−3ξ2)w′′(ξ)=−24L2uξwhere one must be aware that:
ddx=ddξdξdx=1LddξThe potential elastic energy is then given by:
V=2⋅12∫1/20EI[w′′(ξ)]2Ldξ=24EIL3u2On the other hand, the kinetic energy evaluation is straighforward:
T=12M˙u2Now we calculate the two terms of Lagrange's equation, starting with the kinectic energy:
∂T∂˙u=M˙uand then for the potential elastic energy:
∂V∂u=48EIL3uApplying Lagrange's equation gives finally the equilibrium equation:
M¨u+48EIL3u=0which means that the natural vibration frequency is:
ωn=√48EIML3Here we assume a half-sine as the deflected shape (that we know to be the right solution):
w(ξ)=usin(πξ)The rotation and the curvature functions are, respectively:
w′(ξ)=πuLcos(πξ)w′′(ξ)=−π2uL2sin(πξ)The velocity is assumed (small displacements) to have only the vertical component, which is then calculated as:
˙w(ξ)=dwdududt=˙usin(πξ)The potential elastic energy is then given by:
V=12∫10EI[w′′(ξ)]2Ldξ=π4EI4L3u2A comparison with the previous model leads to π4/4≈24, such that the potential energy for both models are quite close (error is ≈1.5%) even by using different functions for the deflected shape. Comparison with the discrete flexibility model demands that:
2kθL2=π4EI4L3and consequently the hinge flexibility to match the continuous beam flexibility must be:
kθ=π4EI8LOn the other hand, the kinetic energy is given by:
T=12∫10μ[˙w(ξ)]2Ldξ=μL4˙u2A comparison with the discrete mass model demands that:
M2=μL4and consequently the discrete mass must be M=μL/2, which is half the total beam mass.
Finally, taking derivatives and applying Lagrange's equation gives the equilibrium equation:
μL2¨u+π4EI2L3u=0and the natural vibration frequency results as :
ωn=(πL)2√EIμwhich is the exact solution for the first natural frequency of a simply supported beam.
def double_pendulum(y, t, m1, h1, m2, h2, g):
th1, w1, th2, w2 = y
mt = m1 + m2
dth = th1 - th2
cd = np.cos(dth)
sd = np.sin(dth)
s1 = np.sin(th1)
s2 = np.sin(th2)
A = np.array([[mt*h1, m2*h2*cd],
[m2*h1*cd, m2*h2 ]])
B = np.array([-m2*h2*w2*w2*sd - g*mt*s1,
m2*h1*w1*w1*sd - g*m2*s2])
a = np.linalg.solve(A, B)
return [w1, a[0], w2, a[1]]
Call scipy
for differential equation solution:
t = np.linspace(0, 4, 16384)
m1 = 1.0; h1 = 1.0
m2 = 1.5; h2 = 0.5
g = 9.81
Y0 = [np.pi+0.001, 0., np.pi/2, 0.]
plt.figure(1, figsize=(12, 5.5), clear=True)
for k in range(2):
Y = odeint(double_pendulum, Y0, t, args=(m1, h1, m2, h2, g))
x1 = h1*np.sin(Y[:,0])
y1 = -h1*np.cos(Y[:,0])
x2 = x1 + h2*np.sin(Y[:,1])
y2 = y1 - h2*np.cos(Y[:,1])
plt.subplot(1,2,k+1)
plt.plot(x1,y1, 'r:')
plt.plot(x2,y2, 'b', linewidth=0.5)
plt.xlim(-2, 2); plt.xlabel('X2 (m)')
plt.ylim(-2, 2); plt.ylabel('Y2 (m)')
plt.title('Simulation {0}'.format(k+1))
plt.grid(True)
Y0 = [np.pi+0.002, 0, np.pi/2, 0.] # repeat with butterfly wing flap