• Aucun résultat trouvé

Finite Differences

The one dimensional approximation is extremely efficient, since is is basically a scan through the list of tiles. For irregular shapes, however, it can produce a poor estimate of the resistance. Two other approaches, finite differences and finite elements, are often used when greater accuracy is needed. This section describes finite differences, which are simple to implement and adequate for some problems, while the next section describes the more powerful (and complicated) finite element method.

If the Taylor Series for the voltage is expanded around the point( x;y) , it can be used to estimate the values at ( x+1x;y) and ( x01x;y) .

V( x+1x;y) =V( x;y) +1x

@V

@x

+1x

2@2

V

@x

2 +1x 3@3

V

@x

3 +111 ( 9)

V( x01x;y) =V( x;y) 01x

@V

@x

+1x

2@2

V

@x

2 01x 3@3

V

@x

3 +111 ( 10) If these two equations are added, all the odd powers of1x cancel out. By rearranging this sum and neglecting all even terms higher than second order, we get an equation for the second partial derivative with respect to x:

@ two equations are added, the result is an approximation for Laplace’s equation in two dimensions:

Rearranging Equation 12 gives an approximation for V( x;y) in terms of its four neighbors, V( x01x;y) ,V( x+1x;y) , V( x;y01y) , and V( x;y+1y) . If the region is covered with a rectilinear mesh, as shown in Figure 12, then the voltage distribution can be calculated by solving the system of linear equations relating the mesh node potentials to one another. In this derivation, the distances between mesh points in a given direction (1x and 1y are constants), but an equivalent expression for a nonuniform node distribution may be derived in the same manner; the only difference is that Equation 10 must be scaled by the ratio of the mesh spacings so that the first derivative terms will still cancel one another[22].

While Equation 13 is clearly true for points in the interior of the mesh, it must be modified for points along the boundary. For points on a conducting edge, the potential is fixed at Vc, the edge’s potential. For points along an insulating edge, the boundary condition requires than the normal current be 0. This can be achieved by mirroring the voltage about the edge:

V( x;y) =

21y2V(x+1x;y)+1x

2

(V(x;y+1y) +V(x;y01 y))

21x2+21y2 leftedge ( 14)

Figure 12: Finite Difference Mesh

V( x;y) =

21y2V(x01x;y)+1x2(V(x;y+1y) +V(x;y01 y))

21x2+21y2 rightedge ( 15)

V( x;y) = 1y

2

(V(x+1x;y)+V(x01x;y))+221xV(x;y+1 y)

21x2+21y2 bottomedge ( 16)

V( x;y) = 1y

2

(V(x+1x;y)+V(x01x;y))+221xV(x;y01y)

21x2+21y2 topedge ( 17)

For convex corners, the voltage is mirrored in both directions.

These equations give the potential for discrete points in the region; the next step is to convert this system of equations into a corresponding resistance network. Surprisingly, a resistance network can be produced without explicitly calculating all the voltages interior to the region. The next two sections describe an efficient method for performing the conversion: the finite difference grid is represented as a mesh of resistors, which can be transformed directly into the desired resistor network.

2.4.1 Physical Analogs of Finite Differences

Just as the discrete finite difference equation was formulated to approximate to the con-tinuous Laplace Equation, a discrete resistor network can be formulated to approximate the continuous resistive region. Consider the resistor network of Figure 13. Applying Kirchoff’s Current Law at node V( x;y) gives:

Gx

Figure 13: Lumped Analog of Finite Difference Equations

V( x;y) = two are identical. The solution is not unique, however; any values of Gxand Gythat have the same ratio Gy=Gx=1x2=1y2 will produce the same voltage distribution. With this in mind, we can pick conductance values that also produce the correct current distribution.

Equations 19 and 20 give the discrete approximations for the current density.

J If1x and1y are small, then Jxand Jywill be essentially constant across the rectangle and the integral of Equation 2 will just be the current density times the cross-sectional area. For a region of thickness t:

I

I an intuitive feeling understanding of finite difference analysis. A region is broken into a set of small rectangles, each of which is replaced by a simplified resistor network. This network can then be solved and replaced by an equivalent network that does not contain the interior portion of the mesh.

2.4.2 Solving the Equations

Once the equations have been formulated and modified to account for the various bound-ary conditions, the resulting system must be solved. Any algorithm for solving sparse, positive definite matrices may be used here, including Successive Overrelaxation (Section 5.5.2) and Cholesky Decomposition (Section 5.5.1), but significant performance advan-tages can be obtained by using the node elimination approach of Harbour and Drake[22].

As noted in the previous section, a finite difference formulation produces a mesh of lumped resistors, as does the entire extractor; instead of applying a test voltage to each boundary in succession, node elimination simply transforms the finite difference network into the desired network. To do this, the conductance matrix is first partitioned into two sections: one containing the set of nodes e that are to be retained and the other the set of nodes ithat are to be removed.

G= Since there is no current injected into the internal nodes, Ii = 0, and the equations can be rewritten and solved forVe:

G

Rearranging Equation 27 and substituting it into 26 gives an equation forVe alone: The term in parenthesis in Equation 29 is an equivalent conductance matrix G0ee that relates the boundary nodes and voltages without calculating the internal values; it is the same matrix that would be produced by applying a test voltage to each edge in turn and measuring the currents flowing to all the other edges. The conductance matrix for the entire system could be constructed using this equation, but inverting Gii would be very expensive because it is nearly as large as G. Instead, Equation 29 can be applied to individual nodes as they are created.

G1

Figure 14: Node Elimination

Consider a node N0 that connects to n other nodes, shown in Figure 14a for n =4.

This node can be eliminated by applying Equation 29. The inverse matrix G0ii1 is the inverse of the sum of all the conductors connecting to the node, and Gei and Gie are just

the row and column vectors containing the values of G1111Gn. Multiplying these terms gives the value for a new resistor Gij in terms of the old ones.

G

ij

( ne w ) =G

ij

( ol d) + G0iG0j

G

T

( 30)

G

T

= n

X

k =1

G

k

( 31) Once all the resistor analog elements connecting to an internal point have been cal-culated, this formula can be applied to eliminate the node. Internal nodes can thus be eliminated as they are created; if the order in which nodes are processed is chosen care-fully, this algorithm will be considerably faster and will use less memory than would creating the entire matrix and then solving it. Section 2.6 describes an implementation of this algorithm.