In [13]:
from IPython.display import display, Latex, HTML
def plvu(label, value, units=""):
print("%40s: %10g %s"%(label, value, units))
def css_styling():
styles = open("00_custom.css", "r").read()
return HTML(styles)
css_styling()
Out[13]:
To solve this problem we we'll use fractions
and dummy functions to formally compute incremental displacements, velocities and accelerations.
In [14]:
from fractions import Fraction as frac
def d(v): return v
def delta(v): return v
def dot(v): return v
def ddot(v): return v
We use symbolic names to denote unit values of the various physical quantities involved, as well as the unit displacement corresponding to the free coordinate.
In [15]:
k = 1; m = 1; p = 1; L = 1
uc = 1
In [16]:
m1 = m*L ; j1 = frac(m1*L**2, 12)
m2 = m1 ; j2 = j1
m3 = m1 ; j3 = j1
Analyzing the instantaneous motion of the system, one can recognize that
On these premises we can write the generalized displacement (and the virtual displacements and the accelerations) of the various points of interest.
The displacements in A
In [17]:
ua = uc ; va = 0
The displacements in D
In [18]:
theta_cde = frac(-uc,L)
# coordinates with respect to CDE's centre of instantaneous rotation
xd = -L ; yd = 0
ud = -theta_cde*yd
vd = +theta_cde*xd
The displacements of the centres of mass of the three sub bars (all the rotations are the same)
In [19]:
x1 = frac(-L,2) ; y1 = 0
x2 = 0 ; y2 = frac(+L,2)
x3 = frac(+L,2) ; y3 = 0
u1 = -theta_cde*y1 ; v1 = +theta_cde*x1
u2 = -theta_cde*y2 ; v2 = +theta_cde*x2
u3 = -theta_cde*y3 ; v3 = +theta_cde*x3
theta1 = theta_cde ; theta2 = theta_cde ; theta3 = theta_cde
In [20]:
fsa = -k*ua
fsd = -k*vd
the inertial forces (only the ones different from zero)
In [21]:
fi1 = -m1*ddot(v1)
fi2 = -m2*ddot(u2)
fi3 = -m3*ddot(v3)
and the inertial couples
In [22]:
wi1 = -j1*ddot(theta1)
wi2 = -j2*ddot(theta2)
wi3 = -j3*ddot(theta3)
To have equilibrium it is necessary and sufficient that the virtual work of all the forces for the virtual rigid displacement is equal to zero (note that the work of reactive forces, for fixed constraints, is identically zero).
First the virtual work of inertial forces, then the work of spring forces and eventually the work of the autonomous forces:
In [23]:
vwif = fi1*delta(v1) + fi2*delta(u2) + fi3*delta(v3) + wi1*delta(theta1)
vwif+= wi2*delta(theta2) + wi3*delta(theta3)
vwsf = fsa*delta(ua) + fsd*delta(vd)
vwaf = p*delta(uc)
Simplifying the variation of $u_C$, expliciting the dependencies on fundamental units we eventually have the final result.
In [24]:
print (" %s*m*ddot(u_c) %s*k*u_c +%s*p = 0"%(vwif,vwsf,vwaf))