How to determine phase angle of an AC voltage?

22 views (last 30 days)
I am plotting phase angle vs frequency of a parallel RLC circuit. But the output plot isn't correct. I think angle(V) is not giving the phase correctly.But if I use angle(Z) instead of angle(V) the response is correct. Is this because V is in time domain not in phasor domain?
Here is my code:
syms t w real
L=20e-3, C=1e-6, R=10^3;
figure
I = 10*exp(1i*w*t);
Z = (1/R+(1/(1i*w*L))+(1i*w*C))^-1;
V = I*Z;
phase_v = angle(V);
ezplot(phase_v,[100,20000])

Answers (2)

VBBV
VBBV on 18 Dec 2022
Z is impedance. And calculated using following expression.
Z = R+jX ;
Where X is the reactance obtained as resultant from L and C. To compute phae angle or response the equation is
Phi = atan(X/R)
So using Z is more appropriate than V. It's relation with time domain is not relevant for phase response

Star Strider
Star Strider on 18 Dec 2022
Note that ‘v’ is a function of two variables, ‘w’ (that I assume is radian frequency) and ‘t’ (obviously time). The result is a matrix, plotted as a surface, although looking from the top down.
Depending on the result you want, one option is to use the unwrap function (that will likely be useful regardless), another is to define a specific scalar time value, and a third is to make ‘w’ a function of ‘t’, creating a sort of spectrogram plot.
Also:
Z = 1/(1/R+(1/(1i*w*L))+(1i*w*C))
is more efficient that raising it to -1.
syms t w real
L=20e-3;
C=1e-6;
R=10^3;
I = 10*exp(1i*w*t);
Z = (1/R+(1/(1i*w*L))+(1i*w*C))^-1;
V = I*Z
V = 
Variables_in_V = symvar(V)
Variables_in_V = 
phase_v = angle(V);
figure
s = ezsurf(phase_v,[0 100, 0, 20000]) % Need To Define Separate Ranges For 't' And 'w'
s =
Surface with properties: EdgeColor: [0 0 0] LineStyle: '-' FaceColor: 'flat' FaceLighting: 'flat' FaceAlpha: 1 XData: [60×60 double] YData: [60×60 double] ZData: [60×60 double] CData: [60×60 double] Show all properties
figure
surf(s.XData, s.YData, unwrap(s.ZData)) % The 'unwrap' Function Only Works On Numeric (Not Symbolic) Values
xlabel('t')
ylabel('w')
zlabel('Unwrapped Phase')
It is definitely possible to do what you want to do, however you will need to decide on a specific approach.
.

Categories

Find more on MATLAB in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!