This is a demonstration of using IPythons interact
function with some of skrf
's network creation methods.
In [ ]:
from IPython.display import YouTubeVideo
YouTubeVideo('JyYi_1SswXs',width=700, height=580)
In [ ]:
from ipywidgets import interact
%matplotlib inline
from pylab import *
from skrf.media import DistributedCircuit
from skrf import Frequency
import skrf as rf
rf.stylely()
# define a frequency object
freq = Frequency(0,10,1001,'ghz')
# create a Media object for RG-58, based on distributed ckt values
rg58 = DistributedCircuit(frequency = freq,
C =93.5e-12,#F/m
L =273e-9, #H/m
R =0,#53e-3, #Ohm/m
G =0, #S/m
)
This demonstrates the response of a mismatched transmission line of a given length. Specifically, a line of electrical length $d$ with characteristic impedance $z_0$ is embedded in the coaxial environment (RG-58 ) with $z_0 \approx 54\Omega$. The resultant S-parameters are plotted in log mag and on the smith chart.
In [ ]:
def func(d=180,z0=54):
ntwk =rg58.line(d=d,unit='deg',z0=z0, embed=True)
ntwk.plot_s_db(1,0)
ntwk.plot_s_db(0,0)
ylim(-50,20)
draw();show()
interact(func, d= (0,360,10),z0=(10,200,1),embed=True);
In [ ]:
def func(d=180,z0=54):
ntwk =rg58.line(d=d,unit='deg',z0=z0, embed=True)
ntwk.plot_s_smith(1,0)
ntwk.plot_s_smith(0,0)
draw();show()
interact(func, d= (0,180,10),z0=(10,200,1),embed=True);
In [ ]: