0% found this document useful (0 votes)
4 views

CEP

Complex problem

Uploaded by

Hammad Ud Din
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

CEP

Complex problem

Uploaded by

Hammad Ud Din
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 21

Q1 :

System (a)
The general transfer function is:
C(s) = b / s(s 2 + as + b)
C(s) = b / s(s 2 + as + b)
= A / s +( Bs + C / s 2 + as + b )
b = A(s 2 + as + b) + (Bs + C)s
Equate coefficients:
s 2 : A + B = 0 =⇒ B = −A
S : Aa + C = 0 =⇒ C = −Aa
Constant: Ab = b =⇒ A = 1
A = 1, B = −1, C = −a
C(s) = 1 / s − (s + a / s 2 + as + b )
Complete the square in the denominator:
s 2 + as + b = ( s + a / 2 )2 + ( b − a 2 / 4 )
Assuming (b − a 2 / 4 > 0) (underdamped case), we rewrite:
C(s) = 1 / s − s + a / (( s + a / 2 )2 + ( b − a 2 / 4 ))
Split the second term:
s + a / (( s + a / 2 )2 + ω2 )
= ( s + a / 2 )/ (( s + a / 2 )2 + ω2 ) + (a − a / 2) / (( s + a / 2 )2 + ω2 )
= ( s + a / 2 )/ (( s + a / 2 )2 + ω2 ) + ( a / 2) / (( s + a / 2 )2 + ω2 )
c(t) = 1 − e − (a /2) t cos(ωt) − a/ 2ω e − (a/2) t sin(ωt), ω = √ b − a 2 / 4
System (b):
C(s) = 9 / s(s 2 + 9 s+9)
Rewrite the denominator:
s 2 + 9s + 9 = (s + √ 9 − √ 6)(s + √ 9 + √ 6)
= (s + 1.468)(s + 7.532)
C(s) = 9 / s(s + 1.468)(s + 7.532)
= A / s + (B / s + 1.468) + (C / s + 7.532)
9 = A(s + 1.468)(s + 7.532) + Bs(s + 7.532) + Cs(s + 1.468)
Evaluate at roots:
At s = 0: 9 = A(1.468)(7.532) =
A = 9 / 1468 × 7.532 = 0.814
At s = −1.468: 9 = B(−1.468 + 7.532) =
B = 9/ 6.064 = 1.484
At s = −7.532: 9 = C(−7.532 + 1.468) =
C = 9 / -6.604 = -1.484
C(s) = 0.814 / s +( 1.484 / (s + 1.468) )− (1.484 / (s + 7.532 ))
c(t) = 0.814 + 1.484 e −1.468t − 1.484 e −7.532t
System (c):

C(s) = 9 / s(s 2+2 s+9)


Denominator:
s 2 + 2s + 9 = (s + 1)2 + 8
Applying Partial fractions:
C(s) = 9 / s((s + 1)2 + 8)
= A / s + (Bs + C / (s + 1)2 + 8)
Solving:
9 = A((s + 1)2 + 8) + (Bs + C)s
Equate coefficients:
s 2: A + B = 0 =
⇒ B = −A
s: 2A + C = 0 =
⇒ C = −2A
Constant: A(1 + 8) = 9 =
⇒A=1
Thus: A = 1, B = −1, C = −2,
C(s) = 1 / s − (s + 2 / (s + 1)2 + 8)
s + 2 / (s + 1)2 + 8 = (s + 1 (s + 1)2 + 8) + (1 / (s + 1)2 + 8)
c(t) = 1 − e −t cos(2√ 2t) − (1 / 2 √ 2) e −t sin(2√ 2 t)
System (d):
C(s) = 9 / s(s 2 +9)
Denominator:
= s 2 + 9 = (s + 3i)(s − 3i)
Partial fractions:
C(s) = 9 / s(s 2 + 9)
= A / s + (Bs + C / s 2 + 9)

Solve:
9 = A(s 2 + 9) + (Bs + C)s
s2:A=1
s: B = 0
Constant: 9A = 9
A=1
Thus:
C(s) = 1 / s − (s / s 2 + 9)
c(t) = 1 − cos(3t)

System (e):
C(s) = 9 / s(s 2+6s+9)

s 2 + 6s + 9 = (s + 3)2
C(s) = 9 / s(s + 3)2
= A / s + B / s + 3 + C / (s + 3)2
Solve:
9 = A(s + 3)2 + Bs(s + 3) + Cs
s2:A+B=0=
B = −A
s: 6A + 3B + C = 0
Constant: 9A = 9 =
A=1
Thus: A = 1, B = −1, C = −3
C(s) = 1 / s − (1 /s + 3) − (3 / (s + 3)2 )
c(t) = 1 − e −3t − 3te−3t

System B
Matlab code for step response..
% Define time vector from 0 to 5 seconds
t = 0:0.01:5;

% Define transfer function variable


s = tf('s');

% Define the transfer function G(s)


G = 9 / (s^2 + 9*s + 9);

% Plot step response


figure;
step(G, t);
grid on;
xlabel('Time (s)');
ylabel('Amplitude');
title('Step Response of System (b): G(s) = 9 / (s^2 + 9s + 9)');
Poles and zeros :
% Define time vector from 0 to 5 seconds
t = 0:0.01:5;
% Define transfer function variable
s = tf('s');
% Define the transfer function G(s)
G = 9 / (s^2 + 9*s + 9);
% Plot step response
figure;
step(G, t);
grid on;
xlabel('Time (s)');
ylabel('Amplitude');
title('Step Response of System (b): G(s) = 9 / (s^2 + 9s + 9)');
System C :
Poles and zeros :
% Define transfer function variable
s = tf('s');

% Define the transfer function G(s)


G = 9 / (s^2 + 2*s + 9);

% Plot pole-zero map


figure;
pzmap(G);
grid on;
title('Pole-Zero Plot for System (c)');
Step response :

% Define time vector


t = 0:0.01:5;

% Define transfer function


s = tf('s');
G = 9 / (s^2 + 2*s + 9);

% Plot step response


figure;
step(G, t);
grid on;
xlabel('Time (s)');
ylabel('Amplitude');
title('Step Response of System (c): G(s) = 9 / (s^2 + 2s + 9)');
Also with equation :
syms s t
% Define the transfer function and input
G = 9 / (s^2 + 2*s + 9); % System transfer function
R = 1/s; % Unit step input in Laplace

% Output in Laplace
C_s = G * R;

% Inverse Laplace to get time-domain response


c_t = ilaplace(C_s, s, t);
pretty(c_t) % Display the expression in readable form

% Convert symbolic expression to numeric function


c_func = matlabFunction(c_t);

% Time vector
t_vals = 0:0.01:5;
c_vals = c_func(t_vals);

% Plotting
figure;
plot(t_vals, c_vals, 'LineWidth', 2);
grid on;
xlabel('Time (s)');
ylabel('c(t)');
title('Step Response of System (c) with Time-Domain Expression');
% Display equation as text on plot
eqn_str = ['c(t) = ', char(vpa(c_t, 3))];
text(0.5, 0.8, eqn_str, 'Units', 'normalized', 'FontSize', 10, 'BackgroundColor', 'white');

System D
Poles and zeros :
% Define transfer function variable
s = tf('s');

% Define the transfer function G(s)


G = 9 / (s^2 + 9);

% Plot pole-zero map


figure;
pzmap(G);
grid on;
title('Pole-Zero Plot for System (d): G(s) = 9 / (s^2 + 9)');

Response :
syms s t

% Define the transfer function and input


G = 9 / (s^2 + 9); % System transfer function (undamped)
R = 1/s; % Unit step input in Laplace
% Output in Laplace domain
C_s = G * R;

% Inverse Laplace to get time-domain response


c_t = ilaplace(C_s, s, t);
pretty(c_t) % Display the symbolic expression

% Convert to numeric function for plotting


c_func = matlabFunction(c_t);
t_vals = 0:0.01:5;
c_vals = c_func(t_vals);

% Plotting
figure;
plot(t_vals, c_vals, 'LineWidth', 2);
grid on;
xlabel('Time (s)');
ylabel('c(t)');
title('Step Response of System (d) with Time-Domain Expression');

% Add equation to the plot


eqn_str = ['c(t) = ', char(vpa(c_t, 3))];
text(0.5, 0.8, eqn_str, 'Units', 'normalized', 'FontSize', 10, 'BackgroundColor', 'white');
System E :
Poles and zeros :
% Define transfer function variable
s = tf('s');

% Define the transfer function G(s)


G = 9 / (s^2 + 6*s + 9); % System transfer function

% Plot pole-zero map


figure;
pzmap(G);
grid on;
title('Pole-Zero Plot for System: G(s) = 9 / (s^2 + 6s + 9)');

% Calculate poles and zeros


poles = pole(G); % Compute the poles of the transfer function
zeros = zero(G); % Compute the zeros of the transfer function

% Display poles and zeros


disp('Poles:');
disp(poles);
disp('Zeros:');
disp(zeros);

Response:
syms s t

% Define the transfer function and input


G = 9 / (s^2 + 6*s + 9); % System transfer function
R = 1 / s; % Unit step input in Laplace

% Output in Laplace domain


C_s = G * R;

% Inverse Laplace to get time-domain response


c_t = ilaplace(C_s, s, t);
pretty(c_t) % Display the symbolic expression

% Convert to numeric function for plotting


c_func = matlabFunction(c_t);
t_vals = 0:0.01:5; % Time vector from 0 to 5 seconds
c_vals = c_func(t_vals); % Evaluate the function at each time point

% Plotting the step response


figure;
plot(t_vals, c_vals, 'LineWidth', 2);
grid on;
xlabel('Time (s)');
ylabel('c(t)');
title('Step Response of System: G(s) = 9 / (s^2 + 6s + 9)');

% Add equation to the plot


eqn_str = ['c(t) = ', char(vpa(c_t, 3))];
text(0.5, 0.8, eqn_str, 'Units', 'normalized', 'FontSize', 10, 'BackgroundColor', 'white');
PART (4)
Identifying System Behavior
The behavior of each system is determined by the poles of the transfer function:
System (b)
Poles at s ≈ −1.468, −7.532 (real, distinct)
⇒ Over-damped (slow rise, no oscillations)
System (c)
Poles at s = −1 ± 2 √ 2i (complex conjugate)
⇒ Underdamped (decaying oscillations)
System (d)
Poles at s = ±3i (purely imaginary)
⇒ Undamped (sustained oscillations)
System (e)
Pole at s = −3 (repeated)
⇒ Critically damped (fast rise to steady state without oscillations)

Q2:

Part a:
% Given second-order transfer function parameters
wn = sqrt(361); % Natural frequency
zeta = 16 / (2 * wn); % Damping ratio

% Calculations
Ts = 4 / (zeta * wn); % Settling time (2% criterion)
Tp = pi / (wn * sqrt(1 - zeta^2)); % Peak time
PO = exp(-zeta * pi / sqrt(1 - zeta^2)) * 100; % Percent Overshoot
Tr = (1.76 * zeta^3 - 0.417 * zeta^2 + 1.039 * zeta + 1) / wn; % Rise time approx

% Display results
fprintf('Natural Frequency (wn): %.2f rad/s\n', wn);
fprintf('Damping Ratio (zeta): %.4f\n', zeta);
fprintf('Settling Time (2%%): %.4f seconds\n', Ts);
fprintf('Peak Time: %.4f seconds\n', Tp);
fprintf('Percent Overshoot: %.2f%%\n', PO);
fprintf('Rise Time: %.4f seconds\n', Tr);

Answer in the matlab :


>> untitled81
Natural Frequency (wn): 19.00 rad/s
Damping Ratio (zeta): 0.4211
Settling Time (2%): 0.5000 seconds
Peak Time: 0.1823 seconds
Percent Overshoot: 23.26%
Rise Time: 0.0787 seconds
>>

Part b :
% Symbolic solution for step response
syms s t

% Define the transfer function G(s) = 361 / (s^2 + 16s + 361)


G = 361 / (s^2 + 16*s + 361);

% Unit step input in Laplace domain


R = 1 / s;

% Output in Laplace domain


C_s = G * R;

% Inverse Laplace to get time-domain response


c_t = ilaplace(C_s, s, t);
pretty(c_t) % Show simplified expression in console

% Substitute to create numerical function


c_func = matlabFunction(c_t);
t_vals = 0:0.001:1; % Time from 0 to 1 second
c_vals = c_func(t_vals); % Evaluate function

% Plotting the time-domain step response


figure;
plot(t_vals, c_vals, 'LineWidth', 2);
grid on;
xlabel('Time (s)');
ylabel('c(t)');
title('Unit Step Response via Inverse Laplace: G(s) = 361 / (s^2 + 16s + 361)');

% Display the equation on the plot


eqn_str = ['c(t) = ', char(vpa(c_t, 3))];
text(0.5, 0.8, eqn_str, 'Units', 'normalized', 'FontSize', 10, 'BackgroundColor', 'white');

You might also like