1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
clc;
clear;
z1=complex(100,0);
z2=complex(10,20);
v=200;
mprintf("voltage,v=%d V\n",v);
f=60;
mprintf("frequence,f=%d Hz\n",f);
i1=v/z1;
mprintf("current,i1=%d+%dj A\n",real(i1),imag(i1));
i2=v/z2;
mprintf("current,i2=%d+(%d)j A\n",real(i2),imag(i2));
s1=v*i1';
s2=v*i2';
s=s1+s2;
mprintf("total complex power,s=s1+s2=%d W+%dj Var \n",real(s),imag(s));
i=s'/v';
mprintf("complex current,i=%d+(%d)j A\n",real(i),imag(i));
pf=cos(atan(imag(i),real(i)));
mprintf("power factor,pf=%2.1f lagging\n",pf);
theta=acos(0.8);
mprintf("required power factor angle,theta=%4.2f degrees\n",theta*180/%pi);
p=real(s);
mprintf("active power,p=%d W\n",p);
qnew=p*tan(theta);
qc=imag(s)-qnew;
mprintf("capacitor reactive power,qc=%d var\n",qc);
zc=v*v/qc/%i;
mprintf("capacitive reactance,Zc=%4.2fj ohms\n",imag(zc));
c=10^6/(2*%pi*f*abs(zc));
mprintf("capacitance,c=%4.2f uF\n",c);
snew=p+(qnew*%i);
mprintf("total power,snew=%d + %dj =%d angle %4.2f\n",real(snew),imag(snew),abs(snew),atan(imag(snew),real(snew))*180/%pi);
inew=snew'/v';
mprintf("new current,inew=%2.1f angle -%4.2f\n",abs(inew),atan(imag(snew),real(snew))*180/%pi);
mprintf("note reduction in the supply current from 10A to 7.5A\n");
|