% Axiomy
i=sqrt(-1)
A=-0.5+sqrt(3)/2*i
F=[ 1   1   1
    A*A A   1
    A   A*A 1 ]
pause


% Vstupni udaje
% Alternator
Xdc=0.5*(0.8/20)*110^2*i
% Transformator 1
Xt1=10/100*110^2/35*i
% Transformator 2
Xt2=10/100*110^2/50*i
% Vedeni
Xv=20*0.3*i
% Sit'
Xs=110^2/1000*i
pause

% Prepocet trojuhelnik hvezda
X11=Xv*(Xv/2)/(Xv+Xv/2+Xv/2)
X21=Xv*(Xv/2)/(Xv+Xv/2+Xv/2)
X31=(Xv/2)*(Xv/2)/(Xv+Xv/2+Xv/2)
pause

X12=Xv*(Xv/2)/(Xv+Xv/2+Xv/2)
X22=Xv*(Xv/2)/(Xv+Xv/2+Xv/2)
X32=(Xv/2)*(Xv/2)/(Xv+Xv/2+Xv/2)
pause

X10=3*Xv*(Xv/2)/(Xv+Xv/2+Xv/2)
X20=3*Xv*(Xv/2)/(Xv+Xv/2+Xv/2)
X30=3*(Xv/2)*(Xv/2)/(Xv+Xv/2+Xv/2)
pause

% Zpetna, nulova a ekvivalentni impedance
Z2=X32+(Xdc+Xt1+X12)*(X22+Xt2+Xs)/((Xdc+Xt1+X12)+(X22+Xt2+Xs))
Z0=X30+(Xt1+X10)*(X20+Xt2+Xs)/((Xt1+X10)+(X20+Xt2+Xs))
Zekv=Z2+Z0
pause

% Sousledna impedance
Z1=X31+(Xdc+Xt1+X11)*(X21+Xt2+Xs)/((Xdc+Xt1+X11)+(X21+Xt2+Xs))+Zekv
I1=1.1*110000/(sqrt(3)*Z1)
I2=I1
I0=I1

% Proudy generatoru a site
Ig1=I1*(Z1-Zekv-X31)/(Xdc+Xt1+X11)
Is1=I1*(Z1-Zekv-X31)/(Xs+Xt2+X21)
pause

Ig2=I2*(Z2-X32)/(Xdc+Xt1+X12)
Is2=I2*(Z2-X32)/(Xs+Xt2+X22)
pause

Ig0=I0*(Z0-X30)/(Xt1+X10)
Is0=I0*(Z0-X30)/(Xs+Xt2+X20)
pause

% Napeti v miste poruchy
U1=I1*Zekv
U2=-I2*Z2
U0=-I0*Z0
pause

% Napeti v miste vlastni spotreby
Uz1=1.1*110000/sqrt(3)-Ig1*(Xdc+Xt1)
Uz2=-Ig2*(Xdc+Xt1)
Uz0=-Ig0*Xt1
pause

% Jmenovita soustava napeti
Un1=1.1*110000/sqrt(3)
Un2=0
Un0=0
pause

% Prepocet na fazove hodnoty
Upor=F*[U1 U2 U0].'
pause

Uz=F*[Uz1 Uz2 Uz0].'
pause

Un=F*[Un1 Un2 Un0].'
pause

Ipor=F*[I1 I2 I0].'
pause

Ig=F*[Ig1 Ig2 Ig0].'
pause

Is=F*[Is1 Is2 Is0].'

