#given
i=10.;
v=200.;
#solution
z=v/i;
I1=20/i;
I2=.2/i;
v1=50/v;
r=2/z;
print"the base impedence=ohm\n",z
print"the base values for 20A=p.u.",I1
print" the base values for 2A=p.u.",I2
print"the base values for 50V=p.u.",v1
print"the base values for 2ohm=p.u",r
#given
z=2;
v=11e3;
r=1000e3;
#solution
zb=v**2/r;
y=z/zb;
y=round(y*10000)/10000;
print"the per unit resistance=p.u",y
#given
v=11e3;
r=15000e3;
zp=.15;
vnew=110e3;
rnew=30000e3;
#solution
zb=v**2/r;
Z=zp*zb;
zbnew=vnew**2/rnew;
Zp=Z/zbnew;
print"the new per unit reactance=p.u",Zp/10
#given
v1=11e3;
v2=22e3;
v3=3.3e3;
r=10000e3;
#solution
zb1=v1**2/r;
zb2=v2**2/r;
zb3=v3**2/r;
zp1=300/zb3;
zp2=300*(zb2/zb3)/zb2;
zp3=300*(zb1/zb3)/zb1;
zp1=round(zp1*10)/10;
zp1=round(zp1);
zp2=round(zp2*10)/10;
zp2=round(zp2);
zp3=round(zp3*10)/10;
zp3=round(zp3);
print"the per unit values =p.u. ; p.u.; p.u. ",zp1,zp2,zp3
#given
z=complex(0,0.2*0.155/(0.2+0.155));
v=1;
i=v/z;
print"the fault current is =+(j)A",i.real,round(i.imag,1)
#given
r=30000e3;
v1=11e3;
v2=110e3;
zb1=v1**2/r;
zb2=v2**2/r;
zp1=80./zb2;
zp2=complex(0,.1*30000./35000.);
zp3=complex(0,.2*30000./10000.);
print"the base impedence of transmission line circuti=ohm\nper unit reactance of transmission line=p.u.\n ",zb2,zp1
print"per unit reactance of transformer to new base=+(j)p.u.\nPer unit reactance of motor to new base=+(j)p.u.",zp2.real,zp2.imag,zp3.real,zp3.imag
r1=10e6;
r2=7.5e6;
r3=5e6;
v1=66e3;
v2=11e3;
v3=3.3e3;
zst=complex(0,.06*r1/r2);
zps=complex(0,.07);
zpt=complex(0,.09)
Zp=(zst+zps-zst)/2;
Zs=(zps+zst-zpt)/2;
Zt=(zpt+zst-zps)/2;
print"the per unit impedencce of circuit \nZp=jp.u ;\n Zs=jp.u;\n Zt=jp.u",Zp.imag,Zs.imag,Zt.imag
#given
old=5000;
bank=200;
#solution
new=old-bank;
print"new fault =MVA",new