M. T. Homer Reid MIT Home Page
Physics Problems Research teaching My Music About Me Miscellany


Codes





A Compendium of scuff-rf Examples


Here are a series of actual scuff-rf examples, including geometry files, mesh files, scuff-rf input files, and command-line syntax.

scuff-rf Examples
1. Input impedance of short-circuited and open-circuited lengths of coaxial cable
2. S-parameters of a planar antenna structure
3. Capacitance of a two-sphere capacitor
4. S-parameters and radiated fields of an MRI coil

1. Input impedance of short-circuited and open-circuited lengths of coaxial cable


Here we will investigate the input impedance of a length of coaxial cable, in both shunted (short-circuited) and open-circuited configurations. All the input files needed to run this example are included in the examples/CoaxialCable subdirectory of the scuff-rf distribution.

The structure in question consists of concentric metallic cylinders, of inner radius R1=5 mm and outer radius R2=2.303R1. (The ratio of 2.303 between outer and inner conductors ensures that the characteristic impedance of the cable is 50 Ω.) The cable is 50 mm long. In the closed-circuit case, the region between inner and outer conductors is filled in with metal at the far end of the structure, while in the open-circut case there is no metal there.

Closed-circuited coaxial cable stub
Open-circuited coaxial cable stub

You will notice that there are two .msh files for the closed-circuit case: ClosedCoax_644.msh and ClosedCoax_2372.msh. These describe the same structure, but meshed with different resolutions. (Similarly, for the open-circuit case, we have OpenCoax_580.msh and OpenCoax_2296.msh.) The number after the underscore refers to the number of interior edges in the mesh discretization, which is a measure of the meshing fineness (the more interior edges, the finer the meshing.) For each .msh file we have corresponding .ports and .rwggeo files.

For the closed-circuit structure, we have only a single port, whose positive (negative) terminal is the circumference of the inner (outer) conductor. To create the .ports file, say for the more coarsely-meshed structure (ClosedCoax_644.msh), we follow the procedure outlined here:

 % scuff-rf --meshfile ClosedCoax_644.msh
 % gmsh ClosedCoax_644.pp
    

This brings up the following display, from which we can easily read off the indices of the exterior edges that contribute to the positive and negative terminals of the port:

 PORT
   PEDGES 0 1 2 3 4 5 6 7
   MEDGES 8 9 10 11 12 13 14 15 16 17 18 19 
 ENDPORT
Screenshot of %gmsh ClosedCoax_644.pp Contents of file ClosedCoax_644.ports

We can proceed similarly to create .ports files for the other meshfiles. (For the open-circuited case, we will have two ports instead of just the one port in the closed-circuited case.)

To compute the impedance parameters of the closed-circuit structures over the frequency range 10 MHz -- 10 GHz, we say:

 % scuff-rf --geometry ClosedCoax_644.rwggeo --portfile ClosedCoax_644.ports
            --minfreq 0.01 --maxfreq 10 --numfreqs 30 --logfreq 
            --zparameters
    

This produces a file named ClosedCoax_644.zparms (see here for details on the file format). We repeat the procedure for the other files (the more finely-meshed closed-circuit structure and the coarse and fine open-circuit structures) to produce data for those structures, and we compare against the well-known expressions for the input impedance vs. frequency of closed-circuited and open-circuited transmission lines, namely

Zclosed(f) = iZ0 tan(f/f0) Zopen(f) = -iZ0 cot(f/f0)

where f0=c/L=6 GHz for our 50 mm transmission line.

In the figure below, the red curves denote the theoretical expressions, while the green and turquoise dots are the predictions of scuff-rf for the coarse and fine mesh discretizations of each structure.

Closed-circuit case
Open-circuit case

2. S-parameters of a planar antenna structure


For our next trick, we'll look at a wire-loop antenna with a single feed port. (The files for this example are in the share/scuff-em/examples/WireAntenna subdirectory of your scuff-em installation.) The antenna is described by the gmsh geometry file SquareCoil.geo, and meshed versions of this geometry (with two different meshing finenesses) are SquareCoil_79.msh and SquareCoil_439.msh:

SquareCoil_79.msh SquareCoil_439.msh

To create .ports files for these meshes, we follow the procedure described above to figure out the indices of the edges in the mesh geometry on either side of the excitation gap. The resulting files are SquareCoil_79.ports and SquareCoil_439.ports in the share/scuff-em/examples/WireAntenna directory.

We'll begin by looking at the input impedance over a fairly wide frequency range from 10 MHz to 1 GHz. For convenience we'll put all our command-line options for this run into a file called SquareCoil_79.args:

 geometry  SquareCoil_79.scuffgeo
 portfile  SquareCoil_79.ports
 cache     SquareCoil_79.cache
 # note frequencies are specified in GHz
 minFreq   0.01
 maxFreq   1.0
 numFreqs  30
 logFreq
 zParameters
    

Now from the command line we say

 % scuff-rf < SquareCoil_79.args
    

This produces an output file named SquareCoil_79.zparms whose content we can plot in gnuplot.

 % gnuplot
 gnuplot> set logscale x
 gnuplot> set xlabel 'Frequency (GHz)'
 gnuplot> set ylabel 'Input impedance(GHz)'
 gnuplot> plot 'SquareCoil_79.zparms' u 1:2 t 'Real' w lp, '' u 1:3 t 'Imag' w lp
    

We learn two things from this:

  • At low frequencies the impedance of the structure has a positive imaginary part that grows linearly with frequency, i.e. the structure is an inductor. (Fitting the low-frequency data to a line reveals the inductance to be around 190 nH.)
  • There is some kind of blip around 300 MHz.

So let's zoom in on a narrower frequency region near 300 MHz. Modify the options as follows:

 geometry  SquareCoil_79.scuffgeo
 portfile  SquareCoil_79.ports
 cache     SquareCoil_79.cache
 minFreq   0.25
 maxFreq   0.4
 numFreqs  60
 zParameters
    

and re-run the example:

 % scuff-rf < SquareCoil_79.args
    

It seems we have ourselves a 340 MHz antenna.

3. Capacitance of a two-sphere capacitor


This example demonstrates how to specify ports by defining polygonal regions of space. In contrast to the port specifications described above, in which we explicitly listed the indices of the exterior mesh edges, the polygonal-region method has the advantage of referring only to the geometry of your structure, not the actual mesh; what this means is that you can re-mesh a given geometry at several different levels of meshing fineness and reuse the same .ports file for all the different meshes.

The geometry here is a capacitor consisting of two identical spheres.

3. S-parameters and radiated fields of an MRI coil


 % scuff-rf < SquareCoil_79.args2
    


scuff-rf Documentation
1. Downloading and Installing scuffrf
2. A Tutorial Walk Through scuff-rf
3. scuff-rf Command-Line Reference
4. scuff-rf Input and Output File Reference
5. A Compendium of scuff-rf Examples


A Compendium of scuff-RF Examples, by Homer Reid
Last Modified: 11/16/16