***********************Brain Teasers :  Notes Made by Jatin Vikram Singh, IIT Kanpur, India.***************************

1) The value of the datum node is 1 but the output file has that as 0. Why ?

Because the netlist file has the ground node at 0. So 0 is the ground node.

2) The code has the jacobians manually written. Is it possible that this has created the maximum errors ?
Try and find a universal way to generate the Jacobian if possible or else write down the jacobian for each compoenent and 
try and figure out the errors that come out.

Professor mentioned that the Jacobians were manually done. Can I make the code work universally for any circuit

3) Try and integrate the matlab code with the Visual C++ code that has been created. Search for the dll linking and other possible options.

4)  Does the Order of F() equations matter because the order for 6 and 5 is opposite.

Eric has not thought any further. He has just continued the work that had been created. Try and look for options not even thought.

Optimise the code, remove the repetitions and try and make it more universal.


4) The code contains error in printing the equations for the zero node. check the error. We actually dont need this equation. It's redundant.
F(7) is printed 2 times without any reason. Check why.

Jacobian related issues : 

The coode has missing jacobians. Make them 0 but print them. And check the jacobian for the floating sources. Also, check
the existing jacobians. Need to be cross checked.


THIS SOLUTION HAS THE EQUATIONS NUMBERED RANDOMLY, NOT ACCORDING TO THE NODES THEY ARE ATTACHED TO.


*****************************************************Erics Documentation************************************************
First alterations in the file: "parser_adyess_with_changes\parser.h"

line: 4
Error message: fatal error: iostream.h: No such file or directory
Original: #include <iostream.h>
Changed to: #include <iostream>
Comments: removed extension .h

line: 5
Error message: fatal error: fstream.h: No such file or directory
Original: #include <fstream.h>
Changed to: #include <fstream>
Comments: removed extension .h

Line: 62
Error message: error: extra qualification 'Component::' on member 'specialPrintJac' [-fpermissive]|
Original: void Component::specialPrintJac( ofstream &outFile, int datum, Node* wrt );
Changed to: void specialPrintJac( ofstream &outFile, int datum, Node* wrt );
Comments: removed qualification Component. Unnecessary since such method is a member of Component class.

Line: 66
Error message: error: extra qualification 'Component::' on member 'getNodeNum' [-fpermissive]|
Original: int Component::getNodeNum( int conNum );
Changed to: int getNodeNum( int conNum );
Comments: removed qualification Component. Unnecessary since such method is a member of Component class.

Line: 1115
Error message: error: no 'Connections* Node::getConList()' member function declared in class 'Node'|
Original: 
Changed to: Connections* getConList(); (added in line 86)
Comments: There was not the declaration, in class Node, of the method Connections* Node::getConList(). Added declaration 'Connections* getConList(); 

Line: 73
Error message: -- Logical error, no compilation error. Then No message error.




Original:   
// process equation types:
  if ( eqNum != NA ){
    while( (eqNum != 1) && (eqNum != 2) ){

Changed to: 
// process equation types:
  if ( eqNum == NA ){
    while( (eqNum != 1) && (eqNum != 2) ){

Comments: In this part of the code its necessary verify if the variable eqNum, that indicate the equation types [Nodal (1) or Modified Nodal (2)], is 1 or 2. 1 = Nodal; 2 = Modified Nodal.
If the user have not provided this input, the variable eqNum remain with its original value, that is, NA (NA is -1). Therefore, the condition in the if statement must be eqNum == NA and not eqNum != NA, since it is necessary to know if the user have provided the equation type (1 or 2). If the user have not provided the equation, type eqNum is equal NA. Therefore it is necessary, in this point, request the user enter with the equation type.

Line: 283

/* ~> J. Erik Melo note: A component can have until 4 connectors. But here just 3 are been considered. Is it a Error?! The condition should be changed to 'b <= 3' or 'b < 4'?*/


**********Content taken from the PDF created that shows the errors corrected by Eric***********

When a Modified Nodal Analysis is performed the output is not in the correct
format. For each voltage source (not floating) it is necessary add manually the
jacobian of that voltage source, that is, the jacobian of the node that the source is
connected in, for each unknown current.

 This problem was figured out by modifying the speciaPrintJac() function, member
of Component class, to print these missing jacobians.

Another problem was related to the Floating sources, that are the sources not connected
to the ground (or reference node). This kind of source is not common in
practical circuits, but they are important in theoretical analysis.

 In the Nodal Analysis, the parser did not print the supernode equations for each
floating voltage source and its jacobian as well.

 A new function, member of Component class, named printSuperNode(), was included
to figure out the problem with the missing equations. This function prints
the supernodal equation for each floating voltage source in the circuit.

 One more problem that was figured out was about errors in the jacobians print
for modified nodal equations. Sometimes, in the case of floating sources, the
jacobians were -1 or 1 when it is suppose to be 0.

In additional, two functions that print the list of components and nodes of the
circuit with their respective connections were created to make easier the maintenance of
the code.





Notes : Jatin Vikram Singh, Mitacs 2015

The edits I have done have not been done for the supernodeprint function as the floating voltages were never encountered in the cases I have used till now. The edits done have
been documented properly which should enable any future corrrections.
