In: Electrical Engineering
11. Write a user oriented MATLAB program that will calculate the capacitance of the capacitor connected across the loads to improve the overall power factor to 0.8 lagging,0.9 lagging, unity power factor, 0.8 leading, 0.9 leading. Also MATLAB will calculate total reactive, real power, and the total current at the source for each ste
Matlab Code:
clear all
clc
j=sqrt(-1);
prompt= 'enter the value of power factor, if PF is lagging enter
the value in negitive : ';
requiredpf=input(prompt)
v=200; f=60;
z1=100; z2=10+20i;
z=1/((1/z1)+(1/z2));
S=conj((v^2)/z);
P=real(S);
theta1=angle(S);
theta2= acos(requiredpf);
C= (P*(tan(theta1)-(tan(theta2))))/(2*pi*f*v^2)
disp('values after capacitor placed in parallel :')
xc=1/(2*pi*60*C*j)
Znew= 1/((1/z1)+(1/z2)+(1/xc));
Itotal= v/Znew
Snew= conj(v^2/Znew);
Ptotal= real(Snew)
Rtotal=imag(Snew)
sample Matlab example for one of the power factor:
enter the value of power factor, if PF is lagging enter the value in negitive : -0.8
requiredpf =
-0.8000
C =
1.6579e-04
values after capacitor placed in parallel :
xc =
0.0000 -16.0000i
Itotal =
6.0000 + 4.5000i
Ptotal =
1200
Rtotal =
-900.0000
>>
%%if you are having any doubts please comment here or else rate me. I done the same answer before so the same code is posted. If values are wrong please let me know by comments%%