% Prechodne deje relizovane na transformatoru
% a vedeni

% Reseni prubehu proudu nakratko numerickou metodou
tspan = 0 : 0.0001 : 0.1;
y0 = [0; 0];
yp0 = [0; 0];

% Ls1*i1' + Rk1*i1 + Lh*i1' - Lh*i2' = Ukm*sin(omega*t)
% - Lh*i1' + Lh*i2' + Ls1*i2' + Rk1*i2 = 0
Ukm=Un1/sqrt(3)*sqrt(2)*Ukp/100;
f2i = @(t,y,yp) [Ls1*yp(1) + Rk1*y(1) + Lh*yp(1) - Lh*yp(2) - Ukm*sin(omega*t)
                 - Lh*yp(1) + Lh*yp(2) + Ls1*yp(2) + Rk1*y(2)];

[t,y] = ode15i(f2i, tspan, y0, yp0);

plot(t,y);
grid on;
