Un1 =  13.5
frekv =  50
omega =  2*pi*frekv

% Transformatory
Snt1 = 200
Ukp1 = 10
Xt1 = Ukp1/100*Un1*Un1/Snt1

Snt2 = 250
Ukp2 =  10
Xt2 = Ukp2/100*Un1*Un1/Snt2

% Vedeni
Xv1=0.3*20/(110*110)*(Un1*Un1)
Xv=Xv1/2

% Nadrazena soustava
Xs=1.1*Un1*Un1/100

% Alternator
CosFi=0.9
Png=200
Sng=Png/CosFi
Xd=250/100*Un1*Un1/Sng
Xdc=50/100*Un1*Un1/Sng

Pt=150
Fi=acos(CosFi)
Qg=Pt/CosFi*sin(Fi)
Qg=Pt*tan(Fi)
Ig=(Pt-i*Qg)/sqrt(3)/Un1
Xc=Xd+Xt1+Xv+Xt2+Xs
E=i*Ig*Xc+Un1/sqrt(3)

Xcc=Xdc+Xt1+Xv+Xt2+Xs
Ec=i*Ig*Xcc+Un1/sqrt(3)

Us=i*Ig*Xs+Un1/sqrt(3)
Ug=i*Ig*(Xs+Xt2+Xv+Xt1)+Un1/sqrt(3)

ZobrazitFazory

Theta=angle(E)
Thetac=angle(Ec)
abs(E)
abs(Ec)

Pg=3*abs(E)*Un1/sqrt(3)/Xc*sin(Theta)
Pg=3*abs(Ec)*Un1/sqrt(3)/Xcc*sin(Thetac)
Pmax=3*abs(E)*Un1/sqrt(3)/Xc
Pmaxc=3*abs(Ec)*Un1/sqrt(3)/Xcc

Pmax1=Pmax
Pmax2=0
Xccc=Xdc+Xt1+Xv1+Xt2+Xs
Pmax3=3*abs(Ec)*Un1/sqrt(3)/Xccc

Tm=5
Jmot=Tm*(Snt1*1E6)/(omega*omega)
