clear; clc; n1=.89; h1=150; c1=.9; h2=200; n2=.9; c2=.8; h3=500; n3=.93; c3=.707; p4=100; p1=h1*.746/n1; p2=h2*.746/n2; p3=h3*.746/n3; rr1=p1*(tan(acos(c1))); rr2=p2*(tan(acos(c2))); rr3=p3*(tan(acos(c3))); rr4=0; rr=rr1+rr2-rr3+rr4; p=p1+p2+p3+p4; c=rr/p; j=cos(atan(c)); j=round(j*1000)/1000; printf("the Power Factor of the combined sub-station=%f leading",j);