0% found this document useful (0 votes)
20 views7 pages

Exp 1

The document is a report on simulations of DC electrical circuits using MATLAB. It includes: 1) Simulations of generating sine, triangular, and square waves to model an AC generator. 2) A simulation of a RLC circuit to analyze voltage, current, power, and power factor. The circuit diagram and MATLAB code are provided. 3) Calculations of impedance, phase angle, and power factor for a sample RLC circuit with R=100ohms, L=10H, and C=10uF. The power factor is found to be 0.0354.

Uploaded by

MD MASUD ALAM
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views7 pages

Exp 1

The document is a report on simulations of DC electrical circuits using MATLAB. It includes: 1) Simulations of generating sine, triangular, and square waves to model an AC generator. 2) A simulation of a RLC circuit to analyze voltage, current, power, and power factor. The circuit diagram and MATLAB code are provided. 3) Calculations of impedance, phase angle, and power factor for a sample RLC circuit with R=100ohms, L=10H, and C=10uF. The power factor is found to be 0.0354.

Uploaded by

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

“Heaven’s light is our guide”

Rajshahi University of Engineering & Technology


Electrical and Electronic Engineering
Course No: EEE 3200
Course Title: Electrical and Electronic Circuit Simulation
Sessional

Report: 01
Report name: DC Electrical Circuit Simulation using MATLAB

Submitted By: Submitted To:


Md Masud Alam Prof. Dr. Md. Zahurul Islam Sarkar
Roll: 1801074 Department of Electrical & Electronic
Section: B Engineering
Department: EEE Rajshahi University of Engineering &
Technology
Experiment no: 01
Experiment name: Study for analyzing the voltage, current, power and power factor for a RLC circuit and
simulation of AC generator as well as AC series circuits.

Problem no : 01 (Simulation of AC generator)


i) Sinusoidal wave:

Matlab code:

clc;
close all;
clear all;
t=0:.1:100;
x=2*pi*(50/1000);
a=200*square(t*x)
plot(a)
grid on;

Output:

Fig 01: Generating sine wave

ii) Triangular wave:

Matlab code:

clc;
close all;
clear all;
t=0:.1:100;
x=2*pi*(50/1000);
a=200*sawtooth(t*x,0.5)
plot(a)
grid on;
Output:

Fig 02: Generating triangular wave


Matlab code:
iii) square wave:
clc;
close all;
clear all;
t=0:.1:100;
x=2*pi*(50/1000);
a=200*square(t*x)
plot(a)
grid on;

Output:

Fig 03: Generating square wave


Problem no :02(Simulation of AC series circuit)

Circuit diagram :

R L

Vs C
V
s

Figure 04: Circuit diagram of a RLC circuit to simulate voltage, current, power and power factor

clc; clf; hold on


t = 0 : 0.0005 : 0.05;
f = 50; omega = 2*pi*f;
V = 220;
R = 680;
L = 820e-3;
C = 2.2e-6;
X_L = omega*L;
X_C = 1/(omega*C);
Z = R + 1i*(X_L - X_C);
absZ = abs(Z);
thetaZ = angle(Z);
I = V/Z;
subplot(3,1,1)
plot(t,abs(I)*sin(omega*t + angle(I)))
xlabel('Time, t (s)')
ylabel('Current, i (A)')
title('Waveshape of current through the circuit')
vR = V * R / Z;
vL = 1i * V * X_L / Z;
vC = -1i * V * X_C / Z;
subplot(3,1,2)
plot(t,abs(V )*sin(omega*t), t,abs(vR)*sin(omega*t + angle(vR)),t,abs(vL)*sin(omega*t + angle(vL)),
...t,abs(vC)*sin(omega*t + angle(vC)))
xlabel('Time, t (s)')
ylabel('Voltage, v (V)')
legend({'V', 'V_R', 'V_L', 'V_C'})
title('Waveshape of voltage across elements')
subplot(3,1,3)
plot(t,abs(V*I)*sin(omega*t+angle(I)).*sin(omega*t),t,abs(vR*I)*sin(omega*t+angle(I)).*sin(omega*t+angle(vR)
),t,abs(vL*I)*sin(omega*t+angle(I)).*sin(omega*t+angle(vL)),
t,abs(vC*I)*sin(omega*t+angle(I)).*sin(omega*t+angle(vC)))
xlabel('Time, t (s)')
ylabel('Power, p (W)')
legend({'P', 'P_R', 'P_L', 'P_C'})
title('Waveshape of consumed power in elements')
Here the impedance and the phase angle of the equations will be:

Z=R+i*XL-XC

|Z|=√𝑅 2 + (𝑥𝐿 − 𝑥𝑐 )2

(𝑥𝐿 −𝑥𝑐 )
-1
|𝜃|=tan ( 𝑅 )

p.f=cos(𝜃)

Let
R=100 ohm ; L=10H ; C=10uF

Matlab code:

clc;
clear all;
close all;
f = 50;
R = 100;
L = 10;
C = 10*10^(-6);
Vs=120;
xL = 2*pi*f*L;
xC =1/(2*pi*f*C);
z = R + i*(xL - xC);
theta = atan((xL-xC)/R);
pf = cos(theta)
I=Vs/z
t=0:.1:10;
Vr=I*R
Vl=I*xL
Vc=I*xC
Pr=Vr*I
Pl=Vl*I
Pc=Vc*
t = 1:1:5;
pf = [pf pf pf pf pf];
plot(t,pf,'LINEWIDTH',3)
xlabel('Time(t)','FONTSIZE',24)
ylabel('Power Factor(pf)','FONTSIZE',24)
grid on

outputs:

pf = 0.0354

I =0.0015 - 0.0425i

Vr = 0.1504 - 4.2450i

Vl = 4.7237e+00 - 1.3336e+02i

Vc = 0.4786 -13.5124i
Pr = -0.1800 - 0.0128i

Pl = -5.6542 - 0.4010i

Pc = -0.5729 - 0.0406i

Fig 05: power factor vs time graph

You might also like