home *** CD-ROM | disk | FTP | other *** search
/ HAM Radio 1 / HamRadio.cdr / circuit / dcnet / dcnetp.txt < prev   
Encoding:
Text File  |  1987-12-10  |  12.2 KB  |  310 lines

  1.                                       -1-
  2.  
  3.                       DCNET 1.0 by Albert E. Pistilli
  4.  
  5. DCNET is a linear DC network analysis program that can analyze circuits
  6. consisting of branch combinations of resistors, independent voltage and
  7. current sources and voltage controlled current sources. The limit of DCNET is
  8. 25 nodes and 50 branches. The voltage controlled current source counts for two
  9. branches.
  10.  
  11. The 4 types of branch models are illustrated as follows:
  12.  
  13.       Resistor (R)                     Voltage source (E)
  14.  
  15.          | To node                        | V+ node
  16.          |                                |
  17.          |                               RS
  18.         R                               + |
  19.          |                               E
  20.          |                              - |
  21.          | From node                      | V- node
  22.  
  23.  
  24.    Current source (I)          Voltage controlled current source (GM)
  25.       ________ __                           ______________To node
  26.      |        |   To node           V+|    |          |
  27.      |        |                       |    |          |
  28.      |        |                       |    |          |
  29.     I        RP                       RI  Id         RP
  30.      |        |                       |    |          |
  31.      |        |                       |    |          |
  32.      |________|__ From node         V-|    |__________|____From node
  33.  
  34. For the above illustrations, and the | and _ symbols represents a segment of
  35. wire. The transfer function for the voltage controlled current source is:
  36.  
  37.                        GM*[V+ - V-] = Id
  38.  
  39. In order to use DCNET, all independent nodes of the circuit must be
  40. consecutively numbered starting from number one. The choice of the node
  41. selected to be node one is arbitrary. The ground node must be zero, and the
  42. total number of nodes entered must not include the ground node. When a
  43. specific branch is selected, DCNET will prompt the user for all the elements
  44. shown in the branch illustrations. Branches are entered by specifying the two
  45. nodes across the branch and the value of the branch. When entering this data,
  46. separate it with a blank space using the space bar, don't use a comma. For
  47. resistors, either side may be specified as the From or To node. All voltage
  48. sources must have a resistor RS in series. DCNET will accept a minimum value
  49. of 1E-30 ohms for a grounded voltage source when an "ideal" source is desired.
  50. However, for a floating voltage source, very small values of RS can cause
  51. roundoff errors. Therefore, it is recommended that RS be limited to a minimum
  52. of approximately .02 ohms for floating sources.
  53.  
  54. The current sources have a resistor RP in parallel as illustrated previously.
  55. DCNET will accept a maximum value of 1E+30 ohms when an "ideal" current source
  56. is required. When specifying the independent current source I or the GM
  57. source, the current direction is specified by the From and To nodes. For the
  58. GM source, the V+ and V- nodes controlling Id require a resistor RI between
  59. them.  For the voltage source, V+ and V- nodes indicate the polarity.
  60.  
  61.                                                                DCNET -1.0
  62.  
  63.  
  64.  
  65.  
  66.                                       -2-
  67.  
  68.  
  69. When DCNET is run, it prompts the user for all necessary information. After
  70. the circuit has been entered, entering X (eXecute) will initiate analysis, and
  71. the program calculates the node voltages. Afterwards, DCNET allows the branch
  72. values to be changed by specifying the branch type (R,E,I or Gm), the new
  73. value and the branch location number. The branch location number was assigned
  74. by the program when the branch data was originally entered.
  75.  
  76. In order to model an NPN transistor, the voltage source (E) and voltage
  77. controlled current source (GM) are connected as follows:
  78.  
  79.               Base________                     ______________
  80.                           |                   |        |    Collector
  81.                         V+|                   | From   |
  82.                           |                   |        |
  83.                           RI                 Id       RP
  84.                           |                   |        |
  85.                         V-|                   | To     |
  86.                           |______RS_+_E_-_____|________|_____
  87.                              V+            V-               Emitter
  88.  
  89. The V+ and V- nodes near RI are the controlling voltages for the dependent
  90. current source Id, while the V+ and V- nodes near E and RS represent the
  91. polarity of the voltage source. Also, the dependent current source Id has the
  92. current flowing into the emitter. Set E=0.6 volts and RS to about .1 ohms to
  93. simulate the base to emitter voltage drop. For the GM source, it can be shown
  94. that GM = Hfe/RI. Let RI = Rbb, which is about 50 ohms for a low current
  95. transistor, and using the desired Hfe and the given formula, calculate GM. Let
  96. RP = 1/Hoe, this is usually in the range of 100K to 1Meg. For a PNP
  97. transistor, reverse the polarity of E, the current direction of Id and the
  98. polarity of the controlling voltage of the GM source.
  99.  
  100. For the operational amplifier model, the voltage controlled current source
  101. (GM) is used as follows:
  102.  
  103.          +Vin __________             _______________ Output voltage (Vout)
  104.                         |V+         |        |
  105.                         |           |To      |
  106.                         |           |        |
  107.                         RI         Id       RP
  108.                         |           |        |
  109.                         |           |From    |
  110.          -Vin __________|V-         |________|___
  111.                                                  |
  112.                                                  |
  113.                                                  To ground node (0)
  114.  
  115. For any operational amplifier, let RI equal the differential input
  116. resistance (Rd) and RP equal the output resistance (Rout). It can be shown
  117. that the DC differential voltage gain Vout/[V+ - V-] = GM*Rout. For the uA741
  118. opamp, the typical DC specifications are Rd = 2 Meg, Rout = 75 and
  119. differential gain = 200,000. Therefore, use the gain formula and solving for
  120. GM = 200,000/75 = 2667, enter this value of GM in the opamp model to get the
  121. proper voltage gain. The differential inputs for the amplifier are represented
  122. by +Vin and -Vin, and the amplifier output is Vout.
  123.  
  124.  
  125.  
  126.                                                                     DCNET -1.0
  127.  
  128.  
  129.  
  130.                                       -3-
  131.  
  132. A simple example using a uA741 operational amplifier is illustrated below.
  133. This circuit has a feedback path split in a "T" formation and a +1 volt input.
  134.  
  135.  
  136.  
  137.                                     560K              560K
  138.  
  139.                           ________/\/\/\____________/\/\/\_
  140.                          |                      |          |
  141.                          |                      /          |
  142.                          |                      \ 560K     |
  143.                          |                      /          |
  144.                          |                      |          |
  145.                          |                     Ground      |
  146.                 560K     |                                 |
  147.           ____/\/\/\_____|_________*********               |
  148.           |                   -Vin *       *_______________|__
  149.           |                        * uA741 *  Vout
  150.         +1 volt             _______*       *
  151.           |                |  +Vin *********
  152.           |                |
  153.          Ground           Ground
  154.  
  155. In order to enter the above circuit into DCNET, we must add the expanded uA741
  156. model. The nodes numbers are shown in parenthesis. This is illustrated as
  157. follows:
  158.  
  159.                                     560K              560K
  160.                           ________/\/\/\____________/\/\/\_
  161.                          |                 (3)  |          |
  162.                          |                      \          |
  163.                          |                      / 560K     |
  164.                          |                      \          |
  165.                          |                      |          | (4)
  166.                          |                     Ground (0)  |
  167.                          |                                 |
  168.                 560K     |                                 |
  169.        (1) ___/\/\/\_____|_________         _______________|__ Vout
  170.           |            (2)    -Vin |-V     |        |
  171.         +1 volt                    RI      |To      |
  172.           |                 _______|+V    Id        RP
  173.           |                |  +Vin         |From    |
  174.           |                |               |________|__
  175.           |                |                          |
  176.          Ground (0)       Ground (0)                 Ground (0)
  177.  
  178. In this example, the lowest numbered node (1) is at the left and the nodes are
  179. consecutively numbered moving to the right. Although desirable, it isn't
  180. necessary to number the nodes in this fashion. For example, the nodes labeled
  181. (1) and (3) may be interchanged and the circuit reentered without problems.
  182. However, you can't define any node with a number whose value is greater than
  183. the total number of nodes in the circuit. In other words, since the above
  184. circuit has a total of four nodes, no node may be defined with the number 5 or
  185. above.
  186.  
  187. The DCNET run for the above circuit is shown below with the user entering all
  188. information to the right of the colon. The program echos back the data just
  189. entered and assigns a branch location number. After initiating analysis by
  190.  
  191.                                                                     DCNET -1.0
  192.  
  193.  
  194.                                       -4-
  195.  
  196. entering X, the results are printed out and the program then allows the branch
  197. values to be changed. In this run, the value of GM was reduced to 1333. After
  198. the change, DCNET prompts the user again if additional changes to the circuit
  199. are desired. If not, the analysis begins.
  200.  
  201.  
  202. Enter number of nodes: 4
  203.  
  204. Enter R,E,I,Gm or eXecute: E
  205. Enter E in volts,RS,V+,V- nodes: 1 .0001 1 0
  206. E= 1 RS= .0001 V+= 1  V-= 0  Branch= 1
  207.  
  208. Enter R,E,I,Gm or eXecute: ? R
  209. Enter R in Ohms, From, To nodes: 560E3 1 2
  210. R= 5.600E+05 From node= 1 To node= 2  Branch= 2
  211.  
  212. Enter R,E,I,Gm or eXecute: R
  213. Enter R in Ohms, From, To nodes: 560E3 2 3
  214. R= 5.600E+05 From node= 2 To node= 3  Branch= 3
  215.  
  216. Enter R,E,I,Gm or eXecute: R
  217. Enter R in Ohms, From, To nodes: 560E3 0 3
  218. R= 5.600E+05 From node= 0 To node= 3  Branch= 4
  219.  
  220. Enter R,E,I,Gm or eXecute: R
  221. Enter R in Ohms, From, To nodes: 560E3 4 3
  222. R= 5.600E+05 From node= 4 To node= 3  Branch= 5
  223.  
  224. Enter R,E,I,Gm or eXecute: G
  225. Enter GM in Mhos,RP,From,To nodes: 2667 75 0 4
  226. GM= 2667 RP= 75 From node= 0 To node= 4  Branch= 6
  227. Enter Rin,V+,V- : 2E6 0 2
  228. RI= 2.000E+06  V+=0  V-=2  Branch= 7
  229.  
  230. Enter R,E,I,Gm or eXecute: X
  231.  
  232. Node( 1 )=  1.0000E+00  Volt(s)
  233. Node( 2 )=  1.4999E-05  Volt(s)
  234. Node( 3 )=  -1.000E+00  Volt(s)
  235. Node( 4 )=  -3.000E+00  Volt(s)
  236.  
  237. Change branch value? Enter Yes or No: y
  238.  
  239. Enter Branch Type,New Value,Branch number: G 1333 6
  240. New Value of G is 1.333E+03 at Branch 6
  241. eXecute or Change another branch value? Enter X or C: X
  242.  
  243.  
  244. Node( 1 )=  1.0000E+00  Volt(s)
  245. Node( 2 )=  3.0008E-05  Volt(s)
  246. Node( 3 )=  -9.999E-01  Volt(s)
  247. Node( 4 )=  -3.000E-00  Volt(s)
  248.  
  249. Change branch value? Enter Yes or No: No
  250.  
  251. Program terminated
  252.  
  253.  
  254.  
  255.  
  256.                                                                     DCNET -1.0
  257.  
  258.                                       -5-
  259.  
  260. If you have any questions regarding DCNET, send them along with a self
  261. addressed stamped envelope to the address listed below. Your comments or
  262. suggestions on the program are welcome. Permission is given to freely copy
  263. this program. Future changes that will be added to later versions of DCNET
  264. include better error trapping and the addition of a diode branch.
  265.  
  266. HVCC ELT Dept.
  267. Vandenburgh Ave.
  268. Troy, New York 12180
  269.  
  270. Acknowledgment is given to R. Jensen and B. Watkins, authors of "Network
  271. Analysis -  Theory and Computer Methods".
  272.  
  273. NOTICE: This program is provided without warranties of any kind. The entire
  274. risk as to quality and performance of this program is with the user. Should
  275. the program prove defective, the user assumes the entire responsibility.
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295.  
  296.  
  297.  
  298.  
  299.  
  300.  
  301.  
  302.  
  303.  
  304.  
  305.  
  306.  
  307.  
  308.  
  309.  
  310.                                                                     DCNET -1.0