You are on page 1of 19

Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
Lab Session 02
Exercise:
Question 1:
Obtain the state space representation for the system shown below. Solve the resulting state equations
using MATLAB ode45 function (write complete script). Plot the position x(t) and velocity v(t) of the
system with respect to time for t = 0 to 50 sec considering the following cases and write in your words
about what you observed by looking at different plots. (Attach plot under each case).
[Use separate A4 sheets for plots and attach it with this document]

Behavior upon changing Mass (M)


Case 1 Case 2 Case 3 Case 4
M = 10 M = 30 M = 50 M = 100
B = 30 B = 30 B = 30 B = 30
K = 15 K = 15 K = 15 K = 15
Fa = 300 Fa = 300 Fa = 300 Fa = 300

Behavior upon changing Friction Coefficient (B)


Case 1 Case 2 Case 3 Case 4
M = 10 M = 10 M = 10 M = 10
B=5 B = 10 B = 20 B = 30
K = 15 K = 15 K = 15 K = 15
Fa = 300 Fa = 300 Fa = 300 Fa = 300
Behavior upon changing Stiffness (K)
Case 1 Case 2 Case 3 Case 4
M = 10 M = 10 M = 10 M = 10
B=5 B=5 B=5 B=5
K = 0.5 K=5 K = 20 K = 30
Fa = 300 Fa = 300 Fa = 300 Fa = 300

Behavior upon changing Applied Force (Fa


Case 1 Case 2 Case 3 Case 4
M = 10 M = 10 M = 10 M = 10
B=5 B=5 B=5 B=5
K = 15 K = 15 K = 15 K = 15
Fa = 50 Fa = 100 Fa = 200 Fa = 300
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL

Write your answers below this line

According to the laws of


physics

Fa(t)=Ma + Ff (v) + Fs(x)

Fa(t)=M(dx2/dt2) + B(dx(t)/dt) + Kx(t)

Assigning state variables:

As there are two energy storing elements and the highest order of differential equation is two so
we have two state variables.

X1 = x(t)
X2 = v(t)
Differential Equations are as follows:

dX 1
= X2
dt
dX 2 B K F a(t )
=- X2 - X1 +
dt M M M
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
'Behavior upon changing Mass (M)CASE 1’
1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 30, K = 15, Fa = 300
M=10;B=30;K=15;Fa=300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing Mass
(M)CASE 1');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Mass (M)CASE
1');
3. Output plot

4. COMMENT ON PLOT
The system starts from rest i.e.; v=0 with x=0.The maximum velocity v=7.83(m/sec) is
attained by system at t=0.7675(units) and displacement approaches slowly to its final value.
The velocity decreases and becomes v=0 at t=13.73sec bringing system to rest again now with
constant displacement x=20.
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
'Behavior upon changing Mass (M)CASE 2’
1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 30, B = 30, K = 15, Fa = 300
M=30;B=30;K=15;Fa=300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing Mass
(M)CASE 2');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Mass (M)CASE
2');
3. Output plot

4. COMMENT ON PLOT
The system starts from rest i.e.; v=0 with x=0.The maximum velocity v=6.443(m/sec) is
attained by system at t=1.515(secs) and maximum displacement is x=20.87m at t=6.347 sec.
The velocity decreases and becomes negative v=-0.2788 at t=7.778, displacement also
decreases a bit x=19.96m at t=12.34 sec and then system comes to rest v=0 at t=16.38 sec with
x=20m.
Comparing it with Case1, we see that in this case maximum value of velocity is reduced in
magnitude, peak time increases and becomes zero after a little oscillation. Displacement
reaches its final value 20m after an oscillation.
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL

'Behavior upon changing Mass (M)CASE 3’


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 50, B = 30, K = 15, Fa = 300
M=50;B=30;K=15;Fa=300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing Mass
(M)CASE 3');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Mass (M)CASE
3');
3. Output plot

4. COMMENT ON PLOT
The system starts from v=0 and x=0.Velocity reaches it maximum value of 5.714(m/sec) at
t=2.054 second after few oscillations it comes to rest v=0 at t=29.23 sec. The displacement
attains maximum value of 22.55m at t=6.733 sec and comes to constant value after few
oscillations x=20 at t=29.23 sec.
Comparing it with previous cases we see that by increasing M, oscillations increases before
system comes to rest. The peak time for both displacement and velocity increases. The
maximum magnitude of displacement increases whereas for velocity it decreases.
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL

'Behavior upon changing Mass (M)CASE 4’


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 100, B = 30, K = 15, Fa = 300
M=100;B=30;K=15;Fa=300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing Mass
(M)CASE 4');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Mass (M)CASE
4');
3. Output plot

4. COMMENT ON PLOT
System starts from rest. The peak time for velocity is 3.487 sec and maximum value of
velocity is 4.718 and after some oscillations comes back to zero bringing system to rest. The
peak for displacement is 8.606sec and maximum value of displacement is 25.33m and after
some oscillations it comes to constant value of 20m at t=40.05sec after some oscillations.
Comparing it with previous cases we see that the peak time for both velocity and displacement
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
increases. The number of oscillations is also increased. The maximum value of velocity is
decreased where as for displacement it is increased. The value of displacement (at v=0) when
system comes to rest is independent of change of M.

'Behavior upon changing Friction Coefficient (B) CASE 1'


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 5, K = 15, Fa = 300
M=10;B=5;K=15;Fa=300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing Friction
Coefficient (B)CASE 1');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Friction
Coefficient (B) CASE 1');
3. Output plot

4. COMMENT ON PLOT
The system starts from rest. The velocity reaches its maximum value of 18.35 (m/sec) at
t=1.213sec and becomes zero at t=33.339sec after oscillations. The displacement reaches its
maximum value of 30.36m at t=2.567 sec and attains constant value of 20 at t=32.29 sec after
oscillations.
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
'Behavior upon changing Friction Coefficient (B) CASE 2'
1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 10, K = 15, Fa = 300
M=10;B=10;K=15;Fa=300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);

subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing Friction
Coefficient (B)CASE 2');

subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Friction
Coefficient (B) CASE 2');
3. Output plot

4. COMMENT ON PLOT
System starts from rest. Velocity attains its maximum value of 14.65 at t=0.9806sec and
comes to 0 after very few oscillations. Displacement attains its maximum value of 24.88(m) at
t=2.895sec and comes to constant value of 20 after very little oscillations when system comes
to rest again.
Comparing it with previous case by increasing B we observe that maximum value of
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
displacement and velocity is decreased. The number of oscillations also decreased. The peak
time of velocity graph is decreased where as for displacement is increased.

'Behavior upon changing Friction Coefficient (B) CASE 3'


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 20, K = 15, Fa = 300
M=10;B=20;K=15;Fa=300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing Friction
Coefficient (B)CASE 3');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Friction
Coefficient (B) CASE 3');
3. Output plot

4. COMMENT ON PLOT
System starts from rest. Velocity attains its maximum value of 10.24 at t=0.8241sec and
comes to 0 after an oscillation. Displacement attains its maximum value of 20.2.(m) at
t=4.571sec and comes to constant value of 20 after an oscillation when system comes to rest
again.
Comparing it with previous cases by increasing B we observe that maximum value of
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
displacement and velocity is decreased. The number of oscillations also decreased. The peak
time of velocity graph is decreased whereas for displacement is increased. The value of
displacement (at v=0) when system comes to rest is independent of change of K.

'Behavior upon changing Friction Coefficient (B) CASE 4'


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 30, K = 15, Fa = 300
M=10;B=30;K=15;Fa=300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing Friction
Coefficient (B)CASE 4');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Friction
Coefficient (B) CASE 4');
3. Output plot

4. COMMENT ON PLOT
System starts from rest. Velocity attains its maximum value of 7.83 at t=0.7675sec and comes
to 0 at t=13.73sec. Displacement attains its maximum value of 20(m) slowly at t=4.571sec and
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
becomes constant with value of 20 when system comes to rest again.
Comparing it with previous cases by increasing B we observe that maximum value of
displacement and velocity is decreased. Number of oscillations also decreased. The peak time
of velocity graph is decreased whereas for displacement is increased.

'Behavior upon changing Stiffness (K) CASE 1'


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 5, K = 0.5, Fa = 300
M=10;B=5;K=0.5;Fa=300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing
Stiffness (K)CASE 1');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Stiffness
(K)CASE 1');
3. Output plot

4. COMMENT ON PLOT
System starts from rest. Velocity attain its maximum value of 45.7 at t=4.512sec and comes to
0 at t=50.Displacement attains its maximum value of 600 slowly at 50 sec.
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL

'Behavior upon changing Stiffness (K) CASE 2'


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 5, K = 5, Fa = 300
M=10;B=5;K=5;Fa=300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);

subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing
Stiffness (K)CASE 2');

subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Stiffness
(K)CASE 2');
3. Output plot

4. COMMENT ON PLOT
System starts from rest. Velocity attain its maximum value of 26.85 at t=1.872 sec and comes
to 0 at t=35.33 sec. Displacement attains its maximum value of 78.27 at 4.679 sec and attains
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
constant value of x=60m at t=35.33sec.
By comparing it with case 1, we observe that with increase in K maximum amplitude of
displacement and velocity decreases, their peak time decreases and there are some oscillations
as well. The constant value of displacement at v=0 (when system is at rest) also decreases.

'Behavior upon changing Stiffness (K) CASE 3'


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 5, K = 20, Fa = 300
M=10;B=5;K=20;Fa=300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing
Stiffness (K)CASE 3');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Stiffness
(K)CASE 3');
3. Output plot

4. COMMENT ON PLOT
System starts from rest. Velocity attain its maximum value of 16.52 at t=0.9907 sec and comes
to 0 at t=31.96 sec. Displacement attains its maximum value of 23.5 at 2.321 sec and attains
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
constant value of x=15m at t=31.96sec.
By comparing it with above cases, we observe that with increase in K maximum amplitude of
displacement and velocity decreases, their peak time decreases and there are more oscillations
as well. The constant value of displacement at v=0 (when system is at rest) also decreases.

'Behavior upon changing Stiffness (K) CASE 4'


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 5, K = 30, Fa = 300
M=10;B=5;K=30;Fa=300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing
Stiffness (K)CASE 4');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Stiffness
(K)CASE 4');
3. Output plot

4. COMMENT ON PLOT
System starts from rest. Velocity attain its maximum value of 14.02 at t=0.7835 sec and comes
to 0 at t=37.06 sec. Displacement attains its maximum value of 16.29 at 1.892 sec and attains
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
constant value of x=10m at t=37.4sec.
By comparing it with previous cases, we observe that with increase in K maximum amplitude
of displacement and velocity decreases, their peak time decreases and there are overshoots as
well. The constant value of displacement at v=0 (when system is at rest) also decreases.

'Behavior upon changing Applied Force (Fa) CASE 1'


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 5, K = 15, Fa = 50
M=10;B=5;K=15;Fa=50;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing Applied
Force (Fa)CASE 1');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Applied
Force (Fa)CASE 1');
3. Output plot

4. COMMENT ON PLOT
System starts from rest. Velocity attain its maximum value of 3.071 at t=1.131sec and comes
to 0 at t=29.41. Displacement attains its maximum value of 5.063 at 2.652 sec and attains
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
constant value of x=3.335m at t=29.41sec.

'Behavior upon changing Applied Force (Fa) CASE 2'


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 5, K = 15, Fa = 100
M=10;B=5;K=15;Fa= 100;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing Applied
Force (Fa)CASE 2');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Applied
Force (Fa)CASE 2');
3. Output plot

4. COMMENT ON PLOT
System starts from rest. Velocity attain its maximum value of 6.132 at t=1.185 sec and comes
to 0 at t=24.23 sec. Displacement attains its maximum value of 23.5 at 2.321 sec and attains
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
constant value of x=6.68m at t=24.23sec.
By comparing it with 1 case, we observe that with increase in F maximum amplitude of
displacement and velocity increases proportionally, their peak time remains same and there are
oscillations as well. The constant value of displacement at v=0 (when system is at rest)
increases proportionally to F.

'Behavior upon changing Applied Force (Fa) CASE 3'


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 5, K = 15, Fa = 200
M=10;B=5;K=15;Fa= 200;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing Applied
Force (Fa)CASE 3');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Applied
Force (Fa)CASE 3');
3. Output plot

4. COMMENT ON PLOT
System starts from rest. Velocity attain its maximum value of 12.24 at t=1.069 sec and comes
to 0 at t=23.84 sec. Displacement attains its maximum value of 20.25 at 2.602 sec and attains
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
constant value of x=13.37m at t=23.84sec.
By comparing it with 1 case, we observe that with increase in F maximum amplitude of
displacement and velocity increases proportionally, their peak time remains same and there are
oscillations as well. The constant value of displacement at v=0 (when system is at rest)
increases proportionally to F.

'Behavior upon changing Applied Force (Fa) CASE 4'


1. Creating a MATLAB-function mass_damper_spring.m
function dxdt= mass_damper_spring(t,x)
% CASE-1 : M = 10, B = 5, K = 15, Fa = 300
M=10;B=5;K=15;Fa= 300;
dxdt = zeros(2,1);
dxdt(1)=x(2);
dxdt(2)=(Fa/M)-(B/M)*x(2)-(K/M)*x(1);
%function handling completed
2. Program of mass spring system calling function mass_damper_spring
[t,x]=ode45(('mass_damper_spring'),[0 50],[0;0]);
subplot(2,1,1);
plot(t,x(:,1));grid;
xlabel('time');ylabel('displacement');title('Behavior upon changing Applied
Force (Fa)CASE 4');
subplot(2,1,2);
plot(t,x(:,2));grid;
xlabel('time');ylabel('velocity');title('Behavior upon changing Applied
Force (Fa)CASE 4');
3. Output plot

4. COMMENT ON PLOT
System starts from rest. Velocity attain its maximum value of 18.35 at t=1.213 sec and comes
to 0 at t=28.89 sec. Displacement attains its maximum value of 30.36 at 2.567 sec and attains
Lab Sessions 02 Feedback / Machine Control System (EE-373 /374)

NED University of Engineering & Tech. Electrical Engineering Department


Spring Semester 2020 TE-ME / TE-EE / TE-EL
constant value of x=20.01m at t=28.89sec.
By comparing it with above cases, we observe that with increase in F maximum amplitude of
displacement and velocity increases proportionally, their peak time remains same and there are
oscillations as well. The constant value of displacement at v=0 (when system is at rest)
increases proportionally to F.

You might also like