NELMA-CAP(1)

NAME
nelma-cap - Numerical capacitance calculator

SYNOPSIS
nelma-cap [ options ] config-file.em

DESCRIPTION
nelma-cap is a tool for numerically calculating capacitances between different conducting structures (usually called nets) on printed circuit boards.

It prints to standard output an equivalent circuit of concentrated capacitances in SPICE compatible format that can be used for example for more accurate circuit simulation (in most cases you can simply attach this output to your SPICE circuit description file).

Error and informational messages are printed to standard error.

OPTIONS

-s STANDOFF
    STANDOFF is the distance from the edges of the currently evaluated conducting structure to the grounded box that forms the boundary conditions for the field calculation. In mesh units. The optimum value depends on the geometry of your circuit. With this setting you can control the compromise between the computing time (lower standoff) and accuracy (higher standoff). If the distance between two nets is larger than the standoff distance, then the program will assume that the capacitance between them is negligible.

-n ITERATIONS
    The number of iterations of the SOR algorithm between two checks of the convergence criteria. The default (100) usually works fine. Should be greater than the standoff value.

-w SOR_OMEGA
    The extrapolation parameter for the SOR algorithm which affects the speed of convergence. Its value must be between 0.0 and 2.0 for the SOR algorithm to work properly. In most cases the optimal value is between 1.0 and 2.0 (1.7 is a good guess). If you're not sure, use 1.0 which reduces the SOR algorithm to Gauss-Seidel iteration which should always work.

    It is impossible to calculate an optimal value, so you will have to experiment a bit. A bad guess will cause nelma-cap to take significantly more time to compute all capacitances.

-e MAX_ERROR
    This option sets the convergence criterion. MAX_ERROR is the maximum relative numerical error of the calculated capacitance (example: 0.02 means that all capacitances will be calculated with 2% or better accuracy).

    Note that MAX_ERROR only affects the accuracy of the SOR algorithm (i.e. numerical error of the field calculation). A wrong value of STANDOFF for example can cause results to have large errors even when numerical errors are negligible.

-r  If a previous calculation was interrupted you can resume it by using this flag. nelma-cap will read the saved state from a file named nelma.save and continue processing the specified configuration file. You have to specify all other command line options exactly as before to get correct results.

-d  Dump electrostatic field strength. For each net nelma-cap writes three files in the current directory with names net-x.dat, net-y.dat and net-layer.dat, where net is replaced with the name actual net name and layer is replaced with names of layers defined in the configuration file. These files contain cross-sections of the electrostatic field strength around the selected net when this net is connected to 1V voltage supply and all other nets are grounded. This output is in a gnuplot friendly format. To draw it with a recent Gnuplot version, use the following commands: gnuplot> set pm3d map corners2color c1
    gnuplot> set palette rgbformula 34,35,36
    gnuplot> splot "net-x.dat" using 3 # plots field strength
    gnuplot> splot "net-x.dat" using 4 # plots electric potential
    gnuplot> splot "net-x.dat" using 5 # plots permittivity
    gnuplot> splot "net-x.dat" using 6 # plots plots object boundaries

-v VERBOSITY
    VERBOSITY is an integer larger than 0. Larger values will cause nelma-cap to output more messages to the standard error.

USAGE
During the calculation you can send SIGINT to the process (pressing CTRL-C has the same effect on most system). This will interrupt the calculation gracefully and allow nelma-cap to save its state to a file named nelma.save . You can later resume this calculation by adding -r option to the command line.

IMPLEMENTATION
Capacitances are calculated by:

    Connecting one net to a known voltage (1V) and other nets to ground.

    Calculating the electric potential throughout the object with finite difference method.

    Calculating the charge accumulated on nets by calculating electric flux. Electric flux is calculated through a surface that is one grid unit away from the net. This means that different object should be at least three grid units away from each other to get reliable results.

    Dividing charge by voltage.

The algorithm is therefore of O(n^2) time complexity regarding the number of nets. This way we also get to calculate each capacitance twice. The difference between these two calculations is used as an estimation of numerical error.

The finite difference method allocates memory that is proportional the cube of dimensions. The field solving algorithm itself is of O(n^3) time complexity.

The system of linear equations that is produced by the finite difference method is currently solved with a SOR iterative algorithm with a constant extrapolation factor.

CONFIGURATION FILE FORMAT
See examples included in the distribution.

EXAMPLES
To calculate capacitances for a typical printed circuit board using image layer masks exported with 200 DPI:

$ nelma-cap -s 70 -n 100 -w 1.8 -e 0.15 example.em > example.spi

AUTHOR
Tomaz Solc (tomaz.solc@tablix.org)

SEE ALSO
nelma-drc(1)