
80 3 Velocity and Acceleration Analysis
The numerical values of the vector rBn are printed with:
fprintf(’rB = [ %g, %g, %g ] (m) \n’, rBn)
The linear velocity vector of B
1
= B
2
is
v
B
= v
B
1
= v
B
2
= ˙x
B
ı + ˙y
B
j
,
where
˙x
B
=
dx
B
dt
= −AB
˙
φ sinφ and ˙y
B
=
dy
B
dt
= AB
˙
φ cosφ ,
are the components of the velocity vector of B
1
= B
2
. To calculate symbolically the
components of the velocity vector using the MATLAB the command diff(f,t)
is used, which gives the derivative of f with respect to t. The symbolical expression
of the velocity vector of B
1
= B
2
is obtain with the statement
% vB=vB1=vB2 in terms of phi(t) and diff(phi(t),t)
vB = diff(rB,t);
The components, vB(1) and vB(2), of the vector vB are symbolic expressions in
terms of phi(t) and diff(phi(t),t):
-3/20
*
sin(phi(t))
*
diff(phi(t),t)
3/20
*
cos(phi(t))
*
diff(phi(t),t)
The numerical values for the components of the velocity of B
1
= B
2
are
˙x
B
= −0.15 (5π/3)sin30
◦
= −0.392699 m/s,
˙y
B
= 0.15 (5π/3)cos30
◦
= 0.680175 m/s.
To obtain the numerical values in MATLAB first diff(’phi(t)’,t) is replaced
with omega and then phi(t) is replaced with pi/6
% replaces diff(’phi(t)’,t) with omega in vB
vBnn = subs(vB,diff(’phi(t)’,t),omega);
% replaces phi(t) with pi/6 in vBnn
vBn = subs(vBnn,’phi(t)’,pi/6);
Instead of replacing diff(’phi(t)’,t) with omega and then replacing
’phi(t)’ with pi/6, a list with the symbolical variables ’phi(t)’,
diff(’phi(t)’,t), and diff(’phi(t)’,t,2) is created:
slist={diff(’phi(t)’,t,2),diff(’phi(t)’,t),’phi(t)’};