w=1 E=10*exp(j*0) L=1 R1=1 R2=1
C=2
Zlc=(j*w*L*(-j*1/(w*C)))/(j*w*L-j*1/(w*C))
Uc=(E/(R2+Zlc))*Zlc
Il=Uc/(j*w*L)
Uc0=abs(Uc)*2^(1/2)*sin(angle(Uc))
Il0=abs(Il)*2^(1/2)*sin(angle(Il))
X0=[Il0;Uc0]
Ucu=(E/(R1+R2+Zlc))*Zlc
Ilu=Ucu/(j*w*L)
Ucu0=abs(Ucu)*2^(1/2)*sin(angle(Ucu))
Ilu0=abs(Ilu)*2^(1/2)*sin(angle(Ilu))
Xu0=[Ilu0;Ucu0]
Xp0=X0-Xu0
A=[0 1/L;-1/C -1/(C*(R1+R2))]
s=eig(A)
LAMBDA=[s(1) 0;0 s(2)]
S=[1 1;s(1) s(2)]
Sodwr=S^(-1)
t=0:0.1:20
ucu=abs(Ucu)*2^(1/2)*sin(w*t+angle(Ucu))
ilu=abs(Ilu)*2^(1/2)*sin(w*t+angle(Ilu))
Xu=[ucu;ilu]
Ucp1=(1/(s(1)-s(2)))*exp(real(s(1))*t)
Ucp2=(-2*j*sin(imag(s(1))*t)*0.5*Xp0(1))-2*j*sin(imag(s(1))*t)*0.25*Xp0(2)
Ucp3=(s(1)-s(2))*Xp0(2)*cos(imag(s(1))*t)-(s(1)+s(2))*Xp0(2)*j*sin(imag(s(1))*t)
Ucp=(Ucp3+Ucp2).*Ucp1
plot(t,ucu,'w')
hold on
pause
plot(t,Ucp,'r')
hold on
pause
plot(t,Ucp+ucu,'g')