You are on page 1of 12

Course 2- SM- Master IVPA – Conf. Dr.

Olivia Florea

Kinematics of particle

1.1 Rectilinear motion


A freighter is moving at a speed of 8 knots when its engines are suddenly
stopped. We assume that the boat is found to move 1.1 nautical miles
after 10 minutes. The deceleration is proportional to the square of its
speed, so that a = −kv 2 . Determine the constant k.

dv dv
a = −kv 2 ⇔ = −kv 2 ⇔ 2 = −kdt ⇔
dt v

−1
Z
dv 1
= −kdt ⇔ = −kt + C ⇔ = kt + C
v2 v v
1
For t = 0 we have v(0) = v0 ⇔ v0 =C

1 1 v0
= kt + ⇒v=
v v0 ktv0 + 1

But,
dx dx v0 v0
v= ⇔ = ⇔ dx = dt
dt dt ktv0 + 1 ktv0 + 1

Zx Zt
v0 1
dx = dt ⇒ x = ln(ktv0 + 1) ⇔ xk − ln(ktv0 + 1) = 0
ktv0 + 1 k
0 0

To determine the constant k we have to cross the graphic of the function


f (k) = dx = ktvv00+1 dt with the line f (k) = 0. The M-file is:
v0=8;
x=1.1;
t=10/60;
k=0:0.01:0.5;
f=x*k-log(1+k*t*v0);
y = 0;
plot(k,f,k,y)
xlabel(’k’)
ylabel(’f’)

Name the M-file kinematics.m. At the command prompt call the file
kinematics. We can observe that the value of constant k is 0.35.

1.2 Rectangular Coordinates

A long-range rifle is fired at A with the projectile hitting the mountain


at B. If the muzzle velocity is u = 400 m/s, determine the two angles of
elevation θ which will permit the projectile to hit the mountain target B
and plot the two trajectories.
The velocity in A is:

ux = u cos θ
uy = u sin θ

The equations of motion are:

ẍ = 0 ⇒ ẋ = C1 ⇒ x = C1 t + C2

mẍ = 0
⇒ 2
mÿ = −mg ÿ = −g ⇒ ẏ = −gt + C3 ⇒ y = − gt2 + C3 t + C4

Using the initial conditions:



x(0) = 0 ⇒ C2 = 0
ẋ(0) = ux = u cos θ ⇒ C1 = u cos θ ⇒ x(t) = ut cos θ

y(0) = 0 ⇒ C4 = 0

2
ẏ(0) = uy = u sin θ ⇒ C3 = u sin θ ⇒ y(t) = − gt2 + ut sin θ
But, we know: x = 5000m, y = 1500m, u = 400m/s:

5000 = 400t cos θ


1500 = − 9.81 2
2 t + 400t sin θ

Solving these two equations in Matlab using the Maple symbolic computation:
>> eqn1=’5000=400*cos(x)*y’

eqn1 =
5000=400*cos(x)*y

>> eqn2=’1500=400*sin(x)*y-1/2*9.81*y^2’

eqn2 =
1500=400*sin(x)*y-1/2*9.81*y^2

>> [x,y] = solve(eqn1,eqn2)


x =

1.4065576854329889257535399604352
0.45569543583977478547338635263748
-2.685897217750018452989257030642
-1.7350349681568043127091034228443

y =

76.452007728583426926316546391465
13.920516408172829238156414017816
-13.920516408172829238156414017816
-76.452007728583426926316546391465

We obtained four solutions. We are interested only in the positive values


of the angles:
for θ1 = 1.406557rads we have t1 = 76.45s
for θ2 = 0.455695rads we have t2 = 13.92s.
Write in Matlab the next M-file named projectile.m

t1=0:0.01:13.92;
t2=0:0.01:76.45;
x1=400*cos(0.455695)*t1;
y1=400*sin(0.455695)*t1-1/2*9.81*t1.^2;
x2=400*cos(1.4066)*t2;
y2=400*sin(1.4066)*t2-1/2*9.81*t2.^2;
plot(x1/1000,y1/1000,x2/1000,y2/1000)
xlabel(’x[km]’)
ylabel(’y[km]’)
title(’projectile trajectory’)
1.3 Frenet Coordinates
A baseball player releases a ball with initial conditions shown in the figure.
Plot the radius of curvature of the path just after release and at the apex
as a function of the release angle θ.

g = 9.81m/s2 = 32.18f t/s


After release,
ṡ2 v2 v02
an = = 0 ⇒ρ=
ρ ρ g cos θ
At the apex, vy = 0 and v = vx = v0 cos θ
v2 (v 2 cos θ)2
an = g = ⇒ρ= 0
ρ g
Write the M-file named baseball.m
v0=100;
g=32.18;
theta=0:0.01:pi/2;
rho_r=v0^2/g./cos(theta);
rho_a=(v0*cos(theta)).^2/g;
plot(theta*180/pi,rho_r,theta*180/pi,rho_a)
xlabel(’theta’)
title(’radius of curvature [ft]’)
axis([0 90 0 800])
We need to limit the vertical axis since the initial rho approches infinity
as theta approaches 90o .

1.4 Spring Mass Damper System Unforced


Response

The differential equation of motion is:


c k
mẍ + cẋ + kx = 0| : m ⇒ ẍ + x + x = 0
m m
q
k k c
where: ωn2 = m ⇒ ωn = m , m = 2ξωn which is equivalent with the
differential equation:
ẍ + 2ξωn ẋ + ωn2 x = 0
We want to solve the system for 5 cycles knowing: ξ = 0.1, m = 1kg,
k = 100N/m, x(0) = 0.02m, ẋ(0) = 0. We have to write the differential
equation of second degree as a system of differential equation of first
degree:
ẋ = v ⇒ ẍ = v̇ = −2ξωn v − ωn2 x
We note by:
y(1) = x
y(2) = v
therefore, the system becomes:

ẏ(1) = y(2)

ẏ(2) = −2ξωn y(2) − ωn2 y(1)


The damped frequency is:
p
ωd = ωn 1 − ξ2

and the principal period is



T =
ωd
The 5 cycles are for 5T :
√ p 2 · 3.14
ωn = 100 = 10 ⇒ ωd = 10 1 − (0.1)2 = 9.95 ⇒ T = = 0.63 ⇒ 5T = 3.16
9.95
We have to write two M-files: in the first one we will define the function
and in the second one we will compute the function using the ode45
Runge Kutta numerical method for first order differentiation
function yp = unforced1(t,y)
yp = [y(2);(-(2*y(2))-(100*y(1)))];

t=[0 4];
y0=[0.02;0];
[t,y]=ode45(’unforced1’,t,y0);
plot(t,y(:,1),’r’,t,y(:,2),’g’);
legend(’displacement’,’velocity’)
grid on
xlabel(’time’)
ylabel(’x[m],v[m/s]’)
title(’Displacement and Velocity Vs Time’)
hold on;
We want to represent the plot for different values of ξ = [0, 0.1, 0.25, 0.5, 0.75, 1].
The M-file is:

tspan=[0 4];
y0=[0.02;0];
xi=[0,0.1,0.25,0.5,0.75,1];
color=[’r’,’b’,’g’,’m’,’y’,’k’];
for i=1:6
unforced2 = @(t,y)[y(2);(-(2*xi(i)*10*y(2))-(100*y(1)))];
[t,y]=ode45(unforced2,tspan,y0);
plot(t,y(:,1),color(i))
grid on
xlabel(’time’)
ylabel(’Displacement’)
title(’Displacement Vs Time’)
hold on;
end
legend(’xi=0’,’xi=0.1’,’xi=0.25’,’xi=0.5’,’xi=0.75’,’xi=1’);
Course 2- SM- Master IVPA – Conf. Dr. Olivia Florea

Dynamics pf Rigid bodies

2.1 Simple Pendulum


Compute and plot the linear response of a simple pendulum having a mass
of 10 grams and a length of 5 cms. The initial conditions are θ(0) = 90o
and θ̇(0) = 0 Also compare the generated plot with the nonlinear plot.
Solution
The differential equation of motion for the simple pendulum without any
damping is given by
g
θ̈ = − sin θ
l
If we consider the system to be linear, i.e., for small angles,
g
θ̈ = − θ
l
The above equation is a second order, constant-coefficient differential
equation. In order to use MATLAB to solve it, we have to reduce it to
two first order differential equations as MATLAB uses a Runge-Kutta
method to solve differential equations, which is applicable only for first
order differential equations. Let

θ = y(1)

θ̇ = y(2)
When the values of theta and the first derivative of theta are substituted
in the second order linearized differential equation, we get the following
two first order differential equation:

ẏ(1) = y(2)
g
ẏ(2) = − y(1)
l
For a nonlinear system, sin θ 6= θ The second order non-linear differential
equation reduces to the following, two first order differential equation:

ẏ(1) = y(2)
g
ẏ(2) = − sin y(1)
l
MATLAB Code The MATLAB code is written following the procedure
adopted to solve the spring-massdamper system. For the linear case the
function file is saved as linear.m.
function yp = linear(t,y)
yp = [y(2);((-g/l) *(y(1)))];
In this example, the value of l is chosen to be 5 cms. So the value of g/l
turns out to be 196.2 per square second. Note that since the mass and
the length are expressed in grams and centimeters respectively, the value
of the acceleration due to gravity g is taken to be 981 cms per square
second. Substitute this value in the above MATLAB code.
For the nonlinear case, open a new M-file to write a separate function
file for the nonlinear differential equation. In this case the function file is
saved as nonlinear.m.
function yp = nonlinear(t,y)
yp = [y(2);((-g/l) *sin(y(1)))];
The main code should be written in a separate M-file, which will actually
call the above function files, solve the derivatives stored in them and plot
the required result.
tspan = [0 5];
y0 = [1.57;0];
[t,y] = ode45(’linear’,tspan,y0)
plot(t,y(:,1))
grid on;
xlabel(Time)
ylabel(Theta)
title(Theta Vs Time)
hold on;
tspan represents the time interval and y0 represents the initial condition.
Note that the value of in the initial conditions must be expressed in
radians. Now run the code for the linearized version of the simple pendulum.
A plot of theta versus time will be obtained. The hold command in
the code freezes the plot obtained. This command is used so that the
nonlinear version can also be plotted in the same graph. After running
the program for the linear version, change the name of the function in the
third line of the main code from linear to nonlinear. By doing this, the
Ode45 command will now solve the nonlinear differential equations and
plot the result in the same graph. To differentiate between the linear and
the non-linear curve, use a different line style. The plots of the responses
are attached. From the plots we can see that the time period for the
non linear equation is greater than that of the linear equation. To plot
the angular velocity with respect to time change the variable in the plot
command line in the main code from y(:,1) to y(:,2). This is done because
initially we assigned y(1) to theta and y(2) to the first derivative of theta.

− − −

You might also like