1. Section 3 of the theory document is not quite complete - we need to present the full worked through solution
   and then comment the analytic solution implementation accordingly. 
   STARTED - not yet complete

2. Comilation fails on gfortran version 4.4.7 - this version of gfortran does not implement the full f2008 standard
   and the command EXECUTE_COMMAND_LINE() is not implemented and we have to go back to the old 
   non-standard SYSTEM() command.
   FINISHED - only compilers which conform to 2008 standard are supported
   
3. At the moment the Latex documentation is difficult to build from the .tex and .cls files. There are fonts and other
   things missing from the standard Latex installation and other packages are obviously required. Maybe the Latex cls 
   file could be simplified to make it more portable - it seems overly complex at the moment.
   FIXED: NLR have provided a revised class file for the documents.
   
4. There is a problem with paths in cygwin:
   pwd gives the form /home/user/
   whereas this directory is in fact
   C:/cygwin64/home/user/
   ngspice called from cygwin requires the second form to work correctly

   FIXED: used cygpath -m ($pwd) to get the path in cygwin. BUT NEED TO CHECK...

5. If the code is installed in a directory whose path contains
   spaces then make fails. Reading around the web the advice appears to be
   that filenames and directory names with spaces should never be used.
   Whilst there are some methods for getting around parts of this problem
   there is no consensus on a solution. 

   NO FURTHER ACTION: The advice at the moment is not to install the code in a path that contains spaces.

6. In cygwin any underscore characters are interpreted as indicating a 
   following subscript character. We need to explicity set the terminal settings
   to stop this i.e. we need something like the following in gnuplot files:
   set term x11 noenhanced
   
   FIXED

7. There is a problem with transient analysis in NGspice. Ngspice fails for long simulation
times. Options to proceed:
a. We can look at the simulation parameters and their effect on the transient simulation
s. We can try to replace the simple delay line with an equivalent LTRA transmission line
   model which is implemented in a different way and could be more robust
c. Ask advice on the ngspice user forum.
   IN_PROGRESS: This issue was raised in the phase 1 test cases which had a fixed spice model 
   topology. If a s-domain transfer function was not required (H(jw)=1) then this was implemented
   as a single pole model where the pole was placed at extremely high frequency. This
   pole can cause a problem. 

   STARTED: The original issue was with the s-domain transfer function for frequency independent
   test cases in the original Phase_1 test cases. The s-domain transfer function was included whether 
   needed or not. If not needed then the s-domain transfer function consisted of a single pole at
   a very high frequency. This pole is what causes the problem. Shifting the pole frequency allows
   the simulation to proceed for longer. 
   In the software code we only include s-domain transfer functions where required. Maybe
   we should also consider a constraint on the position of poles in the s-plane...
   
   As at 13th June 2016 this issue appears to occur very frequently. Initial investigations at NLR
   suggest that this is limited to ngspice and does not occur in LTspice or Pspice. 
   Some of the solution parameters and tolerances *(see 18) can have an effect on whether the solution completes or at
   least the length of time it runs before failure. 
   The use of LTRA models doesn't improve the robustness of the solution and it still fails. 
   
   REQUIRES FURTHER WORK: This issue can be addressed by the implementation of the s-domain transfer functions using
   passive networks (note this will also improve the portability of the software, no differences between Ngspice, LTspice or Pspice.

   STARTED: The original issue was with the s-domain transfer function for frequency independent
   test cases in the original Phase_1 test cases. The s-domain transfer function was included whether 
   needed or not. If not needed then the s-domain transfer function consisted of a single pole at
   a very high frequency. This pole is what causes the problem. Shifting the pole frequency allows
   the simulation to proceed for longer. 
   In the final code we should only include s-domain transfer functions where required and maybe
   we should consider a constraint on the position of poles in the s-plane. 

8. The validation examples use VM(node) for both a.c. and transient analysis. This needs to be
   checked and changed if required as we don't want |V| output for transient analysis... 
   DONE
   
9. PSpice does not understand the output VM(node) (this is used to request voltage magnitude output in
   ngspice and Ltspice.)
   DONE: Spice versions have their own circuit files.
   
10. Cannot model shielded cables without a ground plane at the moment i.e. we assume that there is always
    as external domain and this is not necessarily the case. 
   FIXED - see test case COAX
    
11. The domain decompositon process implementation in the cable_bundle_model_builder is very messy. This need
    to be re-worked thoroughly - a new notation needs to be developed and the software linked to the theory document for
    this aspect of the solution.
    DONE but still somewhat complicated so this could still be looked at again...
    
12. Over-shields have not been implemented yet...
    DONE 

13. Discrepancy in mutual inductance vs NLR for TWO_WIRES_OVER_GROUND_PLANE_MOD test case
    Fixed 30/3/2016 CJS. Formula implemented wrongly - factor of 2 out...
    
14. There are some fixed format write statements which may cause problems if spice circuit element names become too long. See write_filter_model() for example.
    STARTED: we have extended the format so that it deals with any proactical situation

15. The eigenvector/ eigenvalue solver fails to return an accurate result for some configurations (Spacewire with the same dielectric throughout (air) for example). This problem needs serious attention. 
    STARTED: The Spice model is now derived using a rigorous method based on eigensolutions of real, symmetric matrices. There may still
    be an issue with the analytic solution which requires the diagonalisation of a complex general matrix at every frequency of analysis.
    The complex diagonalisation method now includes a very small perturbation to the diagonal elements of the matrix which
    prevents the degenerate mode problem from ocurring - need to check that this is consistent with the modal decomposition for the lossless case i.e. that the modes found will be the same...

16. There can be a failure to consistently identify a particular mode when deriving the correction function This leads to problems 
    with the filter fitting. Maybe we need to investigate a method by which the high frequency modes (eigenvectors) are used to generate mode propagation constants at each frequency in an iterative approach... It is also important for the propagation correction that the modes are consistent over the whole frequency range of the simmulation. At the moment this is a matter of relying on eispack to achieve this but it MUST be imposed explicitly in the software.
    STARTED: We now order the eigenvalues and use this ordering to uniquely identify modes. Degenerate modes are not a problem as
    only eigenvalues are used in deriving the propagation correction.
    DONE 27/10/2016. This process has been given some more rigor now: The modes are identified by calculating the overlap between the reference 
    (lossless) configuration modes and the locally calculated modes.

17. The frequency range used for the propagation correction needs to be sorted out properly. It is arranged on the basis
    of the validation test case frequency range (or the frequency range required in FFT for transient solution)
    STARTED: The frequency range for filter fitting may now be set explicitly in the .spice_model_spec file.
    DONE: the The frequency range for filter fitting has now been extended to the Yfilter matrix calculation process.
    
18. There can be a problem with convergence of the s-domain transfer function solution in transient simulations.
    The stopping point is affected by: voltage source function (including amplitude) and options RELTOL,CONVABSSTEP,CHGTO in non-obvious ways.
    UNDER INVESTIGATION: This appears to be a problem with the Ngspice implementation of s-domain transfer functions. An alternative
    based on network synthesis of the transfer function is being investigated as an alternative.
    SEE POINT 7.

19. The conductor impedance modelling code needs its own module separate from the cable module I think as it is used everywhere.

20. The transfer impedance model code includes a large amount of repeated code for the special case Ts=Tv which requires a
    different circuit. 
    DONE: the implementation of this special case has been updated.
    
21. There is a small discrepancy between ZT_WIRE_WITH_OVERSHIELD_AND_SINGLE_WIRE ZT_FD_COAX_AND_SINGLE_WIRE_FREE_SPACE
    which should be the same test case but set up in different ways. This should be resolved or at least understood.
    FINISHED: This was resolved in development of the transfer impedance model to multi-mode propagation.

22. The frequency calculation for log and linear scales needs to be tidied up as it is repeated in several places...
    STARTED with GENERAL_MODULES/frequency_spec.F90:TYPE :: frequency_specification
    but this needs to be used everywhere.
    DONE

23. The writing of comments in the spice circuit file should be done in a subroutine to reduce the size of the code
    and would allow an easy change to the style of comments
    STARTED with write_spice_method_of_characteristics_equivalent_circuit.F90
    DONE.

24. The allocation of new node numbers should be done in a subroutine to reduce the size of the code
    STARTED - needs to be used everywhere now.
    DONE

25. The summation terms in the transfer impedance model are implemented with series voltage sources. It may be
    better to use current sources and a 1 ohm resistance to implement the sum as this will reduce the node count.

26. The filter fit should use the best available model, not simply the highest order model.
    DONE 30/6/2016

27. The transfer impedance model needs thorough testing for cases when the shield whose transfer impedance we are 
    including in the model is and is not the reference conductor in the source/ victim domain.
    STARTED: SEE ADDITIONAL_TEST_CASES
    DONE
    
28. Reordering the conductors in the FOUR_WIRE_BUNDLE test case can cause a difference in results: Is this related
    to the eigenvector problem? Why is there an error in the zero order filter fitting in this lossless case? 
    This needs to be investigated and solved.
    DONE: This was fixed with the implemetation of the improved (rigorous) eigensolver for the spice model
    modal decomposition.
    
29. We need to check whether we have more components than necessary in the transfer impedance model. We have 
    one source mode delays for each victim mode.
    
30. Make clear how the reference conductor is specified in the user guide.
    DONE: There is now a short section in the user guide relating to this issue.

31. Transient solution bug if order of filter fitting model and frequency range is not specified. Filter fitting doesn't seem to
    get a testing frequency list... This is due to moving the analytic solution to after the spice model creation and also realtes
    to the frequency range specification issue (nummber 22)
    DONE: Frequency range for filter fitting is specified explicitly now for these test cases.
    
32. 20/6/2016 FD_LARGE_BUNDLE test case gives poor results for 20 conductors with a propagation correction included (but OK with no propagation correction). I think the first thing to look at are some of the convergence (and other solution) parameters in Ngspice.
    Note that it appears to work in LTspice.
    STARTED: This has been accepted as shoowing a problem with Ngspice. Note that replacing the s-domain transfer functions with an equivalent circuit
    implementation of the propagation correction gives the correct result in Ngspice. 
    SEE POINT 7.

33. SUBROUTINE write_Pspice_filter_model has three different forms of output for testing with Pspice, LTspice. It appears that the 
    third form with explicit normalisation of coefficients works the best but this needs thorough testing, including with Pspice
    before the un-used formats are stripped out.
    DONE
    
34. Problem with a0=b0=0 in transfer impedance filters in LTspice. This is die to subtracting the d.c. resistance then integrating in time
    (multiplying by 1/s in Laplace domain)
    DONE: Fixed: Divide top and bottom by s before writing the ZT filters in SUBROUTINE write_transfer_impedance_circuit

35. At the moment conductors can be placed on both sides of a ground plane, also the incident field excitation is symmetrical wrt to the
    ground plane i.e. there is field on both sides. I think we need to check where the conductors are wrt the ground plane.
    DONE.
    
36. Check the assumptions about the termination configuration in both the Spice model and the analytic model to make sure
    that they are consistent. This needs to be documented thoroughly.
    DONE. I think the models are consistent and the comparisons between the analytic and Spice models show this for a range of incident angles. 

37. The mesh format translation in Laplace.F90 is not the most efficient and may be simplified.
    DONE

38. We need to decide how to calculate the L/C/G matrices for the twisted pair model as we assume
    a common mode/ differential mode decomposition i.e. how do we calculate the L/C/G for the common mode
    only? 
    DONE We use an equivalent radius (specified as a parameter) which provides good agreement with the NLR averaging method.

39. A single oversheild (empty) over a ground plane fails with the error:
    ERROR in PUL_LC_calc_overshield_wide_separation_approximation
 Conductor lies outside or intersects the reference shield conductor
    DONE: create_global_domain_structure.F90 was assuming that all overshields contributed a viable domain i.e. they had internal conductors.
          for this test case the overshield is empty and therefore 

40. The analytic solution for shielded cables appears to work if we assume that all shielded conductors are at the same position in space
    as the shield but this needs to be justified properly in the theory manual (or not...) 
    This solution will probably fail for overshield domains... Maybe we need to shift all conductors within an overshield to the overshield centre
    for the purposes of incident field calculation.
    STARTED: The position of shielded conductors is shifted as described and the tests so far work. This needs justification. 
    DONE: This model does appear to work but we have also explicitly set the current source term IF to zero in shielded domains in the analytic solution.
    This gives good comparisons between Spice and analytic models, especially when using the full model of Xie. 
    
41. How does the analytic solution deal with the domain decomposition model for twisted pairs? Does it get it right?
    STARTED: see point 43 and comparisons between spice and analytic solutions, especially regarding loss models at low frequency
    DONE. No discrepancies now seen in the test cases.

42. The Laplace solver assumes epsr=1 in the 'free space' region however it can take other values for internal domains for spacewire, twinax and
    shielded twisted pairs. We need to include a 'free space' dielectric constant in the PUL structure and via this into Laplace. 
    DONE

43. How does the common mode/ differential mode decomposition for twisted pairs work with the conductor based loss model? I'm not sure that it is rigorous and needs to be checked. 
    Error with the allocation of conductor losses for twisted pairs. In the analytic solution
    the domain based common mode/ differential mode decomposition was in error as the common mode
    sees the two conductors in parallel. The losses in twisted pair and shielded twisted pair cables needs
    proper investigation. This has an impact in propagation_correction_filters.F90 frequency_domain_analysis.F90 
    and time_domain_analysis.F90 as well as conductor_impedance_model.F90
    
    8/9/2016: Attempted fix using conductor_impedance%Resistance_multiplication_factor to get the common mode/
              differential mode loss contributions correct in both the spice model propagation correction and
              the analytic solution. NEEDS MORE TESTING...
    DONE

44. Lines longer than 132 characters cause an error in Pspice.
STARTED: Node number lists at either end are on separate lines with fixed format (I6) integers.
Note that this is not yet general as the line length can be greater than 132 characters in the number of conductors > 22  
DONE 10/10/2016. SUBROUTINE write_long_node_list should prevent this problem from occurring

45. Probably need to implement a file for warnings e.g. inaccurate filter fits etc during the model creation process or
    transfer impedance and surface impedance of a shield are not equal at d.c. This
    will alert the user to potential problems even if a working spice model is produced.
    
46. Do we need to integrate the shield model (transfer impedance and shield conductor impedance) creation process into the
    automatic testing script? At the moment there is some test data in the TEST_CASES directory but this is not run automatically.

47. There is an error in the domain decomposition matrices for the twisted pair model when a twisted pair is in a bundle
    with other conductors. This causes coupling from the differential mode onto other cables. 
    STARTED: The error originates from the construction of the MV and MI matrices on a domain basis. Elements of MV and MI are
    overwritted when the external domain is defined. The fix is to check whether a conductor is a reference conductor for another
    domain before overwriting it. Reference conductors should already have their MV and MI matrix elements set correctly.
    This needs thorough checking. Also need to check that it is correct in overshield domains. 
    SUBROUTINE create_global_domain_structure has been updates so this should no longer be a problem...
    DONE
    
48. There is the possibility that the problem could be a single domain which is shielded so check for this
    We need to implement a check as to whether the last viable domain is an external domain
    There is the possibility that the last domain is shielded so no differential mode can be excited by the incident field
    DONE
    
49. The incident field excitation documentation is based on Clayton Paul's derivation. Maybe it is too close and needs 
to be reworded and a different notation adopted?

50. Elements of TVI used in the transfer impedance model were wrongly transposed in SUBROUTINE write_transfer_impedance_circuit
    Tjis was found while writing the documentation for this part of the model. 
DONE:
!OLD  TVI_victim_row(1:n_victim_domain_modes)=TVI_victim(victim_domain_shield_conductor,1:n_victim_domain_modes)
! NEW
  TVI_victim_row(1:n_victim_domain_modes)=TVI_victim(1:n_victim_domain_modes,victim_domain_shield_conductor)

51. We need to give user control over the filter fitting parameters for the PUL parameters - this is hard wired at the moment.
    DONE

52. Spacewire models use common mode/ differential mode decomposition but this is not implemented rigorously for frequency dependent dielectrics-
    it is assumed that the dielecric is homogeneous in the shielded twisted pairs.
    STARTED: 2/10/2016 done for inhomogeneous but constant dielectrics 

53. Conductor shape paramters are set in more than one place (PUL and CABLE_MODULE PUL_LC_ground_plane.F90  
    PUL_LC_overshield.F90 and PUL_LC_open_boundary.F90) need to rationalise this
    DONE

54. Can we combine  PUL_LC_ground_plane.F90    PUL_LC_overshield.F90 and PUL_LC_open_boundary.F90 ?
    DONE 13/12/2016

55. external conductor information should have it's own structure I think... This should allow us to remove the horrible fix 
    for flex cables which have to have their conductor offsets calculated in create_global_domain_structures.F90.
    DONE. 6/10/2016

56. Need to implement the conductor loss model for rectangular conductors.
    DONE 10/10/2016

57. We need to test reordering of conductors - especially when shields may or may not be reference conductors.
    STARTED: See ADDITIONAL_TEST_CASES especially some of the transient simulations.
    DONE
    
58. Are the results of the incident field excitation model dependent on the
conductor numbering i.e. the choice of the reference conductor? 
The integration paths/ areas are between conductor and reference conductor...
STARTED: This has been looked at in: ADDITIONAL_TEST_CASES/THREE_WIRE_RIBBON_CABLE_EINC
where there are only small differences when the conductors are re-ordered.
DONE: All discrepancies have been eliminated for the re-numbered test case.

59. We need to deal with the situation when Tvictim=Tsource and Tvictim=Tz in the Xie model. Botched at the moment...
    DONE 7/10/2016
    
60. The analytic solution assumes that shielded conductors are at the centre of the shield for incident field excitation...
    This is not the case for bundles with overshields so this needs fixing...
    DONE: Shielded conductors take the coordinates of the shield centre for the incident field excitation. This 
    has the effect of there being no voltage or current sources between the shielded cables and the shield. 

61. Could the ground plane be included as a normal rectangular conductor in the Spice model?

62. Problem with transfer impedance test cases from NLR. Found that coax and single wire model changed according to the ordering
    of conductors i.e. if the coax shield was or was not the reference conductor in the victim domain. 
    DONE: Found a sign error in write_transfer_impedance_circuit.F90 (also repeated in write_ZT_incident_field_excitation_circuit.F90
   ! original
  TVI_victim_row(1:n_victim_domain_modes)=TVI_victim(1:n_victim_domain_modes,victim_domain_shield_conductor)
    should be:
       ! sign error found 13/10/2016
  TVI_victim_row(1:n_victim_domain_modes)=-TVI_victim(1:n_victim_domain_modes,victim_domain_shield_conductor)
  
  Also an error in the analytic solution in adding transfer impedance terms to the Z matrix in some circumstances.
  
63. Error found in the domain decomposition matrix MV for a double shielded coax and single wire over ground.
    DONE 18/10/2016. This was due to errors in filling MV for the overshield - terms related to the reference 
    conductor in the overshield domain. 
    
64. We need to make the surface impedance and transfer impedance consistent. See Jaco's e-mails 20/10/2016.
    STARTED: by setting thickness, t=0 in the cable_spec file an 'equivalent thickness' is calculated from the
    transfer impedance at d.c.
    STILL NEED to deal with the case if sigma=0 or Zt=0 at f=0 for example which will cause an error.
    DONE
    
65. We generate meshes at the cable model building stage and also at the bundle model building stage. 
    Meshes for both cables and bundles are labeled on a domain basis however there is no distinction between cable internal
    domain mesh numbers and bundle domain numbers. Do we need to indicate which is which? Do we need all cable and bundle meshes 
    available at the same time?
    DONE: The meshes have been named with the cable or bundle name as well as the domain number.

66. FD_Shielded twisted pair models are calculating the L and C matrices for the common and differential mode using L and C 
    calculated assuming a homogeneous dielectric i.e. rd is ignored...
    DONE 2/10/2016

67. Need proper checks for conductor/dielectric intersection with a meaningful error message, not just a mesh generation error.
    STARTED: working for cylindrical conductors but not included for rectangular conductors.
    DONE April 2017

68. The test for frequency dependent dielectrics fails if epsr(infinty)->1.0
    DONE 8/10/2016 Now we check that epsr(f=0).NE.1.0 .OR. the order of the material .NE.0
    
69. Cable intersection check needs to include rectangular conductors and the ground plane
    SEE 67.
    DONE April 2017

70. Check signs in the calculation of G in Laplace with complex epsr. Note that this still requires validation...
    DONE and consistent with the theory.

71. There is a problem with the modal decomposition if an assymetric structure becomes symmetric as w-> infinity
    as the frequency dependent modal decomposition then does not converge to the w-> infinity decomposition and the
    propagation correction gets messed up.

72. Pspice simulations of some transient test cases take a very long time... This is due to very small delays in incident field excitation model transmission lines for some angles of incidence. 
    DONE: 6/12/2016 Replace small delay transmission lines by a very small resistance.
    
73. Allow command line arguments to all three software modules.
e.g. cable_model_builder cable_name
    DONE
    
74. There is a small loss of accuracy if Ts is approximately equal to Tv for incident field coupling for shielded cables 
    see EINC_ZT_MULTI_MODE_2S_2V. This seems to appear at low frequency where the coupled signal is so low that it is probably insignificant.
    DONE. This may be dealt with by increasing the minimum transmission line delay parameter in the spice_model_spec file 
    i.e. include the lines:
min_delay
1E-11
 
    Maybe we could change the default value...
    
75  Incident field excitation of shielded twisted pair fails with the following:
1     # order for vector fit model
log          # frequency scale (log or lin)
1e2 1e9 100 # fmin fmax number_of_frequencies
use_xie
use_high_freq_Zt_model
no_s_xfer

:Singular matrix error

Also fials with:

1     # order for vector fit model
log          # frequency scale (log or lin)
1e2 1e9 100 # fmin fmax number_of_frequencies
no_Xie
use_high_freq_Zt_model
no_s_xfer

0     # order for vector fit model
log          # frequency scale (log or lin)
1e2 1e9 100 # fmin fmax number_of_frequencies
use_high_freq_Zt_model
use_Xie
no_s_xfer

Ithink it may be that the fixed topology equivalent circuit used cannot deal with a pole at zero frequency...

76  We see a failure (singular matrix error in ngspice) if we set the two transfer impedance coupling directions to +1 in the test case: ZT_TWIN_COAX_INCIDENT_FIELD_EXCITATION_USE_XIE.
DONE: fixed 12/6/2017


