I need to simulate a parallel RC circuit with R variable. When I plot it, it seems that are no phase between voltage and current and come Warning: Imaginary parts of complex X and/or Y arguments ignored . and when I calcute this phase (phi), there is something. Can someone help me how to plot with this phase delay? Thanks Flavia Here is my code
f=0.1; %Hz
fs=1000;% Abtastfrequenz in Hz
ta=1/fs;t=0:ta:100;T=10;U=100*sqrt(2)*sin(2*pi*f*t); %V
C=-2*pi*f*1e-6*i; %Kapazität in F
R=15e6*(1+exp(-(t/T+log(5/3))))-14e6; % Widerstand in M Ohm
Y=(1./R)+C;Z=1./Y;I=U./Z;plot(t,I/2e-7,'r',t,U,'g');grid onhold onIm=imag(U./I);Re=real(U./I);phi=angle(Im./Re);figureplot(t,phi*180/pi);
Best Answer