5.2.1 Mathematical Formulation
The detailed derivation and proof of the electrode boundary Jacobian (EBJ), which describes voltage changes caused by electrode boundary movement, is found in (Dardé et al., 2012), and a summary of the parts relevant for the implementation is given in section 2.2.8. Electrode boundary changes can be characterised byC1vector fieldsvon the electrode boundaries∂Em
and the measurement map including perturbed electrodes can then be considered as the operator R: (v, Id)−→Ud(v), Bb×RM −→RM. (5.1)
The Fréchet derivative with respect to the vector fieldvfulfils
M X m=1 R0(v, Id)mIma = − M X m=1 1 zm Z ∂Em (vτ ·n∂Em)(U d m−ud)(Uma −ua) ds, (5.2)
where vτ is the component ofvwhich is tangential toΓ,n∂E the outward normal of∂Em
which is tangential toΓand(ud, Ud)the solution to the unperturbed CEM forward problem corresponding to the drive currentId∈RM
. The adjoint field(ua, Ua)is the forward solution
to the unit measurement currentIa∈RM .
It is interesting to note, that the computation of the EBJ resembles the computation of the conductivity Jacobian using the adjoint field method (section 2.2.7), in that the results of ‘drive current’ and ‘measurement current’ injections are used. Therefore, the calculation of the EBJ does not require any additional forward simulations to those performed for the calculation of the traditional Jacobian matrix.
5.2.2 Implementation
To describe the movement of an electrode along the surface of a mesh, a surface coordinate system is required. On the human head mesh, a surface coordinate system[xs×ys]was created
as follows. Starting from the surface node with the largest y-coordinate (top of the head -(0,0) in figure 5.2), the algorithm moved along the surface in x- and z-direction and found surface nodes that were a defined distanced±εaway from the previous point, whereεwas chosen large
enough that surface nodes were found. Distancedwas chosen such that the surface coordinate
points were far enough from each other to describe the surface curvature without significant influence of the mesh discretisation. If no more surface nodes could be found that either fulfilled these requirements or were above a certain y-coordinate limit, thexs- andys-axis were defined
(a) (b)
Figure 5.1: Surface coordinate system on a 800k mesh with one refined electrode-(a)The discrete points of the surface coordinate system in red and(b)a10mm displacement of electrode number 30 along thexs-coordinate (arrow) seen as indicated by the box in (a).
the coordinates of all surface vertices within the area spanned byd±ε(figure 5.2). To describe
directions of movement for each electrode, the four closest surface coordinate points to that electrode were found (figure 5.1). A mapping back from surface coordinates to mesh nodes was not required. This approach had the advantage that the surface coordinate system could be stored together with the mesh and used for any electrode positions. The Jacobian matrix with respect to electrode radius was computed with a vector fieldvpointing from the electrode center to the center of each electrode boundary edge.
(1,$1)&& (0,0)& (0,$1)& ($1,0)& (1,0)&& ($2,0)& z& x& 2ε& d y& (xs,&ys)=(0,1)&& (0,$2)& (1,$2)&& ($1,$1)&& ($2,$1)&& ($1,$2)&& ($1,1)&&
Figure 5.2: Generation of the surface coordi- nate system- Starting from the top of the head (0,0), equispaced surface nodes within a tolerance
εwere found in x and z direction. The coordinates
of all surface nodes within this tolerance were aver- aged to define the surface coordinate system.
For small meshes, the electrode boundary Jaco- bian (EBJ) was calculated in Matlab using a modified version of Eidors (Adler and Lionheart, 2006). On the 4 million element mesh used for simulations, the EBJ was computed with Peits (chapter 4) in order to reduce computing time and memory requirements. The implementation was similar in Matlab and Peits: for each electrode, a sparse template matrix was con- structed to store the contributions of drive and mea- surement fields. For each injection and measurement electrode pair this template matrix could then be mul- tiplied by the electric potential fields of the drive and measurement currents to obtain theEBJentry for this electrode for this line of the protocol. The integral along the electrode boundary (5.2) can be decomposed into a sum of the integrals over each
element edgee, from nodei1to nodei2. To compute this integral, the drive and measurement
this implementation, Gauss-Lobatto quadrature with three points was used to approximate the integral along one edge. The Gauss-Lobatto weights on a unit interval were given asw1 = 1/6,
w2= 4/6andw3= 1/6, and therefore the integral along edgeecould be approximated as
1 |e| Z e (Umd −ud)(Uma −ua) ds≈ 1 6(U d m−udi1)(U a m−uai1) +4 6(U d m−udim)(U a m−uaim) + 1 6(U d m−udi2)(U a m−uai2). (5.3)
Since linear shape functions were used, the voltage at the midpointimwas given by uim =
1
2(ui1 +ui2). Calculating out and writing as a matrix vector multiplication, the right hand side
(5.3) can be written as f(de,ae) =d>e 1/3 1/6 −1/2 1/6 1/3 −1/2 −1/2 −1/2 1 ae,
with drive voltagesd>e = [udi1, udi2, Umd]>and adjacent voltagesa>e = [uai1, uai2, Uma]>. For the integral along one edge, the dot product of the outward normal and the permutation vector field, (v·ne), was kept fixed. Therefore, the electrode Jacobian entry for one electrode for one current
injection and voltage measurement electrode pair can be written as the sum of the integral approximations along all electrode boundary edges
EBJ(m,d,a) =X e −|e| zm|Γm| (ne·v)d>e 1/3 1/6 −1/2 1/6 1/3 −1/2 −1/2 −1/2 1 ae =d>Mtemp(m)a. (5.4)
Consequently, one sparse[N+M×N +M]template matrixMtempcould be created for each
electrode by summing the contributions of all electrode boundary edges into the corresponding indicesi1,i2andielec. N are the number of nodes in the mesh,M the number of electrodes
andRthe number of protocol lines (i.e. number of injections times number of measurements at
each injection). TheseMtemplate matrices could then be multiplied with all used combinations
ofd> = [ud,Ud]>anda> = [ua,Ua]>to obtain the[R×M]electrode boundary Jacobian with respect to vector fieldv.
Once the template matrices were set up for all electrodes, the drive and measurement (adjacent) fields to multiply them with were the same forward solutions that were required to compute the ‘traditional’ Jacobian matrix and therefore no additional forward solutions had to be computed. The computation of one line of theEBJtook on average 0.03 seconds for a 4m element mesh on ten processors using Peits, whereas one line ofJσ took around 0.1 seconds
to compute. The additional computation of theEBJ therefore had a minimal effect on the computation time.