Skip to content Skip to navigation

Connexions

You are here: Home » Content » Matrix Methods for Electrical Systems

Navigation

Content Actions

  • Download module PDF
  • Add to ...
    Add the module to:
    • My Favorites
    • A lens
    • An external social bookmarking service
    • My Favorites (What is 'My Favorites'?)
      'My Favorites' is a special kind of lens which you can use to bookmark modules and collections directly in Connexions. 'My Favorites' can only be seen by you, and collections saved in 'My Favorites' can remember the last module you were on. You need a Connexions account to use 'My Favorites'.
    • A lens (What is a lens?)

      Definition of a lens

      Lenses

      A lens is a custom view of Connexions content. You can think of it as a fancy kind of list that will let you see Connexions through the eyes of organizations and people you trust.

      What is in a lens?

      Lens makers point to Connexions materials (modules and collections), creating a guide that includes their own comments and descriptive tags about the content.

      Who can create a lens?

      Any individual Connexions member, a community, or a respected organization.

    • External bookmarks
  • E-mail the author

Recently Viewed

Matrix Methods for Electrical Systems

Module by: Doug Daniels

Summary: This module introduces matrix algebra as a tool for solving multivariable problems. Setting up a model for a nerve cell, we use matrices to simply express the electrical properties of the nerve cell, and utilize matrix algebra to solve for the potential differences across nodes and axial and membrane current. By working several examples, we also introduce and reinforce a general problem modeling methodology, and demonstrate the usefulness of matrix algebra for realizing a solution to these problems.

Nerve Fibers and the Strang Quartet

We wish to confirm, by example, the prefatory claim that matrix algebra is a useful means of organizing (stating and solving) multivariable problems. In our first such example we investigate the response of a nerve fiber to a constant current stimulus. Ideally, a nerve fiber is simply a cylinder of radius aa and length ll that conducts electricity both along its length and across its lateral membrane. Though we shall, in subsequent chapters, delve more deeply into the biophysics, here, in our first outing, we shall stick to its purely resistive properties. The latter are expressed via two quantities:

  1. ρ i ρ i , the resistivity in cm cm of the cytoplasm that fills the cell, and
  2. ρ m ρ m , the resistivity in cm 2 cm 2 of the cell's lateral membrane.

Figure 1
A 3 compartment model of a nerve cell
A 3 compartment model of a nerve cell (cell.png)

Although current surely varies from point to point along the fiber it is hoped that these variations are regular enough to be captured by a multicompartment model. By that we mean that we choose a number NN and divide the fiber into NN segments each of length lN l N . Denoting a segment's

Definition 1: axial resistance
R i = ρ i lNπa2 R i ρ i l N a 2
and
Definition 2: membrane resistance
R m = ρ m 2πalN R m ρ m 2 a l N
we arrive at the lumped circuit model of Figure 1. For a fiber in culture we may assume a constant extracellular potential, e.g., zero. We accomplish this by connecting and grounding the extracellular nodes, see Figure 2.

Figure 2
A rudimentary circuit model
A rudimentary circuit model (cell2.png)

Figure 2 also incorporates the exogenous disturbance, a current stimulus between ground and the left end of the fiber. Our immediate goal is to compute the resulting currents through each resistor and the potential at each of the nodes. Our long--range goal is to provide a modeling methodology that can be used across the engineering and science disciplines. As an aid to computing the desired quantities we give them names. With respect to Figure 3, we label the vector of potentials x= x 1 x 2 x 3 x 4 x x 1 x 2 x 3 x 4 and the vector of currents y= y 1 y 2 y 3 y 4 y 5 y 6 . y y 1 y 2 y 3 y 4 y 5 y 6 . We have also (arbitrarily) assigned directions to the currents as a graphical aid in the consistent application of the basic circuit laws.

Figure 3
The fully dressed circuit model
The fully dressed circuit model (cell3.png)

We incorporate the circuit laws in a modeling methodology that takes the form of a Strang Quartet:

  • (S1) Express the voltage drops via e=-Ax e A x .
  • (S2) Express Ohm's Law via y=Ge y G e .
  • (S3) Express Kirchhoff's Current Law via ATy=-f A y f .
  • (S4) Combine the above into ATGAx=f A G A x f .

The AA in (S1) is the node-edge adjacency matrix -- it encodes the network's connectivity. The GG in (S2) is the diagonal matrix of edge conductances -- it encodes the physics of the network. The ff in (S3) is the vector of current sources -- it encodes the network's stimuli. The culminating ATGA A G A in (S4) is the symmetric matrix whose inverse, when applied to ff, reveals the vector of potentials, xx. In order to make these ideas our own we must work many, many examples.

Example

Strang Quartet, Step 1

With respect to the circuit of Figure 3, in accordance with step (S1), we express the six potential differences (always tail minus head) e 1 = x 1 - x 2 e 1 x 1 x 2 e 2 = x 2 e 2 x 2 e 3 = x 2 - x 3 e 3 x 2 x 3 e 4 = x 3 e 4 x 3 e 5 = x 3 - x 4 e 5 x 3 x 4 e 6 = x 4 e 6 x 4 Such long, tedious lists cry out for matrix representation, to wit e=-Ax e A x where A=-11000-1000-11000-1000-11000-1 A -1100 0-100 0-110 00-10 00-11 000-1

Strang Quartet, Step 2

Step (S2), Ohm's Law, states:

law 1: Ohm's Law

The current along an edge is equal to the potential drop across the edge divided by the resistance of the edge.

In our case, y j = e j R i ,   j=1 , 3 , 5   and   y j = e j R m ,   j=2 , 4 , 6 y j e j R i ,   j 1 , 3 , 5   and   y j e j R m ,   j 2 , 4 , 6 or, in matrix notation, y=Ge y G e where G=1 R i 0000001 R m 0000001 R i 0000001 R m 0000001 R i 0000001 R m G 1 R i 0000 0 0 1 R m 0000 00 1 R i 000 000 1 R m 00 0000 1 R i 0 0000 0 1 R m

Strang Quartet, Step 3

Step (S3), Kirchhoff's Current Law, states:

law 2: Kirchhoff's Current Law

The sum of the currents into each node must be zero.

In our case i 0 - y 1 =0 i 0 y 1 0 y 1 - y 2 - y 3 =0 y 1 y 2 y 3 0 y 3 - y 4 - y 5 =0 y 3 y 4 y 5 0 y 5 - y 6 =0 y 5 y 6 0 or, in matrix terms By=-f B y f where B=-1000001-1-1000001-1-1000001-1   and   f= i 0 000 B -1000 00 1-1-10 00 001-1 -10 0000 1-1   and   f i 0 0 0 0

Strang Quartet, Step 4

Looking back at AA: A=-11000-1000-11000-1000-11000-1 A -1100 0-100 0-110 00-10 00-11 000-1 we recognize in BB the transpose of AA. Calling it such, we recall our main steps

  • (S1) e=-Ax e A x ,
  • (S2) y=Ge y G e , and
  • (S3) ATy=-f A y f .
On substitution of the first two into the third we arrive, in accordance with (S4), at
ATGAx=f . A G A x f . (1)
This is a system of four equations for the 4 unknown potentials, x 1 x 1 through x 4 x 4 . As you know, the system Equation 1 may have either 1, 0, or infinitely many solutions, depending on ff and ATGA A G A . We shall devote (FIX ME CNXN TO CHAPTER 3 AND 4) to an unraveling of the previous sentence. For now, we cross our fingers and `solve' by invoking the Matlab program, fib1.m .

Figure 4
Results of a 64 compartment simulation
Results of a 64 compartment simulation (fib1_fig1.png)
Figure 5
Results of a 64 compartment simulation
Subfigure 5.1Subfigure 5.2
Results of a 64 compartment simulation, Subfigure 5.1 (fib1_fig2.png)Results of a 64 compartment simulation, Subfigure 5.2 (fib1_fig3.png)

This program is a bit more ambitious than the above in that it allows us to specify the number of compartments and that rather than just spewing the xx and yy values it plots them as a function of distance along the fiber. We note that, as expected, everything tapers off with distance from the source and that the axial current is significantly greater than the membrane, or leakage, current.

Example

We have seen in the previous example how a current source may produce a potential difference across a cell's membrane. We note that, even in the absence of electrical stimuli, there is always a difference in potential between the inside and outside of a living cell. In fact, this difference is the biologist's definition of `living.' Life is maintained by the fact that the cell's interior is rich in potassium ions, K + K + , and poor in sodium ions, Na + Na + , while in the exterior medium it is just the opposite. These concentration differences beget potential differences under the guise of the Nernst potentials:

Definition 3: Nernst potentials
E Na =RTFlog [Na] o [Na] i   and   E K =RTFlog [K] o [K] i E Na R T F [Na] o [Na] i   and   E K R T F [K] o [K] i where RR is the gas constant, TT is temperature, and FF is the Faraday constant.
Associated with these potentials are membrane resistances ρ m , Na   and   ρ m , K ρ m , Na   and   ρ m , K that together produce the ρ m ρ m above via 1 ρ m =1 ρ m , Na +1 ρ m , K 1 ρ m 1 ρ m , Na 1 ρ m , K and produce the aforementioned rest potential E m = ρ m E Na ρ m , Na + E K ρ m , Na E m ρ m E Na ρ m , Na E K ρ m , Na

With respect to our old circuit model, each compartment now sports a battery in series with its membrane resistance, as shown in Figure 6.

Figure 6
Circuit model with resting potentials
Circuit model with resting potentials (cell4.png)

Revisiting steps (S1-4) we note that in (S1) the even numbered voltage drops are now e 2 = x 2 - E m e 2 x 2 E m e 4 = x 3 - E m e 4 x 3 E m e 6 = x 4 - E m e 6 x 4 E m We accommodate such things by generalizing (S1) to:

  • (S1') Express the voltage drops as e=b-Ax e b A x where bb is the vector of batteries.
No changes are necessary for (S2) and (S3). The final step now reads,
  • (S4') Combine (S1'), (S2), and (S3) to produce ATGAx=ATGb+f A G A x A G b f .

Returning to Figure 6, we note that b=- E m 010101       and       ATGb= E m R m 0111 b E m 01 01 01       and       A G b E m R m 01 11 This requires only minor changes to our old code. The new program is called fib2.m and results of its use are indicated in the next two figures.

Figure 7
Results of a 64 compartment simulation with batteries
Results of a 64 compartment simulation with batteries (fib2_fig1.png)
Figure 8
Results of a 64 compartment simulation with batteries
Subfigure 8.1Subfigure 8.2
Results of a 64 compartment simulation with batteries, Subfigure 8.1 (fib2_fig2.png)Results of a 64 compartment simulation with batteries, Subfigure 8.2 (fib2_fig3.png)

References

  1. G. Strang,. (1986). Introduction to Applied Mathematics. Wellesley-Cambridge Press.

Comments, questions, feedback, criticisms?

Send feedback