From: Sidney M. <swm...@cs...> - 2018-01-22 20:55:01
|
Henry Baker, I'm still not sure what you are looking for. I have never heard of the expression "stamp". but it seems appropriate. Generally you need to use Kirchhoff's current law (the sum of the currents leaving any node is zero) and/or Kirchhoff's voltage law (the sum of the voltage drops around any loop is zero) and the component law, e.g., E = IR. Combining these in various ways leads to different formulations. You could write all of the equations noting that the sum of the currents into a node is zero, i = eg for each conductance, a current source injects current i into one node and minus that current into the other node. One then has an equation for each node and one for each component. Or (loop analysis) one could generate a spanning tree over all of the components (not using all components) and for every component not in the spanning tree assign an unknown independent current. This current will travel through the component not in the spanning tree and loop back to the other terminal of the component. Components in the spanning tree will see the sum of several currents. Then adding the equation e = ir for each component and the sum of the voltage drops around each loop is zero. There was also ThingLab, written in Smalltalk by Alan Borning, which used relaxation to solve the network equations. The voltage sources set the differences between some nodes. Then the voltage for the other nodes was adjusted upwards if there was a net current flowing into it and downwards if there was a net current flowing out of it. This process was iterated until steady state was achieved but electrical networks were also considered. The example used was that of a bridge with a weight attached to the center. There was a graphical interface so you could watch the bridge deform as the equations were relaxed. Reference: Alan Borning, "Thinglab -- A Constraint-Oriented Simulation Laboratory", SSL-79-3, XEROX also available as a Ph.D. thesis submitted to the Department of Computer Science at Stanford University or Stanford Computer Science Department Report STAN-CS-79-746. --Sidney Marshall ------------------------------------------ On Mon, 22 Jan 2018, Henry Baker wrote: > 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 > > |