Download as pdf or txt
Download as pdf or txt
You are on page 1of 53

Q1: Consider the two polynomials p(s)=s2+2s+1 and q(s)=s+1.

Using MATLAB compute


a. p(s)*q(s)
b. Roots of p(s) and q(s)
c. p(-1) and q(6)
MATLAB Code:

Result:
Q2: Use MATLAB command to find the partial fraction of the following

a)

b)

a) .
MATLAB Code:

Result:
b) .
MATLAB Code:

Result:
Q3: MATLAB M-file Script
Use MATLAB to generate the first 100 terms in the sequence a(n)define recursively by
a(n+1) = p*a(n)*(1-a(n))
with p=2.9 and a(1) = 0.5.

MATLAB Code;

Result:
Q4: Consider the following equation

a) Write a MATLAB M-file function to obtain numerical values of y(t). Your function must take
y(0), ζ, ωn, t and θ as function inputs and y(t) as output argument.
b) Obtain the plot for y(t) for 0<t<10 with an increment of 0.1, by considering the following two
cases
Case 1: y(0) =0.15 m, ωn= √2rad/sec, ζ= 3/(2√2ሻand θ= 0;
Case 2: y(0) =0.15 m, ωn= √2rad/sec, ζ= 1/(2√2ሻand θ= 0;

a) .

MATLAB M-file:

Result:

b) .
MATLAB Code (Case-I):

Result:
MATLAB Code (Case-II):

Result:
Q1: (CLO-1, PLO-5, C-3)
Consider the mechanical system depicted in the figure. The input is given by f(t), and the output is given
by y(t). Determine the transfer function from y(t) to f(t) and using MATLAB, write a m-file and plot the
system response to a unit step input. Let m=10, k=1 and b=0.5. Show that the peak amplitude of the
output is about 1.8.
MATLAB Code:

Result:
Q2: (CLO-1, PLO-5, C-3)
Consider the differential equation

and u(t) is a unit step. Determine the solution analytically and verify by co-plotting the analytical
solution and the step response obtained with ‘step’ function.

MATLAB Code:
Result:
Q1: (CLO-1, PLO-5, C-3)
Consider the transfer function

Using MATLAB plot the pole zero map of the above system.

MATLAB Code:
Result:

Q2: (CLO-1, PLO-5, C-3)


Obtain the impulse response for the following system

and u(t) is a unit step. Determine the solution analytically and verify by co-plotting the analytical
solution and the step response obtained with ‘step’ function.

MATLAB Code:
Result:
Q3: (CLO-1, PLO-5, C-3)
A system has a transfer function

Plot the response of the system when R(s) is a unit impulse and unit step for the parameter z=3, 6 and
12.

MATLAB Code (Impulse Response):


Result:

MATLAB Code (Step Response);


Result:
Q1: (CLO-1, PLO-5, C-3)
For the following multi-loop feedback system, get closed loop transfer function and the corresponding
pole-zero map of the system.
MATLAB Code:

Result:
Q2: (CLO-1, PLO-5, C-3)
Consider the feedback system depicted in the figure below
(a). Compute the closed-loop transfer function using the ‘series’ and ‘feedback’ functions
(b). Obtain the closed-loop system unit step response with the ‘step’ function and verify that final value
of the output is 2/5.

MATLAB Code:
Result:
Q1: (CLO-1, PLO-5, C-3)
a) Unit Step Response of the First Order):
a. MATLAB Code:

Result:
b. MATLAB Code:

Result:
b) :
b. The time constant and the 63% percent of the final value are same.

c) :
c. The steady state value in both the cases are 1.
Q1: (CLO-1, PLO-5, C-3)
Question # 01:
Effect of damping ratio ζon performance measures. For a single-loop second order feedback system
given below

Find the step response of the system for values of ωn = 1 and ζ= 0.1, 0.4, 0.7, 1.0 and 2.0. Plot all the
results in the same figure window and fill the following table.
MATLAB Code:
Result:
Q1: (CLO-1, PLO-5, C-3)
Check the stability of following systems by using Routh Hurwitz criteria?
1
a)
s^8 + 2 s^7 + 8 s^6 + 12 s^5 + 20 s^4 + 16 s^3 + 16 s^2

Routh- Hurwitz Criterion


Before discussing the Routh-Hurwitz Criterion, firstly we will study the stable, unstable and marginally
stable system.
1. Stable System: If all the roots of the characteristic equation lie on the right half of the 'S' plane then
the system is said to be a stable system.
2. Marginally Stable System: If all the roots of the system lie on the imaginary axis of the 'S' plane
then the system is said to be marginally stable.
3. Unstable System: If all the roots of the system lie on the left half of the 'S' plane then the system is
said to be an unstable system.
Statement of Routh-Hurwitz Criterion
Routh Hurwitz criterion states that any system can be stable if and only if all the roots of the first
column have the same sign and if it does not have the same sign or there is a sign change then the
number of sign changes in the first column is equal to the number of roots of the characteristic equation
in the right half of the s-plane i.e., equals to the number of roots with positive real parts.

a) MATLAB Code:

Result:

The roots of the polynomial 𝑠8 + 2𝑠7 + 8𝑠6 + 12𝑠5 + 20𝑠5 + 20𝑠4 + 16𝑠3 + 16𝑠2 are:
𝑠1 = 0
𝑠2 = 0
𝑠3 = 1.41421𝑖
𝑠4 = −1.41421𝑖
𝑠5 = −1 + 𝑖
𝑠6 = −1 − 𝑖
𝑠7 = 2𝑖
𝑠8 = −2𝑖
So, according to Routh Hurwitz criterion the system is not stable.

b) G = 1

s^6 + 4 s^5 + 3 s^4 + 2 s^3 + s^2 + 4 s + 4

b) MATLAB Code:
Result:

The roots of the polynomial 𝑠6 + 4𝑠5 + 3𝑠4 + 2𝑠3 + 𝑠2 + 4𝑠 + 4 are:


𝑠1 = −0.8858
𝑠2 = −3.26436
𝑠3 = 0.67968 + 0.74881𝑖
𝑠4 = 0.67968 − 0.74881𝑖
𝑠5 = −0.6046 + 0.99354𝑖
𝑠6 = −0.6046 − 0.99354𝑖
So, according to Routh Hurwitz criterion the system is not stable.

c) G = 4s+4

s^3 + 5 s^2 - 2 s + 4
c) MATLAB Code:

Result:

The roots of the polynomial 𝑠3 + 5𝑠2 − 2𝑠 + 4 are:


𝑠1 = −5.49629
𝑠2 = 0.24815 + 0.8162𝑖
𝑠3 = 0.24815 − 0.8162𝑖
So, according to Routh Hurwitz criterion the system is not stable.

d) G = 1

s^5 + 5 s^4 + 11 s^3 + 23 s^2 + 28 s + 12

d) MATLAB Code:
Result:

The roots of the polynomial 𝑠5 + 5𝑠4 + 11𝑠3 + 23𝑠2 + 28𝑠 + 12 are:


𝑠1 = −1
𝑠2 = −1
𝑠3 = −3
𝑠4 = 2𝑖
𝑠5 = −2𝑖
So, according to Routh Hurwitz criterion the system is not stable.
Q1: (CLO-1, PLO-5, C-3)
Consider a process given below to be controlled by a PID controller,

a) Obtain the unit step response of Gp(s).


b) Try PI controllers with (Kp=2, 10, 100), and Ki=Kp/10. Investigate the unit step response in each
case, compare the results and comment.
a) Unit Step Response of Gp(s) :
MATLAB Code:

Result:
b) Solution:
MATLAB Code (Kp=2):

Result:
MATLAB Code (Kp=10):

Result:
MATLAB Code (Kp=100):

Result:
Comparison;
By analyzing all of the above responses, we can deduce that the proportional controller (Kp) can
increase the rise time and decrease the steady state error, but never completely remove it. While an
integral controller (Ki) will eliminate the steady state error, it can exacerbate the transient answer. Effect
of each controller Kp & Ki on the closed-loop system are summarized below:

CL Response Rise Time Overshoot Settling Time S-S Error


Kp Increase Increase Small Change Decrease
Ki Decrease Increase Increases Eliminate

Q2: (CLO-1, PLO-5, C-3)


Consider the given system:
Gp= 1/s2+10s+20
a) Obtain the unit step response of Gp(s).
b) Try each controller separately or in condition to obtain the best response by giving unit step input.
Analyze the system response in each case.

a) Unit Step Response of Gp(s):

Step Response of Gp:

Step Response 0.05 0.045 0.04 F 0.035 0.03 F


Amplitude 0.025 0.02 0.015 0.01 0.005 0 0 0.5 N 2.5 3 1.5 Time (seconds)
Result:

b) Gp with Various PID Controller:


MATLAB Code (Gp with various PI controller):

Step Response 1.2 1 0.8


Amplitude 0.6 0.4 0.2 0 0 0.2 0.4 1 1.2 1.4 0.6 0.8 Time (seconds)
Result:

It can be observed that using PI Controller Ts Settling time and Tp Peak Time are reduced.

MATLAB Code (Gp with Various PD Controller):

Step Response 1.2 1 0.8


Amplitude 0.6 0.4 0.2 0 0 0.05 0.1 0.2 0.25 0.3 0.15 Time (seconds)
Results:

It can be observed that Tr Rise time is reduced to quite a low value in comparison to PI controller or
without any controller.

MATLAB Code (Gp with Various PID Controller):


Result:

Step Response 1.2 1 0.8


Amplitude 0.6 0.4 0.2 0 0 0.2 0.4 0.6 1.4 1.6 1.8 2 0.8 1 1.2 Time (seconds)

It can be observed that with PID controller all the parameters of the step response are giving the best
results. therefore, it is better to use combination of PI & PD controller for the best results.

MATLAB Code (Gp with Various PI, PD & PID Controller);


Result:

Step Response 1.2 1 Gр PI PD PID 0.8


Amplitude 0.6 0.4 0.2 0 0.5 1 N 2.5 3 1.5 Time (seconds)
Q1: (CLO-1, PLO-5, C-3)
Consider system and obtain the unit step response and also analyze the response by implementing the
PID controller by Ziegler-Nichols method?
G(s) = 64/ [ s3 + 14s2 + 56s + 64]

MATLAB Code:
Result:
Step Response:

Tuned:

Lab Task 10 ME-313L


Q2: (CLO-1, PLO-5, C-3)
Consider system and obtain the unit step response and also analyze the response by implementing the PID
controller by Ziegler-Nichols method?
G(s) = 1/ (s + 1)3

MATLAB Code:

Lab Task 10 ME-313L


Result:
Step Response:

Tuned:

Lab Task 10 ME-313L


Lab Task 10 ME-313L

You might also like