Circuit inductor model with Q

Skip to first unread message

Tushar Shenoy

Jul 6, 2021, 4:03:41 PMJul 6
Hello all, 

First, I just wanted to say that I really enjoy using scikit-rf, thanks to all of the developers out there who make this an awesome module!  

I'm currently doing some LC filter analysis in python with some circuit elements.  Is there a simple way to add Q to the inductor model in the tl_media.inductor model?  

Alternatively, if I make a 'standard' inductor model (so series R, shunt C), can I parameterize that and then use that as a two port circuit element?


Julien Hillairet

Jul 7, 2021, 3:01:01 PMJul 7
Dear Tushar,

The inductor in is defined with a perfect inductance L and without self-resistance (R=0). If you want to calculate the quality factor Q of a more realistic inductance, you need to build your equivalent model yourself, for example by connecting a series resistance to your inductance. Hence, you will be able to calculate Q=w*L/R.

As an example:

import skrf as rf
freq = rf.Frequency(1, 2, 10)  # 1 to 2 GHz, 10 pts
media = rf.DefinedGammaZ0(freq)  # ideal media, 50 Ohm
R = 1e-4  # Ohm
L = 10e-9  # H
perfect_inductor = media.inductor(L)
perfect_resistor = media.resistor(R)
my_inductor = perfect_inductor ** perfect_resistor
# Quality factor
Q = freq.w * L/R

Another possibility, you can eventually define a new object MyInductor(), which superside Network, that takes freq, R and L as argument and which has a quality_factor() method. Something like :

class MyInductor(rf.Network):
    def __init__(self, freq, L, R):
       = rf.DefinedGammaZ0(freq)
        self.R = R
        self.L = L
        myinductor = **
        self.s = myinductor.s
    def quality_factor(self):
        return self.frequency.w * self.L / self.R

my_inductor2 = MyInductor(freq, L, R)

Best regards,


You received this message because you are subscribed to the Google Groups "scikit-rf" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

Tushar Shenoy

Jul 7, 2021, 7:39:36 PMJul 7
Julien, thank-you so much for the feedback!  I think that will work well.  I'll let you know how this goes.  


Reply all
Reply to author
0 new messages