%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % % tranreg.m - Calculates the full-load regulation of a transformer % as a function of load power factor with constant % load voltage applied. % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear; R1=0.06; R2=0.015; X1=0.18; X2=0.045; Xm=400; Rc=1200; V1=240; V2=120; KVA=5; n=V1/V2; R2p=n^2*R2; X2p=n^2*X2; npts=100; thet2=linspace(-pi/2,pi/2,npts); Reg=zeros(1,npts); PF=Reg; for i=1:npts I2=KVA*1000/V2*exp(-j*thet2(i)); E1=(R2p+j*X2p)*I2/n+n*V2; Im=E1/(j*Xm); Ic=E1/Rc; Io=Ic+Im; I1=I2/n+Io; V1=(R1+j*X1)*I1+E1; Zm=j*Rc*Xm/(Rc+j*Xm); Znl=R1+j*X1+Zm; Vnl=abs(V1*Zm/Znl); Reg(i)=(Vnl/n-V2)/V2*100; end thet2=thet2*180/pi; plot(thet2,Reg); grid; title('Regulation vs power factor'); xlabel('Power factor angle ( lead to lag ) - degrees'); ylabel('Regulation, %');