Interactive Mismatched Line

Intro

This is a demonstration of using IPythons interact function with some of skrf’s network creation methods.

As of IPython 2.0, the widgets in this notebook won’t show up on http://nbviewer.ipython.org. To view the widgets and interact with them, you will need to download this notebook and run it with an IPython Notebook server.

[1]:
from IPython.display import YouTubeVideo

YouTubeVideo('JyYi_1SswXs',width=700, height=580)

[1]:
[2]:
import matplotlib.pyplot as plt
from ipywidgets import interact

%matplotlib inline

import skrf as rf
from skrf import Frequency
from skrf.media import DistributedCircuit

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
                          )

Mismatched Line

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.

Log Mag

[3]:
def func(d=180,z0=54):
    ntwk =rg58.line(d=d,unit='deg',z0=z0)
    ntwk.renormalize(rg58.z0)
    ntwk.plot_s_db(1,0)
    ntwk.plot_s_db(0,0)
    plt.ylim(-50,20)
    plt.draw()
    plt.show()

interact(func, d= (0,360,10),z0=(10,200,1),embed=True);

Smith Chart

[4]:

def func(d=180,z0=54): ntwk =rg58.line(d=d,unit='deg',z0=z0) ntwk.renormalize(rg58.z0) ntwk.plot_s_smith(1,0) ntwk.plot_s_smith(0,0) plt.draw() plt.show() interact(func, d= (0,180,10),z0=(10,200,1),embed=True);
[ ]: