TSSP: GeoTC Library

A Javascript library for TC reactance calculations. Applying some of the techniques used by the tssp software at lower spatial resolution leads to results of sufficient accuracy for most practical uses.

A web application based on this library is maintained by Bart Anderson, see FanTC.

#### Updated: 23 Dec 2008

 Introduction

This library can be included into HTML web pages so that reactance calculations can be performed in Javascript. The library provides the following functions:

• Calculation of the capacitance of spheres, toroids, coils, discs and cylinders, in free space, or in-situ with other components.
• Calculation of self and mutual inductances: helical, cone, or flat.
• Calculation of distributed reactances, effective lumped reactances, and resonant frequencies.
• Calculation of voltage and current profiles.

Calculated values are derived directly from the geometry of the system and do not involve any empirical approximations.

The library is limited to air-spaced systems with cylindrical symmetry. Dielectric properties of the materials involved are not accounted for.

The following typical accuracies can be achieved at the default detail setting:
 C of isolated electrodes, ie to infinity 1% See below C between pairs of electrodes 2% Deteriorates when components close together C of components in-situ 3% Equivalent shunt capacitance, Ces 6% When computed using predefined voltage profiles 3% When using calculated profiles Equivalent energy storage capacitance, Cee 6% Low frequency inductance, Ldc 1% Reduce to 4% for thick conductors Mutual inductance 1% Reduce to 4% for thick conductors Equivalent series inductance, Les 3% Equivalent energy storage inductance, Lee 6% Resonant frequency 4% Voltage and current profiles 5%

For isolated electrodes, it's worth going up to a detail setting as high as 7 for around 0.1% accuracy. A detail setting of 4 is about the limit for meaningful accuracy on the other calculations, except when all the components are well separated.

Inductance calculations are made by summing the contributions from a large number of small current filaments, by lookup using Grover's tables. The accuracy is the same as acmi at a detail setting of 2.

Capacitance calculations use the boundary element method: the electrodes and coils are decomposed into lots of small elements and the potential matrix of this set is computed. From this the charge distribution and a capacitance matrix is obtained by matrix inversion.

Resonance frequency and V/I profile calculations are made by using equations 6.3 and 6.4 from pn2511, starting with the capacitance and inductance matrices obtained above. These equations are only valid at the quarter wave resonance in grounded base, and the compute_F() function iterates over omega to find the unique value at which Kirchhoff's current law is satisfied for the topload. This trick allows a fairly quick solution without resorting to complex arithmetic, and does not imply any extra approximation. Test Page You will need Javascript and Java enabled on your browser. This page loads the library into your browser and runs a suite of test cases. GeoTC.js gzipped A gzipped copy of the library soure code. GeoTC.js zipped A zipped copy. geoplot.class The compiled Java class for the associated graph plotting applet. geoplot.java The Java source code for the graph plotting.

 Library Description

Include the library into your HTML source with the script

```   <script language="JavaScript" src="geotc.js"></script>
```

Library is opened by calling its constructor,

```   var G = new GeoTC();
```

and the library functions are then available as methods of G. Setup the system to be computed by calling functions to install components. For example,

```   G.install_toroid( 0.05, 0.15, 0.50, G.CONNECT_TOPLOAD);
G.install_secondary( 0.1, 0.05, 0.1, 0.45, 320, 0.5e03, G.PROFILE_LOADED);
G.install_primary( 0.2, 0.05, 0.3, 0.05, 14, 2e-3);
G.install_groundplane( 2.0);
G.install_wall( 2.0, 2.0);
G.install_roof( 2.0, 2.0);
```

These functions are documented below. Once all the components are installed, various compute functions can be called, for example

```   var Ces = G.compute_Ces();
```

Components can be removed by calling G.remove() and the library can be reset to an empty system with G.reset().

The precision of the calculations can be controlled by calling G.detail() which determines the number of small elements into which each electrode or coil is decomposed.

 Notes
• Units are metres, Farads, Henries, and Hertz.
• All heights are given relative to an arbitrary datum. Typically the user chooses zero height for the groundplane.
• The install methods return an object whose properties define the object and its connection to the system. This need not be saved to a variable if the user doesn't need to explicitly remove it, or request its reactance.
• Arbitrary numbers of components such as spheres, toroids, discs and cylinders may be installed, and each may be connected to either ground potential or the topload potential.
• Components are represented by thin wire rings. With the default detail setting, the density of rings is such that a Faraday cage or shielding electrode is around 98% effective. See TEST 21 and TEST 22.
• After components have been removed and installed, computations will only recompute the parts of the system that have altered since the last calculation, thereby saving much time.
 Interface Methods

#### GeoTC()

```   var G = new GeoTC();
var G = new GeoTC( open_errwin);
```

This constructor opens and initialises the GeoTC library. More than one instance of the library can be opened if necessary, although components cannot be transferred from one instance to another.

The alternative second form of the constructor allows the caller to pass a reference to a function which will open a window for GeoTC to report error messages. A typical definition of open_errwin might be

```   function open_errwin()
{
return open("","error","height=300 width=500");
}
```

If this feature is not used, error messages will go to the current document.

#### install_sphere()

```   var c = G.install_sphere( hradius, vradius, height, connection);
```

Installs a sphere or spheroid. hradius and vradius are the horizontal and vertical radii respectively. height is the distance of the center above the datum. connection is either G.CONNECT_GROUND or G.CONNECT_TOPLOAD. Any number of spheres may be installed.

#### install_toroid()

```   var c = G.install_toroid( inner_radius, outer_radius, height, connection)
```

Installs a toroid. inner_radius is the radius of the central hole of the toroid. outer_radius is the overall radius. height is that of the central plane of the toroid above the datum. connection is either G.CONNECT_GROUND or G.CONNECT_TOPLOAD. Any number of toroids may be installed.

#### install_disc()

```   var c = G.install_disc( inner_radius, outer_radius, height, connection)
```

Installs a flat circular disc. inner_radius is the radius of the central hole of the disc, which may be zero if the disc is complete. outer_radius is the overall radius. height is that of the plane of the disc above the datum. connection is either G.CONNECT_GROUND or G.CONNECT_TOPLOAD. Any number of discs may be installed.

#### install_roof()

```   var c = G.install_roof( radius, height);
```

A special case of install_disc(), which assumes that the user has chosen a datum of zero for ground level. Any number of roofs can be installed, but they are all at ground potential.

#### install_groundplane()

```   var c = G.install_groundplane( radius)
```

Another special case of install_disc(). This method uses a different decomposition of the disc into small elements, favouring the region beneath the secondary for improved accuracy. If no secondary is installed, this method degenerates to a regular grounded disc. Only one groundplane can be installed at a time.

#### install_cylinder()

```   var c = G.install_cylinder( radius, height1, height2, connection)
```

Installs a cylinder of uniform radius radius. Top and bottom heights above the datum are given by height1 and height2 although it doesn't matter which way round they are given. connection is either G.CONNECT_GROUND or G.CONNECT_TOPLOAD. Any number of cylinders may be installed.

This function installs an open cylinder. If you want a closed cylinder, use G.install_disc() twice to plug the ends.

#### install_wall()

```   var c = G.install_wall( radius, height)
```

A special case of install_cylinder() which installs a cylindrical wall. The function assumes the user has chosen zero for ground level. Any number of walls may be installed, but they are all at ground potential.

#### install_primary()

```   var c = G.install_primary( radius1, height1,
```

Installs a disc, cone, or cylinder, to represent a primary winding. radius1 and height1 specify the position of one (any) end of the winding, radius2 and height2 specify the other end. Any number of primaries can be installed.

#### install_secondary()

```   var c = G.install_secondary( radius1, height1, radius2, height2, turns, wirad, profile);
```

Installs a disc, cone, or cylinder, to represent the the secondary winding. radius1 and height1 specify the position of the grounded end of the winding, radius2 and height2 specify the high voltage end of the coil. Only one secondary can be installed.

profile must be one of the following predefined values:

• G.PROFILE_LOADED. Use a voltage profile typical of a loaded coil.
• G.PROFILE_BARE. Use a voltage profile typical of an unloaded coil.
• G.PROFILE_DC. Use a uniform voltage along the coil.
• G.PROFILE_LINEAR. Use a linearly rising voltage along the coil.

These profiles are used when estimating component and system capacitances without computing the actual voltage profile.

#### install_coil()

```   var c = G.install_coil( radius1, height1, radius2, height2, turns, wirad)
```

Installs a coil wound from a thin, round conductor. This component provides the inductance part of the winding. radius1 and height1 specify the position of the grounded end of the winding, radius2 and height2 specify the high voltage end of the coil. turns, which may be non-integer, specifies the number of turns. wirad is the radius of the conductor.

#### install_ribbon()

```   var c = G.install_ribbon( radius1, height1, radius2, height2, turns,
rwidth, vwidth, rthick)
```

Installs a coil wound from a thin ribbon conductor. This component provides the inductance part of the winding. radius1 and height1 specify the position of the grounded end of the winding, radius2 and height2 specify the high voltage end of the coil. These dimensions refer to one edge of the ribbon. rwidth and vwidth specify the width of the ribbon projected radially and vertically. rwidth should be negative if the given edge is the outer edge. vwidth should be negative if the given edge is the top edge. turns, which may be non-integer, specifies the number of turns. rthick is the thickness of the ribbon.

#### remove()

```   G.remove( comp);
```

Removes the component comp from the system. comp must be an object returned from one of the install functions. Returns true if the object was found and removed, otherwise false.

#### reset()

```   G.reset();
```

This method resets the library to an empty sytem, effectively by calling G.remove() for each component in the system.

#### detail()

```   var oldval = G.detail( newval);
```

Sets the detail level of the calculations to newval, which must be a value greater than 1.0, which is the initial default value. The precision of the program is roughly proportional to the detail setting up to about the value 4.0, beyond which no meaningful improvement can be expected. The running time of computations is roughly proportional to detail cubed for capacitance calculations, and proportional to detail squared for inductance calculations.

The detail setting is not reset by the reset() method.

#### compute_Ces()

```   var Ces = G.compute_Ces();
var Ces = G.compute_Ces( comp);
var Ces = G.compute_Ces( comp1, comp2);
```

The method with no arguments returns the total effective capacitance of the topload and secondary, to ground plus infinity. This may be either Ces or Cdc depending on which voltage profile was given to install_secondary(). If there is no secondary installed, then Ces and Cdc have the same values.

The method with one argument returns the effective capacitance of the component comp. If comp is the only component in the system then the result is the self C to infinity of the object. comp must have been installed with connection G.CONNECT_TOPLOAD to be acceptable to compute_Ces( comp). If comp is the secondary, then the returned value will be either Ces or Cdc according to which voltage profile the secondary was installed with. For other components there is no distinction.

The method with two arguments returns the mutual capacitance between the two objects, taking account of all the other components in the system.

#### compute_F()

```  var result = G.compute_F()
```

Computes the resonant behaviour of the secondary in conjunction with the other components in the system. The returned object result contains several properties as follows:

• result.Ces The effective shunt capacitance of the system.
• result.Cee The energy storage capacitance of the system.
• result.Cdc The low frequency capacitance of the system.
• result.Ctop The total topload capacitance.
• result.Les The effective series inductance of the system.
• result.Lee The energy storage inductance of the system.
• result.Ldc The low frequency inductance of the secondary.
• result.F The quarter wave resonant frequency.
• result.V[] An array of secondary voltages.
• result.I[] An array of secondary currents.
• result.N Number of steps in the secondary profiles.
• result.S[] Array of secondary element sizes.

The secondary voltages and currents in result.V[] and result.I[] are calculated for a nominal 1 amp base current, and the user must scale these to the actual base current.

At present, this function only works for conventional TCs (ie single secondary) with the secondary base grounded.

The function decomposes the secondary coil into a number of elements of unequal lengths (a larger number of smaller elements are used near the ends). The relative length of each element is returned in result.S[]. The sum of all the elements of this array is unity. Index zero of the arrays result.V[], result.I[], and result.S[], refers to the grounded end of the secondary. The current values are the mean values over the length of the corresponding element. For practical purposes result.I[result.N-1] can be taken to be the current entering the topload from the secondary. The voltage values are the voltages at the high voltage end of each element, so that result.V[result.N-1] is the top voltage.

#### compute_Ldc()

```   var Ldc = G.compute_Ldc( coil)
```

Returns the low frequency inductance of the coil component coil.

#### compute_Mdc()

```   var Mdc = G.compute_Mdc( coil1, coil2)
```

Returns the low frequency mutual inductance between coils coil1 and coil2.

#### graph_I()

```   G.graph_I( result);
```

Passes the object result returned from compute_F() to the Java graph plotting library so that the current profile can be plotted. The user must have included the necessary applet with the HTML code

``` <applet code="geoplot.class" name="iprof" height="170" width="300">
</applet>
```

The height and width may be altered to suit the application. The method graph_I will look for the instance of geoplot with the name "iprof". If this is not installed, graph_I() does nothing.

#### graph_V()

```   G.graph_V( result);
```

Passes the object result returned from compute_F() to the Java graph plotting library so that the voltage profile can be plotted. The user must have included the necessary applet with the HTML code

``` <applet code="geoplot.class" name="vprof" height="170" width="300">
</applet>
```

The height and width may be altered to suit the application. The method graph_V() will look for the instance of geoplot with the name "vprof". If this is not installed, graph_V() does nothing.

#### draw()

```   G.draw();
```

This method passes details of the installed system components to the Java applet geodraw, which draws an illustration of the system. The user must have included the necessary applet with the HTML code

``` <applet code="geodraw.class" name="geodraw" height="170" width="170">
</applet>
```

The height and width may be altered to suit the application. If the applet is not installed, G.draw() does nothing.

The geodraw applet chooses a scale which comfortably encloses the main components of the system. The applet may exclude walls, roof, and groundplane, or only show part of them, as necessary in order to scale the image such that the resonator components are clearly rendered.

G.draw() can be called at any time to update the view in the geodraw applet window. Calling G.draw() with an empty system clears the geodraw window.

Maintainer Paul Nicholson, tssp0807@abelian.org.