\chapter{Creating a Cable Bundle Model} \label{creating_a_cable_bundle_model}

\section{Introduction} 

This chapter describes the creation of a cable bundle model from previously defined cables. A cable bundle model is only concerned with the development of a multi-conductor propagation model for the bundle cross section and the calculation of the associated model parameters. 

\subsection{Cable bundle specification}

A cable bundle is described as a combination of previously defined cables along with their position and orientation within
the cross section of the bundle (x-y plane). A ground plane may also be included in the bundle specification. The ground plane is assumed to lie in the x-z plane i.e. along the x-axis in the cross section of the bundle.

The overshield cable type may enclose other cables within the bundle. 

The cable position and orientation are defined using two or three real numbers. The first two are the x and y coordinates of the cable centre.
The third number is a rotation angle for the cable, the angle is defined in an anticlockwise direction from the x axis. This is illustrated in figure \ref{cable_bundle_specification} in which a coaxial cable is placed with its centre at point $(x_1,y_1)$ and a flex cable is placed with its centre at point $(x_2,y_2)$ and is rotated by an angle $\theta_2$. A ground plane is also included in the bundle specification.

\begin{figure}[h]
\centering
\includegraphics[scale=0.75]{./Imgs/cable_bundle_specification.eps}
\caption{Specification of a cable bundle cross section}
\label{cable_bundle_specification}
\end{figure}


\subsection{Conductor numbering within the bundle}

The numbering of conductors within the bundle is very important for the correct use of the Spice cable bundle models as the conductor numbering within the bundle defines the connection nodes of the Spice subcircuit.

The numbering of conductors within a cable are shown in the figures for each cable type in section \ref{creating_a_cable_model}.

The conductors in the bundle are numbered in the order of their specification i.e. conductor number 1 is the first conductor of cable 1, conductor number 2 is the second conductor of cable 1 etc until all the conductors of cable 1 are counted, the the next conductor is the first conductor of cable 2 and so on.

\subsection{Cable bundle reference conductor}

The reference conductor for the bundle is always the last conductor in the cable bundle specification. Note that for shielded cables the last conductor will always be the cable shield. If a ground plane is included in the bundle then this is always the last conductor to be specified and hence it automatically becomes the reference conductor for the bundle. The order of the cable specifications in the bundle will have no impact on the results from the model provided that the recommendations regarding the use of `node zero' in section \ref{node_zero} are adhered to.

\section{Cable Bundle Specification File Formats} \label{Cable_bundle_spec_file_formats}

This section describes the cable bundle specification file formats used as the input to the cable bundle model building process.
Cable bundle specification files have the extension \textbf{name.bundle\_spec}. 
The first lines of the \textbf{.bundle\_spec} file specifies the path to the cable models used in the bundle specification (i.e. the path to the cable models within MOD), then the path to the cable bundle model to be produced from the specification (i.e. the path to the cable bundle models within MOD)

Following this is a list of cables which constitute the bundle and their configuration in the bundle cross section followed by an indication of the presence or absence of a ground plane.

If there are frequency dependent dielectrics present in the external domain of the bundle and it is required to take this frequency dependence into account in the bundle model then some `filter fitting' information must be included so as to specify the order of the frequency dependent model to be used. This is the same information as that required to specify frequency depdendent models for shielded domains described in section \ref{Cable_spec_file_formats}. As for shielded domains, the filter fitting process provides a best fit model of
specified order over a specified frequency range. As a default the model order is 0 i.e. no frequency dependence is included in the admittance matrix (the permittivity used is the high frequency value of the dielectric constant).
The model order can be specified in two ways:

\begin{enumerate}
\item The order is specified as a positive integer and this is the order used
\item A negative integer is specified. In this case the order is chosen using an automatic algorithm which
attempts to choose the best order from 0 up to $|$specified order$|$
\end{enumerate}

following the model order the frequency range is specified. The frequency scale is set to be either linear (`lin') or logarithmic (`log'), following this the minimum frequency, maximum frequency and the number of frequencies for the filter fitting process are specified. If the Laplace solution is used then the number of frequencies should not be too large as this will lead to excessive runtimes for the cable model building process. 

An example of a filter fitting specification for the admittance matrix element fit is shown below in which
an order 2 model is specified based on a fit to logarithmic frequency data over a range of 1kHz to 1GHz with 12 sample points: 

{\small
\begin{verbatim}
2          # order for admittance matrix element fit model
log          # frequency scale (log or lin)
1e3 1e9 12   # fmin fmax number_of_frequencies
\end{verbatim}
}

In addition to the data required to specify a cable bundle, additional flags may be specified to influence the operation of the software. These flags are as follows:

\begin{enumerate}
\item `verbose'    output detailed summary of the software operation and calculation results.\\
\item `use\_Laplace'    use the numerical Laplace solver to calculate inductance and capacitance matrices for the external domain and any overshielded domains. By default, approximate analytic formulae are used. \\
\item `plot\_mesh'    output a vtk file which shows the mesh used in Finite Element Laplace calculations.\\
\item `direct\_solver'  Solve the Finite Element matrix equation using a direct solver i.e. by calculating the matrix inverse. \\
\item `iterative\_solver'  Solve the Finite Element matrix equation using an iterative solver. This is much more efficient than the direct solver and is the default option \\    
\item `inf\_gnd' Include the ground plane as a boundary condition on the y=0 boundary in the Finite Element Laplace solution for the bundle cross section. the outer boundary in this case is a semi-circle.   \\
\item `finite\_gnd' Include the ground plane as a finite conductor in the Finite Element Laplace solution for the bundle cross section. In this case the ground plane is a finite rectangular conductor within a circular boundary.  \\
\end{enumerate}

If the Laplace solver is used then the mesh generation is be controlled by the parameters

\begin{enumerate}

\item `Laplace\_boundary\_constant'  This parameter determines the distance to the outer boundary in open boundary domains.
                                   The distance to the outer boundary is calculated by first determining the largest dimension 
                                   of the conductor system (including the origin if a ground plane is included), bundle\_size. The outer boundary is 
                                   defined as a circle of radius  $bundle\_size*Laplace\_boundary\_constant$. The default value is 3. \\
                                   
\item `Laplace\_surface\_mesh\_constant'  This parameter determines the number of finite element edges on a conductor surface.
                                       The edge length of elements on a cylindrical conductor of radius r is
                                       $\frac{r}{Laplace\_surface\_mesh\_constant}$. The default value is 3. \\
                                   
\item `Max\_mesh\_edge\_length'  This (real) parameter determines the maximum finite element mesh edge length for the rectangular conductors of flex cables. It may be used to force an increase in mesh density in flex cables. \\
                                   
\item `gp\_edge\_length'  This (real) parameter determines the finite element mesh edge length at the centre of the ground plane. It may be used to increase the mesh density in the ground plane below the cable bundle to improve accuracy of the per-unit-length parameter calculation. \\
                                   
\end{enumerate}

The default parameters are a compromise between accuracy and computation time for the Laplace solution. 
The default values may be overridden by the user by appending the following to the end of the \textbf{.bundle\_spec} file:

\begin{verbatim}
Laplace_boundary_constant
4
Laplace_surface_mesh_constant
5
max_mesh_edge_length
0.02e-3
gp_edge_length
0.1e-3
\end{verbatim}

Note that the Laplace solver must be used in cable bundles containing flex cables or D connectors.

If the iterative solver is used to solve the Finite Element matrix equations then the tolerance for the iterative solution may be set using the parameter $cg\_tol$. The default value is $10^{-12}$. The parameter may be set (in this example to 1E-14) by including the following lines int the \textbf{.bundle\_spec} file:

\begin{verbatim}
cg_tol
1E-14
\end{verbatim}


A ground plane may be included in the bundle as shown in figure \ref{fig_ground_plane_specification}

\begin{figure}[h]
\centering
\includegraphics[scale=0.75]{./Imgs/ground_plane_specification.eps}
\caption{Specification of the ground plane position in the bundle cross section}
\label{fig_ground_plane_specification}
\end{figure}

The \textbf{.bundle\_spec} file format is shown below, along with an example.

\begin{center}
    \begin{tabular}{ | p{1.25cm} | p{3.5cm} | p{2.0cm} | p{4.5cm} |}
    \hline
    Line number & Typical value & Unit  & Description \\ \hline
1       & \#MOD\_cable\_lib\_dir & -    & Comment line \\ \hline
2       & .             & -             & Directory to read the cable model file from \\ \hline
3       & \#MOD\_bundle\_lib\_dir & -    & Comment line \\ \hline
4       & .             & -             & Directory to write the cable bundle model file to \\ \hline
5       & 2             & integer 	& Number of cables in the cable bundle \\ \hline
\\ \hline
For each cable: & & & \\ \hline
-       & cable name           & - 	& Name of cable in the cable model directory \\ \hline
-       & 0.02 0.045  0.0     & metres metres degrees & x and y coordinates of the centre of the cable in the bundle cross section and rotation angle of cable\\ \hline
\\ \hline
-       & ground\_plane  & - 	& ground\_plane or no\_ground\_plane as required for the bundle\\ \hline
    \end{tabular}
\end{center}

\vspace{5mm}
\textbf{\underline{Example}}

Bundle model name: two\_wires\_over\_ground 

{\small
\begin{verbatim}
#MOD_cable_lib_dir
LIBRARY_OF_CABLE_MODELS
#MOD_bundle_lib_dir
LIBRARY_OF_BUNDLE_MODELS
2    # Number of cables in bundle, cable list follows
single_wire_with_FD_dielectric
6.35e-4     -0.001  0.0
single_wire
6.35e-4     0.001  0.0
ground_plane
2          # order for admittance matrix element fit (here an order 2 model)
log        # frequency scale for admittance matrix element fit (log or lin)
1e3 1e9 12 # fmin fmax number_of_frequencies for admittance matrix element fit
use_Laplace
plot_mesh
Laplace_boundary_constant
4
Laplace_surface_mesh_constant
5
\end{verbatim}
}

\cleardoublepage
