Circuit inductor model with Q

26 views
Skip to first unread message

Tushar Shenoy

unread,
Jul 6, 2021, 4:03:41 PMJul 6
to scik...@googlegroups.com
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?

thanks!
-Tushar

Julien Hillairet

unread,
Jul 7, 2021, 3:01:01 PMJul 7
to scik...@googlegroups.com
Dear Tushar,

The inductor in skrf.media 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):
        super().__init__(frequency=freq)
       
        self.media = rf.DefinedGammaZ0(freq)
        self.R = R
        self.L = L
       
        myinductor = self.media.inductor(L) ** self.media.resistor(R)
        self.s = myinductor.s
   
    @property
    def quality_factor(self):
        return self.frequency.w * self.L / self.R

my_inductor2 = MyInductor(freq, L, R)
print(my_inductor2.quality_factor)

  
Best regards,

Julien

--
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 scikit-rf+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scikit-rf/CACkuKpo0ZLFddzrbjuS2wjjNtKSdN4AemxAnqtSU_dyJNKMFtw%40mail.gmail.com.

Tushar Shenoy

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

thanks!
-Tushar

Reply all
Reply to author
Forward
0 new messages