Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Using Matlab with Series RLC

Status
Not open for further replies.

jona1han

Newbie level 2
Joined
Oct 28, 2011
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
Orlando
Activity points
1,292
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.
 
That was exactly what I was looking for! I did not know about the loglog function, thanks.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top