Dynamics-Assigment 2
Dynamics-Assigment 2
Hamad Alshamlan
1
Problem 3
Basic instructions how to use Matlab is loaded in module content of this module. You will need
to Matlab notes. If you need Matlab help you can ask advice during the practical sessions.
1. Study multi rigid body modelling formulations. Again during practical session you will
have opportunity to ask questions but it is your responsibility to identify what help you
need.
2. Formulate a single mass spring system in 3 D. for your submission you need to clearly
explain what assumptions were made in formulation of the equations.
3. Assume that the mass is a prismatic parallelogram. You need to calculate the inertia
matrix. Actual dimensions of the prism is up to you. It is unlikely that any two of you will
have the same dimensions.
5. Convert your equations in state space from (convert to first order equations).
6. Apply a rectangular shock (again size of the shock is left to you to decide) at one corner.
No report is needed, submit your formulations, program listing and formulation results for
assessment.
2
Introduction
In this work we will introduced the formulation of a single mass spring system, modelled using
linear approximation theory, while the mass is assumed to be a prismatic parallelogram, inertia
matrix is to calculated using assumed prism dimensions. We shall obtain equations of motion in
matrix form, and convert the equations into first order state space from, furthermore, we will
apply a rectangular shock at one corner of the system, and finally results of displacement will be
plotted.
To setup equations of motion for a dynamical system the following are required:
1- Generalization of the equations of internal reactions and external forces. This is the core
of the multi-body formulation. The internal reactions due to damping and stiffness
elements have to be expressed in a unified and structured fashion for formulation of the
stiffness matrix. This requires formulation of the general description of movement of the
point where the ends of springs are attached.
2- Generalization of the equations of linear momentum. These are simply the equations
relating applied force of each body with its acceleration vector. The linear momentum
formulation results in formulation of the mass matrix.
3- Generalization of the equations of angular momentum. Since velocity squared terms are
ignored, the equations relate applied moment on each body with its angular acceleration.
3
Let us assume that spring stiffnesses are described in their principal axes system shown in Fig.
11. OXYZ is the global axes frame and the mounting is described in a local axes system
coinciding with the principal axes of the mounting.
Figure (1) below shows the forcing, damping and stiffness parameters affecting on the three
dimensional body under study.
⎡ P 0 0 ⎤ ⎧ x ⎫
{ f } = ⎢⎢ 0 Q 0 ⎥⎥ ⎪⎨ y ⎪⎬ (1)
⎢⎣ 0 0 R ⎥⎦ ⎪
⎩ z ⎭
⎪
Assuming that orthogonal transformation is existing between the two frames, we can write
X = Tx (2)
F = T K x = T K TT X (3)
Where the stiffness matrix of the spring is T K TT , considered to be computed in the global axes
system. The transformation matrix may be described in three Euler angle rotations. Since these
4
transformations are large, in describing the orientation of the mounting the order of the
orthogonal transformation applied to set up the T matrix is important.
Force acting on a rigid body at a point due to springs and dampers is a function of the
displacement and velocity of that point. A rigid body fixed to a set of moving axes Oxyz is
shown in Fig. (2). R and r are the position vectors of the centre of origin of the moving axes and
a point P on the moving body respectively. The vector rc is the position vector of P relative to the
moving axes. The moving axes and body rotation are given by the vector w, measured relative to
the global axes OXYZ.
In general, the rigid body motion dc of a point rC on the body due to large rotation is given by
d C = T (α , β , γ )rC (4)
where α , β and γ are the Euler angles. The above formulation, illustrated by Eq. (4) is efficient
for large deformations, but for small amplitude motions it can be inefficient, and so another
5
approach is considered. The new approach starts with defining the position vector of P relative to
the global axes
r = R + re (5)
∂R
r! = + ω × re (6)
∂t
Δr = ΔR + θ × re (7)
⎧ X = x + α × a x ⎫
⎪ ⎪
⎨Y = y + β × a y ⎬ (8)
⎪ ⎪
⎩Z = z + γ × a z ⎭
where (X,Y,Z) is the position of point P, while (x,y,z) is the centre of origin of the moving axes
relative to the global axes respectively. and (α , β , γ )
is the vector for finite rotation, denoted by
( )
w. Additionally, a x , a y , a z represents the position of P relative to the moving axes system.
To formulate the equations of motion of a multi-body system, interaction of at least two bodies
should be considered. Let us assume that these bodies are designated as i and j. pi and pj are two
points on these bodies as shown in Fig 4.
6
Fig. 3: Axes systems of bodies i and j
The definitions of variables appearing in Fig. (3) are the same as the definitions given for the
single body in Fig. (2), except that the suffixes refer to the body numbers.
If the mass matrix in Euler Newton formulation is obtained relative to the axis passing through
the centre of mass, then the subsection of the mass matrix corresponding to linear momentum is
a diagonal matrix containing the mass elements, this is,
hl = mi v (9)
Where h l is the linear momentum vector of body i, the centre of mass moving with a velocity
The usual transformation to the global matrix, H l = TmT T v , leaves the mass matrix m
unchanged. Therefore the force acting on body i may be expressed simply as,
7
∂H l
Force = H l = = ma (11)
∂t
In general, it is easier to express moment of momentum equations in an axes system aligned with
the principal axes system of the body. Therefore it is convenient to align the body axes system
with its principal axes. In this case, moment of momentum (or angular momentum) ha is given in
terms of the inertia matrix J and angular velocity w as,
⎡ J xx 0 0 ⎤
h a = ⎢⎢ 0 J yy 0 ⎥⎥ω = Jω
(12)
⎢⎣ 0 0 J zz ⎥⎦
This can be transformed to the global axes,
H a = T J T Tω (13)
The vector differentiation of H a gives the moment vector in the global axes,
! = ∂H a + ω × H
M=H (14)
a a
∂t
where the angular frequency multiplied term, ω × H a , is very small and thus can be neglected in
Assembly of Equations
To assemble the equations of motion, the internal forces acting on the individual bodies due to
their motion relative to each other are required. In Fig. (4), two bodies in motion are shown.
8
Fig. 4: Bodies i and j connected by spring kr
Motion of the origin of axes of system i is given by (xi,yi, zi), and angular rotation of axes are
given by ( α i , β i ,
γ i ) and similarly the motion of body j is described by (xj,yj, zj), and angular
For small motions, the displacement covered of each spring end point on every rigid body form
the system, which is described in the axis frame for every rigid body, these can be given by:
d i = (xi yi zi ) + (α i β iγ i ) × (ai bi ci )
(10 a-b)
d j = (x j y j z j ) + (α j β j γ j )× (a j b j c j )
d = d j − d i (12)
And the forces of reaction resulted from relative displacements on each rigid body, are
respectively given by
Fi = k r d
(13)
F j = −k r d
9
And the corresponding moments are
M i = ri Fi
(14)
M j = rj Fj
m i !x! i + k r d i − k r d j = Fi (15)
And
k r di = k r xi + Lk irαi (16)
While
x i = (xi yi zi )
(17)
α i = (α i β i zi )
!! i + ri × (k r d i − k r d j ) = M i
J iα
(19)
Or using a suitable matrix manipulation, the cross product in Eq. (19) is reduced, and we get a
new well-written equation
!! i + kk i,r d i − kk i,r d j = M i
J iα
(20)
10
⎡m i 0 ⎤ ⎧!x!i ⎫ ⎡ k r Lk i,r ⎤ ⎧x i ⎫ ⎡ k r Lk j,r ⎤ ⎧x j ⎫ ⎧ Fi ⎫
⎨ ⎬ + ⎢ ⎨ ⎬ − ⎨ ⎬ = ⎨ ⎬
(22)
⎢ 0
⎣ J i ⎥⎦ ⎩α
!! i ⎭ ⎣kk i,r Lkki,i,r ⎥⎦ ⎩α i ⎭ ⎢⎣kk i,r Lkki, j,r ⎥⎦ ⎩α j ⎭ ⎩M i ⎭
Using the stiffness matrix K, and applying two suitable operations, one should successfully find
all sub-matrices mentioned in the analysis, these two operations are
k ⇒ OP1 (i) ⇒ Lk i
(24)
k ⇒ OP2 (i) ⇒ kk i
Complete operation to obtain Kij which will be 6 × 6 matrix. The appropriate substitution of each
coefficient matrix yield to the multi-rigid-body formulation in 3-dimensional space. If damping
is considered, then we simply replace k by c, and the damping matrix in the overall formulation
will be matrix coefficient to the vector of velocity.
Adding the damping term, Eq. (22) and Eq. (23) respectively become
The following steps summarize the method of solution for this multi-rigid-body system:
11
1. The solution starts with knowing the absolute positions, finite rotation angles, and the
positions of P relative to the moving axes system, all of which correspond to points i and
j before applying the external forces and moments
Inputs: (xi , yi , zi ) (x , y , z )
j j j (α i , βi , γ i )
(α i , βi , γ i )
(ai , bi , ci )
(ai , bi , ci )
2. The stiffness and damping coefficient matrices should be given in order to build the
equation of motions for the entire system. They should be also given for both i and j and
each matrix is {3×3} in size.
Inputs: ki kj kr
3. In order to construct Eqs. (22 & 23) for the undamped case, or Eqs. (25-26) for the
damped case, we should refer to the conversion method described in Eq. (24).
4. To find the force F and moment M affecting the system we should use Eqs. (10-14),
where the correct and appropriate substitution yields to the right hand sides for the
equations of motion.
5. Plugging the results of steps 3 and 4 in the equations of motion will numerically illustrate
the final and ready to solve system of equations, where we have two coupled {6×6}
matrix formed ordinary differential equations.
6. Finally, solving the system gives the displacements and rotation angles after applying the
external forces and moments.
function [x,xd,x2d,amp,phi]=forced(m,c,k,f0,omega,ics,n);
omn=sqrt(k/m);
cc=c/(2.0*m*omn);
dst=f0/k;
r=omega/omn;
amp=dst/sqrt((1.0-r^2)^2+(2.0*cc*r)^2);
phi=atan(2.0*cc*r/(1.0-r^2));
dx=2.0*3.1416/(omega*n);
t=0.0;
if ics~=0
for i=1:n
12
t=t+dx;
x(i)=amp*cos(omega*t-phi);
xd(i)=-amp*omega*sin(omega*t-phi);
x2d(i)=-amp*omega^2*cos(omega*t-phi);
end
else
for i=1:n
t=t+dx;
x(i)=amp*sin(omega*t-phi);
xd(i)=amp*omega*cos(omega*t-phi);
x2d(i)=-amp*omega^2*sin(omega*t-phi);
end
end
clear all
m=10.0;
c=20.0;
k=50.0;
f0=250.0;
omega=40.0;
n=40;
ics=0;
nnn=1:40;
%end of problem-dependent data
[x,xd,x2d,amp,phi]=forced(m,c,k,f0,omega,ics,n);
fprintf(' i x(i) xd(i)
x2d(i)\n\n');
for i=1:nnn
fprintf(' %2.0f %10.8e %10.8e
%10.8e\n',i,x(i),xd(i),x2d(i));
end
plot(nnn,x(nnn));
plot(nnn,xd(nnn));
plot(nnn,x2d(nnn));
The result of this codes the dynamic response of single degree of freedom spring mass system,
this represents the forced damped case. However, the same code can be used to find the
responses of many other cases including undamped, free and forced systems, by choosing the
appropriate values of k and f0. Figure (5) shows the dynamic response of forced damped SDOF
spring-mass-rigid-body system.
13
Fig. 5: Dynamic response of forced damped SDOF rigid body spring mass system
14
K(i,j)=input('elements for matrix Ki');
end
end
Ki=reshape(K,m,n)
for a=1:m
for b=1:n
K1(a,b)=input('elements for matrix Kj');
end
end
Kj=reshape(K1,m,n);
for c=1:m
for d=1:n
K2(c,d)=input('elements for matrix Kr');
end
end
Kr=reshape(K2,m,n);
15
The result of this code is a 6×6 matrix that represents the stiffness matrix, using similar method
we can find all the sub-matrices and find the whole matrix that can be solved to find the
displacements and rotation angles after applying the external forces and moments.
16