Professional Documents
Culture Documents
INTRODUCTION
1. A matrix reordering method for reordering elements of a coefficient matrix whose structure corresponds tocoefficients Of linear simultaneous equations whose solutions areto be produced by parallel processing of processors of a computer in accordance with Gaussian elimination, said matrix reordering method comprising the steps of: based on a number of non-zero elements included in the coefficient matrix and an accumulative processing time of the Gaussian elimination of the coefficient matrix, determining a first combination of row and column and a second combination of row and column, which are selected from among rows and columns of the coefficient matrix; and performing replacement of elements between the first combination of row and column and the second combination of row and column within the coefficient matrix using the coefficient matrix for solving the linear simultaneous equations. 2. A matrix reordering method for reordering elements of a coefficient matrix whose structure corresponds to coefficients of linear simultaneous equations whose solutions are to be produced by parallel processing of processors of a computer inaccordance with Gaussian elimination, said matrix reordering method comprising the steps of: based on a number of non-zero elements included in the coefficient matrix and lengths of critical paths created by the Gaussian elimination of the coefficient matrix, determining a first combination of row and column and a second combination of row and column, which are selected from among rows and columns of the coefficient matrix; and performing replacement of elements between the first combination of row and column and the second combination of row and column within the coefficient matrix using the coefficient matrix for solving the linear simultaneous equations. 3. A matrix reordering method according to claim 1 or 2 further comprising the step of: in accordance with a prescribed condition, selectively performing either the replacement of elements between the first and second combinations of rows and columns or secondary replacement of elements between a third combination of row and column and a fourth combination of row and column, which are selected based on symmetry of the coefficient matrix. 4. A matrix reordering method according to claim 3 further comprising the step of: creating a symmetric coefficient matrix by transposition of a non-symmetric coefficient matrix that is given as the coefficient matrix, so that the secondary replacement is performed on elements of the symmetric coefficient matrix between the third and fourth combinations of rows and columns, which are selected based on symmetry of the symmetric coefficient matrix. 5. A matrix reordering apparatus for reordering elements of a coefficient matrix whose structure corresponds to coefficients of linear simultaneous equations whose solutions are to be produced by parallel processing of processors of a computer in accordance with Gaussian elimination, said matrix reordering apparatus comprising: a determining means for based on a number of non-zero elements included in the coefficient matrix and an accumulative processing time of the Gaussian elimination of the coefficient matrix, determining a first combination of row and column and a second combination of row and column, which are selected from among rows and columns of the coefficient matrix; and a replacing means for performing replacement of elements between the first combination of row and column and the second combination of row and column within the coefficient matrix wherein the apparatus is operable to use the coefficient matrix for solving the linear simultaneous equations. 6. A matrix reordering apparatus for reordering elements of a coefficient matrix whose structure corresponds to coefficients of linear simultaneous equations whose solutions are to be produced by parallel processing of processors of a computer in accordance with Gaussian elimination, said matrix reordering apparatus comprising: a determining means for based on a number of non-zero elements included in the coefficient matrix and lengths of critical paths created by the Gaussian elimination of the coefficient matrix, determining a first combination of row and column and a second combination
of row and column, which are selected from among rows and columns of the coefficient matrix; and a replacing means for performing replacement of elements between the first combination of row and column and the second combination of row and column within the coefficient matrix wherein the apparatus is operable to use the coefficient matrix for solving the linear simultaneous equations. 7. An electronic circuit simulation method using matrix reordering for reordering elements of a coefficient matrix that represents electronic elements of a given electronic circuit by linear simultaneous equations whose solutions are to be produced by parallel processing of processors of a computer in accordance with Gaussian elimination, said electronic circuit simulation method comprising the steps of: based on a number of non-zero elements included in the coefficient matrix and an accumulative processing time of the Gaussian elimination of the coefficient matrix, determining a first combination of row and column and a second combination of row and column, which are selected from among rows and columns of the coefficient matrix; and performing replacement of elements between the first combination of row and column and the second combination of row and column within the coefficient matrix using the coefficient matrix for solving the linear simultaneous equations. 8. An electronic circuit simulation method using matrix reordering for reordering elements of a coefficient matrix that represents electronic elements of a given electronic circuit by linear simultaneous equations whose solutions are to be produced by parallel processing of processors of a computer in accordance with Gaussian elimination, said electronic circuit simulation method comprising the steps of: based on a number of non-zero elements included in the coefficient matrix and lengths of critical paths created by the Gaussian elimination of the coefficient matrix, determining a first combination of row and column and a second combination of row and column, which are selected from among rows and columns of the coefficient matrix; and performing replacement of elements between the first combination of row and column and the second combination of row and column within the coefficient matrix using the coefficient matrix for solving the linear simultaneous equations. 9. An electronic circuit simulation method according to claim 7 or 8 further comprising the step of: in accordance with a prescribed condition, selectively performing either the replacement of elements between the first and second combinations of rows and columns or secondary replacement of elements between a third combination of row and column and a fourth combination of row and column, which are selected based on symmetry of the coefficient matrix. 10. An electronic circuit simulation method according to claim 9 further comprising the step of: creating a symmetric coefficient matrix by transposition of a non-symmetric coefficient matrix that is given as the coefficient matrix, so that the secondary replacement is performed on elements of the symmetric coefficient matrix between the third and fourth combinations of rows and columns, which are selected based on symmetry of the symm11. An electronic circuit simulation apparatus using matrix reordering for reordering elements of a coefficient matrix that represents electronic elements of a given electronic circuit by linear simultaneous equations whose solutions are to be produced by parallel processing of processors of a computer in accordance with Gaussian elimination, said electronic circuit simulation apparatus comprising: a determining means for based on a number of non-zero elements included in the coefficient matrix and an accumulative processing time of the Gaussian elimination of the coefficient matrix, determining a first combination of row and column and a second combination of row and column, which are selected from among rows and columns of the coefficient matrix; and a replacing means for performing replacement of elements between the first combination of row and column and the second combination of row and column within the coefficient matrix wherein the apparatus is operable to use the coefficient matrix for solving the linear simultaneous equations. 12. An electronic circuit simulation apparatus using matrix reordering for reordering elements of a coefficient matrix that represents electronic elements of a given electronic circuit by linear simultaneous equations whose solutions are to be produced by parallel processing of processors of a computer in accordance with Gaussian elimination, said electronic circuit simulation apparatus
comprising the steps of: a determining means for based on a number of non-zero elements included in the coefficient matrix and lengths of critical paths created by the Gaussian elimination of the coefficient matrix, determining a first combination of row and column and a second combination of row and column, which are selected from among rows and columns of the coefficient matrix; and a replacing means for performing replacement of elements between the first combination of row and column and the second combination of row and column within the coefficient matrix wherein the apparatus is operable to use the coefficient matrix for solving the linear simultaneous equations. 13. A matrix reordering method for reordering elements of a coefficient matrix created based on coefficients of linear simultaneous equations whose solutions are to be produced by parallel processing of processors of a computer in accordance with Gaussian elimination, said matrix reordering method comprising the steps of: selecting from among pivots included in the coefficient matrix a first pivot whose degree corresponding to a number of non-zero elements is under a threshold; selecting from among the pivots included in the coefficient matrix a second pivot whose critical path length is minimum; performing replacement of elements between the first pivot and the second pivot within the coefficient matrix; and adding new non-zero elements, which are newly produced by the Gaussian elimination of the first pivot, to the coefficient matrix using the coefficient matrix for solving the linear simultaneous equations. 14. A matrix reordering method according to claim 13 further comprising the step of: performing reordering of a partial matrix whose elements are not eliminated and are selected from among the elements of the coefficient matrix in accordance with a nested dissection method, so that non-zero elements, which are newly produced by the Gaussian elimination of the partial matrix, are added to the coefficient matrix. 15. A matrix reordering method according to claim 14 further comprising the step of: creating a symmetric coefficient matrix by transposition of a non-symmetric coefficient matrix that is given as the coefficient matrix, so that the reordering is performed on the symmetric coefficient matrix. 16. A matrix reordering method according to claim 14 wherein the reordering is started if a degree or a parameter of theMatrices Applied to Electric Circuits
3 I t o u t ntoMt ixAit mt nr d c io ar r h e ic
A m tr a ix is as t o r a o c mle n me s( r e f el r o p x u br o e mn ) a a g dinr w a dc lu n tof rm le e ts rr n e o s n o ms o a re ta g la a r y c n u r ra . A m tr a ix (r a ed a hv g s a in hv g a in od r re m r wad o s n m x n. n c lu n isa o ms n m xn m b no m c o s y r rs n) mtrixa disr f rr dto a n ee e
Wa i amt i ? ht s arx
Ae ta g l rar yo n mes( ewlc n e tr t o r c n ua r a f u b r w i o c n ae n l r a n mes . A e l u br ) n m mt i h s x ar x a c l ms ou n n r w a d os n m Fs r w ir t o Sc n r w eo d o T ir r w hd o
M3 4 x
M1 1 = M2 1 3 M 1
Fs ir t c lu n om
M1 2
M1 3
M2 2 M3 2
Sc n eo d c lu n om
M2 3 M3 3
T ir hd c lu n om
M1 4 M2 4 M3 4
F uth or c lu n om
M1 2
Rw u b r o n me Clu nn me o m u br
3 .2
M tr n ta n a ix o tio
E c e m n in a m trix h s its o n p rtic la a h le e t a a w a u r a d ss o lo a n w ich c n b d fin d b a d re r c tio h a e e e y sy mo d u le su e ste f o b ffix s: th first in ic te th e d a s e a dth n e se o d cn in ic te th d a s e c lu n , th s o m u
a11 a21 a31 a41
IT 1 1 D1 1
ro , w
a12 a13 a14 a22 a23 a24 a32 a33 a34 a42 a43 a44
M tr e a ic s Pg 4 ae
It took me a bit to figure this out, partly due to the fact of no really good explanation of it. So, I'm going to have a crack at it. Basically, I wanted to understand how keyboard matrices work. Specifically, I wanted to know why keyboard "ghosting" and "masking" happen, and how to prevent them. . This article may be reproduced in whole or in part, without fee, subject to the following restrictions: The copyright notice above and this permission notice must be preserved complete on all complete or partial copies. Any translation or derived work must be approved by the author in writing before distribution. If you distribute this work in part, instructions for obtaining the complete version of this manual must be included, and a means for obtaining a complete version provided. Small portions may be reproduced as illustrations for reviews or quotes in other works without this permission notice if proper citation is given. Exceptions to these rules may be granted for
academic purposes. Write to the author and ask. These restrictions are here to protect us as authors, not to restrict you as learners and educators.
Fundamentals Ohm's Law states the voltage across a resistor, R (or impedance, Z) is directly proportional to the current passing through it (the resistance/impedance is the proportionality constant)
Kirchhoff's Voltage Law (KVL): the algebraic sum of the voltages around any loop of N elements is zero (like pressure drops through a closed pipe loop)
Kirchhoff's Current Law (KCL): the algebraic sum of the currents entering any node is zero, i.e., sum of currents entering equals sum of currents leaving (like mass flow at a junction in a pipe)
s fixes the masking problem for the same reason, the diode stops the current.
This keyboard only has 4 keys: A, B, C, and D. Each key has a unique grid location, much like points on a graph. Key A is at node C1R1, key B is at node C2R1, key C is at node C1R2, and key D is at node C2R2. In reality this is pretty useless which is why real keyboards use many more rows and columns. However, I want to keep it simple. The electronic circuit for this matrix looks something (not exactly) like this:
Figure 2. Switch Open
Neither key A nor C are pressed, so neither row R1 nor R2 is activated. The controller now knows that both nodes C1R1 and C1R2 are deactivated. Then it activates column C2 and checks rows R1 and R2 again: Figure 4. Scanning Column 2
Neither key B nor D are pressed so neither row R1 nor R2 is activated. The controller now knows that both nodes C2R2 and C2R2 are deactivated.
Key A corresponds to node C1R1. By going back to the circuit, we can see how C1R1 is detected. First, here is the circuit with switch A closed: Figure 6. The A Switch is Closed
Walking through the scanning procedure again, the controller activates column C1 and detects which rows are activated: Figure 7. Row 1 is Activated
This time, row R1 is activated. So the controller now knows that node C1R1 is pressed. Since C1R1 corresponds to the A key, the controller knows that the A key is pressed. When the controller activates column C2, neither row R1 nor R2 are activated. Both switches B and D are open: Figure 8. Neither Row is Activated
When the A key is released, the circuit goes back to the original, and the controller detects the node C1R1 is no longer activated.
Both nodes C1R1 and C2R2 should be detected. Here is the circuit with both switches A and D closed: Figure 10. The A and D Switches are Closed
Scanning column C1 then column C2 produces an outcome like this: Figure 11. Row 1 is Activated
When column C1 is activated, row R1 is active, hence node C1R1 is activated. When column C2 is activated, row R2 is activated, hence node C2R2 is activated.
If everything goes well, nodes C1R1, C2R1, and C2R2 will be detected. Let's look at the circuit view again: Figure 14. The A, B, and D Switches are Closed
When activating column C1, the circuit now looks like this: Figure 15. Rows 1 and 2 are Activated
If you get the feeling something is not right, you are correct! This is where the ghosting problem comes to play. Row R1 is activated as well as row R2, so both nodes C1R1 and C1R2 are activated. Node C1R1 is expected as it corresponds to the A key that is pressed. However, node C1R2 corresponds to the C key. Switch C is open, so the key is not really pressed. The keyboard controller does not know this and incorrectly generates a C key press. What happens is that closing switch B and switch D at the same time creates an electrical path from C1 to R2, bypassing the open switch C. The keyboard does not know that switch C is open and generates a "ghost" key press. Ghosting will show up when any 3 corners of a rectangle in the matrix are pressed at once. In my simple example, any 3 keys causes ghosting, but in a bigger matrix only 3 corners of a rectangle cause it. Just for completion, here is the circuit when activating column C2: Figure 16. Rows 1 and 2 are Activated
As expected, nodes C2R1 and C2R2 are activated corresponding to the B and D keys.
Let's go back to the scenario where A, B, and D are pressed simultaneously. Activating columns C1 and C2 now look like this:
Figure 18. Only Row 1 is Activated
Voila! The diodes stop the current from flowing in the "wrong" direction back up switch B. When column C1 is activated, only node C1R1 is activated and C1R2 is not. Also, when column C2 is activated, both R1 and R2 as expected.
1. 2.
Label the nodal voltages. Apply KCL. a. KCL at top node gives IS = IL + IC b. Supernode constraint eq. of VL = VS
10. Conclusion
It's pretty simple: Use diodes in series with your switches! What kind of diodes, you may ask? Use 1N4148 switching diodes and you'll have no problems!
A tutorial on how mathema
tics, matrices in particular, are applied to model electric circuits. There are two closed loops in the above circuit. loop 1: e1, R1 and R3 and loop 2: e2, R2 and R3. e1 and e2 are sources of voltages. R1, R2 and R3 are resistors. i1 is the current flowing across R1 and i2 is the current flowing across R2. We now apply Kichhoff's law to each loop. loop 1: e1 = R1 i1 + R3 (i1 - i2) loop 2: e2 = R2 i2 + R3 (i2 - i1) Question: If e1, e2, R1, R2 and R3 are known, how do you calculate i1 and i2? This circuit is simple
involvesand only two equations. However electric cicuits can be much more complicated that the one above and matrices are suitable to answer the above question. Let us group like terms in the above system of equations e1 = i1 (R1 + R3) - i2 R3 e2 = - i1 R3 + i2(R2 + R3) and then write it in matrix form as follows
The above is a matrix equation that may be solved using any known method to solve systems of equations. Let e, R and i be matrices given by
www.stmarys.ca