Circuit Theory-Ii: Ms. Mariam Gul
Circuit Theory-Ii: Ms. Mariam Gul
10
Voltage(V) and Current (mA)
-5
-10
-15
-20
0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02
Seconds
TASK 2.2:
Plot instantaneous power for the voltage and current given in exercise 2.1 and 2.1 task and
compare it with the instantaneous power of example 2.2. Write a brief analysis on the three
plots using MATLAB.
MATLAB SCRIPT:
clear all; close all; clc;
t=0:0.5e-3:20e-3;
v1=20*cos(377*t);
a_rad1=(60*pi/180);
i1=5*cos(377*t-a_rad1);
p1=v1.*i1;
i2=20*cos(377*t);
a_rad2=(90*pi/180);
v2=5*cos(377*t-a_rad2);
p2=v2.*i2;
v3=20*cos(377*t);
i3=5*cos(377*t);
p3=v3.*i3;
plot(t,p1,'r',t,p2,'b',t,p3,'g');
xlabel('seconds');
ylabel('Power');
legend('Example 2.1','Task 2.1','Example 2.2');
grid;
hold;
GRAPHICAL OUTPUT:
100
Example 2.1
Task 2.1
Example 2.2
50
Power
-50
0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02
seconds
TASK2.3
Prove that the summation of voltage and current in three phase circuit is zero.
MATLAB SCRIPT
clear all; close all; clc;
t=0:1e-4:200e-4;
f=60;
x=2*pi*f*t;
v1=10*sin(x);
v2=10*sin(x-2*pi/3);
v3=10*sin(x+2*pi/3);
vt=v1+v2+v3;
plot(t,vt,t,v1,t,v2,t,v3);
legend('total');
hold;
i1=5*sin(x);
i2=5*sin(x-2*pi/3);
i3=5*sin(x+2*pi/3);
it=v1+v2+v3;
plot(t,it,t,i1,t,i2,t,i3);
legend('total');
hold;
fprintf('the sum of the voltages will be %f ',vt);
fprintf('the sum of the currents will be %f ',it);
GRAPHICAL OUTPUT
10
total
8
-2
-4
-6
-8
-10
0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 0.016 0.018 0.02
TASK2.5
For the circuit shown in Figure, find the current i 1(t) and the voltage VC (t) by MATLAB.
(Hint: I.= inv (Z.)*V)
MATLAB SCRIPT
OUTPUT:
Current i(t), magnitude: 0.387710
Angle in degrees: 15.019255
Voltage Vc(t), magnitude: 4.218263
Angle in degrees: -0.713171
TASK 2.6:
A Y-connected balanced three-phase generator with an impedance of 0.4+j0.3 per phase is
connected Y connected balanced load with an impedance of 24 + j19 per phase. The line
joining the generator and the load has an impedance of 0.6 + j0.7 per phase. Assuming a
positive sequence for the source voltages and that Van = 120 30o V, find: (a) the line
voltages & the line currents using MATLAB.
MATLAB SCRIPT:
clear all; close all; clc;
Van=103.92+60i; %source voltage
Zt=25+20i; %Total Impedance: sum of impedances of Transmission line, Load and Source
Generator
Ian=Van/Zt; %Current per Phase
Mag=abs(Ian);
Ang1=angle(Ian)*180/pi;
Ang2=(angle(Ian)*180/pi)-120;
Ang3=(angle(Ian)*180/pi)-240;
fprintf('Magnitude of line current will be %f Amps\n Angle of 1st phase will be %f \n Angle
of 2nd phase will be %f\n Angle of 3rd phase will be %f \n',Mag,Ang1,Ang2,Ang3);
Vl=1.732*Van;
Magv=abs(Vl);
Ang4=angle(Vl)*180/pi+30;
Ang5=angle(Vl)*180/pi+30-120;
Ang6=angle(Vl)*180/pi+30-240;
fprintf('Magnitude of line voltage will be %f Volts\n Angle of 1st line will be %f \n Angle of
2nd line will be %f\n Angle of 3rd line will be %f \n',Magv,Ang4,Ang5,Ang6);
OUTPUT:
Magnitude of line current will be 3.748088 Amps
Angle of 1st phase will be -8.659080
Angle of 2nd phase will be -128.659080
Angle of 3rd phase will be -248.659080
Magnitude of line voltage will be 207.835427 Volts
Angle of 1st line will be 60.000728
Angle of 2nd line will be -59.999272
Angle of 3rd line will be -179.999272