Electronic Circuit Analyzer for the TI-85. Version 1 Programmed by: Pedro E. Gomez Since I got many requests for this program I decided to release it to all of GRAPH-TI. CSIM is an electronic circuit analyzer. The only two electronic components supported in this version is the impedance and the current source. If you have a voltage source on your circuit, you are just going to need a source transformation. CSIM will allow for entry of as many current sources and impedances as you want (actually you are limited to the amount of memory available on your TI). I am working on adding voltage source definitions - that version will be released later. This program uses the following variables [GM] Conductive Matrix [IM] Current Vector i,j,v variables Although the size of the CSIM program is about 500 bytes, the variables can use most of your available memory depending on the number of nodes defined in the circuit to be analyzed. Since the TI will allow for matrix and vector size allocations on the fly, CSIM will swallow kilobytes of memory for its use, and then release them when the program is finished (NO, I did not find a way to delete the variables, the GM matrix is made into a real variable when the program is finished). This redimensioning allows for the variables to occupy as much memory as you have, and then, when the program is done these variables will only take about 70 bytes for the four reals, and several hundred for IM, which at the end will contain the voltages. Currently you can only find voltages, but CSIM is still of great help and use. Any type of impedances are allowed: resistive (real) or reactive (imaginary), and of course both (complex). Real or imaginary current sources can be defined. The circuit is defined in almost the same fashion that circuit components are defined in SPICE, with the difference that CSIM is interactive. SEVERAL RULES FOR CIRCUIT DEFs. 1. Node 0 is ALWAYS ground, and is ALWAYS used. 2. When asked for the number of nodes, node 0 should not be included in the count; i.e. if you have defined nodes 0,1,2,3,4 then the number of nodes is 4. 3. If the largest node defined is n, then nodes 1 though n must also be defined; i.e. no node numbers may be skipped. 4. Complex values are always entered in the same fashion that other TI functions use them - your choice of rectangular or polar. 5. If you do not follow any of these rules, the TI will complain, or just give wrong answers. EXAMPLES The only way that I can further explain the use of CSIM is with simple examples. EXAMPLE 1. What is the impedance of the following circuit (w=1000rad/s) +--100ohm--+ ---+ +--10ohm--10uF-- +---50mH---+ To solve, define a dummy current source of 1A (just another EE trick), then define the circuit as follows. I1 1 0 1 ;Source #1; (+) on node 1 other on ground Z1 1 2 100 ;resistor between nodes 1 and 2, ;it doesn't matter which node is first. Z2 1 2 (0,50) ;Inductor between nodes 1 and 2, ;it doesn't matter which node is first. ;the (0,50) is because of jwL Z3 2 3 10 ;resistor between nodes 2 and 3, ;it doesn't matter which node is first. Z4 3 0 (0,-100) ;Capacitor between nodes 3 and ground, ;it doesn't matter which node is first. ;the (0,-100) is because of -j/wC Since ground is not considered a node, there are only 3 nodes. Now just follow the menu to define the circuit (the circuit does not have to be defined in any particular order), if you make a mistake when defining the circuit, just press [OVER] on the menu to start from the beginning. Once the circuit is completely defined, press [GET V] and the voltage vector will be computed, this voltage vector (which also resides in vector IM) contains the voltage on node 1 as the first entry in the vector, voltage on node 2 as the second entry in the vector and so on. If you defined the above properly, CSIM should give the following complex "voltages" (If your TI mode is set to rectangular coordinates) [(30,-60) (10,-100) (0,-100)] which is interpreted as follows, the voltage at node one is (30,-60) the voltage at node two is (10,-100) the voltage at node three is (0,100). Incidently, the total impedance of the circuit is numerically the same as the "voltage" on node 1, that is Z=30-j60 ohm. EXAMPLE 2. What is the voltage between points a and b on the following circuit. a +--22ohm--+--30ohm--+ --> | | | +--5A source--+ 60ohm +--1ohm--+ | | | | | | +---4ohm--+--10ohm-- | | b | = = DEFINE THE CIRCUIT AS FOLLOWS (or any way you like) Here point a is defined as node 2 and b as node 3. z1 1 2 22 z2 1 3 4 z3 2 4 30 z4 2 3 60 z5 3 4 10 z6 4 0 1 i1 1 0 5 Note: 4 nodes With the above definition CSIM will return [60 38 44 5] Therefore since V at point a is 38 and V at point b is 44 the voltage between the points is 38 - 44 = -6 ENJOY, pg