I'm just trying to review some concepts of RLC series circuits. Nothing too intense.
The idea with the Matlab code below is to generate a plot of input impedance with respect to the normalized frequency. I am expecting a nice even dip when the frequency matches the resonant frequency. However, I get a very smooth curve. Can anybody tell me why?
Code:
clear all, close all, clc
R=100; %Resistance
C=6*10^(-6); %Capacitance
L=.1; %Inductance
w_0=1/sqrt(C*L); %Resonant Frequency
n=1;
for w=100:1:2*w_0
Z(n)=abs(j*w*L+(1/(j*w*C))+R); %Input impedance as a function of frequency
ww_0(n)=w/w_0; %Normalized Frequency
n=n+1;
end
plot(ww_0,Z)
Hi;
I think this will help you (you should inrease the range of w and plot in logarithmic domain);
Code:
clear all, close all, clc
R=100; %Resistance
C=6*10^(-6); %Capacitance
L=.1; %Inductance
w_0=1/sqrt(C*L); %Resonant Frequency
w=0.1*w_0:2:10*w_0;
Z=abs(j*w*L+(1./(j*w*C))+R); %Input impedance as a function of frequency
loglog(w/w_0,Z)
% semilogx(w/w_0,Z) %See also result in w axis in log domain
Hope helps
PS:I modified it a little bit, for better run time.