0% found this document useful (0 votes)
2 views10 pages

LCS Lab 2

The document is a lab report for a Linear Control System course submitted by Muhammad Abu Bakar. It includes MATLAB code for solving electrical circuit equations, calculating transfer functions, and plotting step responses for different systems. The report also outlines tasks involving the analysis of control systems using MATLAB.
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)
2 views10 pages

LCS Lab 2

The document is a lab report for a Linear Control System course submitted by Muhammad Abu Bakar. It includes MATLAB code for solving electrical circuit equations, calculating transfer functions, and plotting step responses for different systems. The report also outlines tasks involving the analysis of control systems using MATLAB.
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

College of Electrical & Mechanical Engineering,

NUST
Department of Electrical Engineering

Linear Control System


Lab Report 2

6TH SEMESTER

Submitted by:
Muhammad Abu Bakar (466655)

Submitted to:
LE Nosheen
[Link] Qayyum

Submission Date:
 Feb 4, 2026.
MatLab Code:
clc;

syms s I1 I2

V=1;

R1=1;

R2=2;

L1=1;

C1=2;

Z_L=s*L1;

Z_C=1/(s*C1);

eq1 =V==I1*R1+(I1 - I2)*Z_L;

eq2 =0 ==(I2- I1)*Z_L +I2*R2+ I2*Z_C;


sol = solve([eq1,eq2],[I1,I2]);

G1 = simplify(sol.I1 / V);

G2 = simplify(sol.I2 / V);

Vc_Vs = simplify((sol.I2 * Z_C) / V);

fprintf('transferFunction G1' )

pretty(G1)

fprintf('transfer Function G2')

pretty(G2)

fprintf('Transfer Function:')

pretty(Vc_Vs)

figure;

fplot(eq1, [0 10]);

grid on;

title('Step Response of G1 = I1(s)/V(s)');

xlabel('Time (s)');

ylabel('I1(t)');

figure;

fplot(eq2, [0 10]);

grid on;

title('Step Response of G2 = I2(s)/V(s)');

xlabel('Time (s)');
ylabel('I2(t)');

figure;

fplot(eq3, [0 10]);

grid on;

title('Step Response of Vc(s)/V(s)');

xlabel('Time (s)');

ylabel('Vc(t)');

Output:
MatLab Code:
syms s i1 i2 i3 v

R1=1;

R2=4;

R3=1;

L1=2;

L2=3;

C1=1;

eq1=0==i1/s+(i1-i2)+(i1-i3);

eq2=v==(i2-i1)+(i2-i3)+2*(i2-i3)*s;

eq3=0==4*(i3-i1)+3*s*i3+(i3-i2)*2*s+(i3-i2)*1;

sol = solve([eq1, eq2, eq3], [i1, i2, i3]);

G1 = simplify(sol.i1 /v);

G2 = simplify(sol.i2 /v);

G3=simplify(sol.i3/v);

fprintf('transferFunction G1' )

pretty(G1)

fprintf('transfer Function G2')

pretty(G2)

fprintf('Transfer Function:')

pretty(G3)
[n1,d1] = numden (G1);

system1 = tf(sym2poly(n1),sym2poly(d1));

step (system1)

figure;

[n2,d2] = numden (G2);

system2 = tf(sym2poly(n2),sym2poly(d2));

step (system2)

figure;

[n,d] = numden (g);

system = tf (sym2poly(n),sym2poly(d));

step (system)

Output:
Task 3:

MatTab Code:
clc;
syms s;

for D=0.5:10:50

num=1;

den=[4,D,7];

G=tf(num,den);

figure;

step(G);

end

Output:

You might also like