From: Henry B. <hb...@pi...> - 2018-01-22 14:20:08
|
Thanks, Sidney! Yes, what you are describing is what I have since learned is called "stamping" (?!?). I.e., the pattern: g -g -g g is the "stamp" for this element. Unfortunately, explaining stamping is too complicated and diverts attention from the main point; since I'm more interested in pedagogy than efficiency, I wanted a 1-1 correspondence between the trivial circuit and the matrix. I believe that this used to be called "nodal analysis". At 04:27 PM 1/21/2018, Sidney Marshall wrote: >Henry Baker, > >There are many ways to do this. The simplest is nodal analysis and assumes that the circuit consists of current sources and conductances (G = 1/R). Ohm's law is GE = I where G is the conductance, E is the voltage, and I is the current. > >Construct an n x n matrix for G, an n x 1 column vector E, and an n x 1 column vector I. If there is a conductance between node j and k add to the G matrix the pattern > >g -g > > >-g g > >for the jth and kth rows and columns. If there is a current source between nodes j and k add to the I column vector the pattern > >i > > >-i > >Now delete the last row and column from the G matrix and the last entry from the E and I vectors (otherwise the matrix G is singular) and call this (deleted) node the ground node. Solve the matrix equation GE = I for E. E is then the node voltages. > >Note that the pattern for each row calculates the voltage difference between nodes j and k and when multiplied by the conductance gives the current through the conductance. This is set equal to the current specified by the I vector. > >If you use complex admittance and complex currents (to specify phase) you can add capacitors and inductors. Capacitors are 2[pi]fiC and inductors are 1/2[pi]iL. > >Laplace transforms can be done by using g, sC, and 1/sL in the matrix - the right-hand side is then the Laplace Transform of the current source. > >You can also add voltage sources, inductors, transformers etc. by using different patterns. > >There is also loop analysis and hybrid analysis systems. > >Ask if you need more information. > >References: > >J. Vlach and K. Singhal, "Computer Methods for Circuit Analysis and Design", Applied Mathematical Sciences, Van Nostrand, New York (1984) - a really good book for this sort of thing > >Laurence W. Nagel, "SPICE2: A Computer Program to Simulate Semiconductor Circuits", Memorandum No. ERL-M520, Electronics Research Laboratory, College of Engineering, University of California, Berkeley 94720 (9 May 1975) - describes the inner workings of SPICE > >--Sidney Marshall >----------------------------------------- >On Fri, 19 Jan 2018, Henry Baker wrote: > >>Hi: >> >>I was looking for a trivial linear circuit analysis example for Maxima. >> >>I want to show how the circuit of R's, L's, and C's maps into a matrix. >> >>In particular, the matrix should "mirror" the topology of the circuit. >> >>Thanks in advance for any pointers. >> >>Henry Baker |