An adaptive Newton algorithm for optimal control problems with application to optimal electrode design
Thomas Carraro, Simon D\"orsam, Stefan Frei, Daniel Schwarz

TL;DR
This paper introduces an adaptive Newton algorithm for nonlinear PDE-constrained optimization, balancing discretization and iteration errors with goal-oriented error estimation, demonstrated through efficient electrode design in neuroscience.
Contribution
It presents a novel adaptive Newton method that integrates goal-oriented error estimation for efficient PDE-constrained optimization.
Findings
Efficient balancing of discretization and iteration errors.
Local mesh refinement improves computational efficiency.
Successful application to optimal electrode design in neuroscience.
Abstract
In this work we present an adaptive Newton-type method to solve nonlinear constrained optimization problems in which the constraint is a system of partial differential equations discretized by the finite element method. The adaptive strategy is based on a goal-oriented a posteriori error estimation for the discretization and for the iteration error. The iteration error stems from an inexact solution of the nonlinear system of first order optimality conditions by the Newton-type method. This strategy allows to balance the two errors and to derive effective stopping criteria for the Newton-iterations. The algorithm proceeds with the search of the optimal point on coarse grids which are refined only if the discretization error becomes dominant. Using computable error indicators the mesh is refined locally leading to a highly efficient solution process. The performance of the algorithm is…
| Iteration | ||||
|---|---|---|---|---|
| 1 | -2.09e-01 | -1.82e-01 | 1.81e-04 | 0.87 |
| 3 | -6.69e-02 | -6.38e-02 | 2.15e-04 | 0.95 |
| 5 | -1.81e-02 | -1.85e-02 | 2.30e-04 | 1.01 |
| 7 | -4.14e-03 | -4.86e-03 | 2.35e-04 | 1.12 |
| 9 | -4.90e-04 | -1.23e-03 | 2.36e-04 | 2.03 |
| 11 | 4.33e-04 | -3.08e-04 | 2.37e-04 | -0.16 |
| 13 | 6.64e-04 | -7.72e-05 | 2.37e-04 | 0.24 |
| 15 | 7.22e-04 | -1.93e-05 | 2.37e-04 | 0.30 |
| 17 | 7.37e-04 | -4.82e-06 | 2.37e-04 | 0.31 |
| 19 | 7.41e-04 | 2.46e-15 | 2.37e-04 | 0.32 |
| mesh adaptive | fully adaptive | ||||
|---|---|---|---|---|---|
| #dofs | #steps | time[s] | #steps | time[s] | |
| 54 | 1.3e-01 | 6 | 2 | 3 | 1 |
| 102 | 6.1e-02 | 4 | 5 | 1 | 3 |
| 176 | 3.4e-02 | 5 | 9 | 2 | 6 |
| 358 | 1.8e-02 | 5 | 13 | 2 | 9 |
| 578 | 9.3e-03 | 5 | 18 | 2 | 13 |
| 742 | 5.9e-03 | 5 | 28 | 2 | 20 |
| 1880 | 2.6e-03 | 5 | 39 | 2 | 27 |
| 2232 | 1.7e-03 | 5 | 65 | 2 | 44 |
| 6498 | 7.0e-04 | 5 | 98 | 2 | 65 |
| 8186 | 4.4e-04 | 5 | 138 | 2 | 91 |
| 10024 | 3.2e-04 | 5 | 221 | 2 | 161 |
| mesh adaptive | fully adaptive | ||||
|---|---|---|---|---|---|
| #dofs | #steps | time[s] | #steps | time[s] | |
| 2754 | -1.0e+01 | 4 | 34 | 1 | 17 |
| 3222 | -6.2e+00 | 4 | 80 | 1 | 41 |
| 3670 | 3.8e-01 | 3 | 128 | 1 | 70 |
| 6426 | 2.7e-01 | 3 | 205 | 1 | 119 |
| 12506 | 1.1e-01 | 3 | 335 | 1 | 197 |
| 26506 | 6.1e-02 | 2 | 520 | 1 | 338 |
| 57068 | 2.7e-02 | 2 | 831 | 1 | 575 |
| 95894 | 1.3e-02 | 2 | 1313 | 1 | 943 |
| Step | |||||
|---|---|---|---|---|---|
| 0 | 10.0 | 20.0 | 0.41 | 0.30 | 6214 |
| 1a | 4.8 | 19.7 | ” | ” | 6021 |
| 1b | ” | ” | 0.39 | 0.30 | 6020 |
| 2a | 5.1 | 19.7 | ” | ” | 6020 |
| 2b | ” | ” | 0.38 | 0.30 | 6019 |
| ⋮ | ⋮ | ⋮ | ⋮ | ⋮ | ⋮ |
| OPT | 5.9 | 19.7 | 0.35 | 0.30 | 6018 |
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
An adaptive Newton algorithm for optimal control problems
with application to optimal electrode design
Thomas Carraro1 [email protected] 1Institute for Applied Mathematics, Heidelberg University
Simon Dörsam1
1Institute for Applied Mathematics, Heidelberg University
Stefan Frei1 and Daniel Schwarz2
1Institute for Applied Mathematics, Heidelberg University
Abstract
In this work we present an adaptive Newton-type method to solve nonlinear constrained optimization problems in which the constraint is a system of partial differential equations discretized by the finite element method. The adaptive strategy is based on a goal-oriented a posteriori error estimation for the discretization and for the iteration error. The iteration error stems from an inexact solution of the nonlinear system of first order optimality conditions by the Newton-type method. This strategy allows to balance the two errors and to derive effective stopping criteria for the Newton-iterations. The algorithm proceeds with the search of the optimal point on coarse grids which are refined only if the discretization error becomes dominant. Using computable error indicators the mesh is refined locally leading to a highly efficient solution process. The performance of the algorithm is shown with several examples and in particular with an application in the neurosciences: the optimal electrode design for the study of neuronal networks.
1 Introduction
In this work we consider the optimal design of a glass micro-electrode for the use of reversible in vivo electroporation in neural tissue. Electroporation describes the increase in permeability of the cell membrane by the application of an external electric field beyond a certain threshold [32, 36]. While this technique has been known at least since the 1960’s [19], it has become a standard tool in the neurosciences in more recent years to load single cells and small ensembles of neurons with a range of dyes and molecules, for example for the visualization of neural networks [18, 24, 25], see Figure 1 on the left.
In order to make the plasma membrane permeable for a specific dye, the local voltage has to exceed a certain threshold. On the other hand the applied stimulus can not be increased infinitely, as high peaks of current would cause collateral damage [25, 16]. A way to reduce such unwanted side-effects is to modify the shape of the micro-electrodes, in order to obtain a more uniform distribution of the electric field. While standard electrodes have a single hole at the tip, adding more holes on the side of the pipette seems a promising approach. Recent work has shown that nanoengineering techniques are indeed available to shape glass micro-electrodes in the tip region using focused ion beam assisted milling [22, 31], see Figure 1 on the right. It has been shown that the part of the neuronal network, that can be visualized with these modified pipettes, is considerably enlarged in comparison to the standard design [31], see Figure 2 for a numerical demonstration.
The objective of this work is to design an optimal electrode in terms of position and size of holes in the micro-pipette by using methods of numerical optimization. The scientific contribution of this work is twofold: (i) on one side we present a mathematical formulation of the optimal design of a micro-pipette; (ii) on the other side we present an adaptive Newton method for the solution of the corresponding optimization problem.
The model used to describe the electric field is a partial differential equation (PDE). Therefore, we deal with a PDE constrained optimization problem. In the context of PDE constrained optimization problems the two common solution methods are the reduced and the all-at-once approach [20]. We will adopt the latter one in which the optimality conditions are expressed as Karush-Kuhn-Tucker (KKT) system. There is a large literature on this topic and we refer for example to the books [15, 20, 23] for a thorough introduction. Regarding the specific application there are no systematic studies that use a model based approach to design the micro-pipette used in electroporation. Therefore, the results shown here are of scientific interest even if they are obtained in a simplified setting with a two-dimensional problem. The extension to three-dimensional problems with a more complex model is possible within the same adaptive algorithm.
Mesh adaptivity is in many aspects well established in the context of finite element discretization of linear and nonlinear partial differential equations, see e.g. [2, 33]. Furthermore, goal oriented a posteriori error estimation has been successfully used in many applications, see the seminal works [6, 4] for an overview of the Dual Weighed Residual (DWR) technique and exemplarily [9, 30, 34, 8] for some specific applications. A posteriori error estimation methods have been used to control the discretization error either in global norms, e.g. the or energy norm, or in specific functionals in the context of goal oriented techniques.
To solve the nonlinear system arising from the discretization of the underlying problem typically a Newton-type method is used. If the Newton iteration is stopped after reaching a given tolerance, there is an iteration error that has to be taken into account in addition to the discretization error. In particular, it is advantageous to control the iteration error and allow the Newton-iterates to stop before full convergence (i.e. to machine precision), because each Newton-iteration comes at the cost of the solution of a large linear system. The latter might be badly conditioned, especially in the context of multi-physics and optimization problems, leading to a large number of iterations of an iterative linear solver. There are only few results on a posteriori error estimation that combine an estimation of the discretization error and of the iteration error, resulting in algorithms that have stopping criteria based on balancing the two sources of error.
In the last few years increasing attention has been given to adaptive strategies to solve nonlinear problems including those arising from discretizations of partial differential equations. Ziems and Ulbrich have presented in [37] a class of inexact multilevel trust-region sequential quadratic programming (SQP) methods for the solution of nonlinear PDE-constrained optimization problems, in which the discretization error in global norms is controlled by local error estimators including control of the inexactness of the iterative solvers. Further works can be found outside the optimization context. A list of relevant publications is here given:
Bernardi and coauthors have shown an a posteriori analysis of iterative algorithms for nonlinear problems [7], Rannacher and Vihharev have balanced the discretization error and the iteration error in a Newton-type solver [27]; Ern and Vohralík have developed an adaptive strategy for inexact Newton methods based on a posteriori error analysis [14] and Wihler and Amrein have presented an adaptive Newton-Galerkin method for semi-linear elliptic PDEs which combines an error estimation for the Newton step and an error estimation for the discretization with finite elements [1].
Since the goal of a simulation is the computation of a specific quantity of interest, for example in our case the optimal micro-pipette design (i.e. the position and dimension of the side holes), it is desirable to optimize the mesh refinement in a goal-oriented fashion. Furthermore, also the stopping criterion for the Newton iteration should be goal-oriented. This allows, for example in the context of optimization, to approximate the optimal point on coarse meshes and refine only once the discretization error becomes dominant. In this way we reach the full balance of error sources with respect to the quantity of interest and the algorithm does the costly iterates (on fine meshes) only after the nonlinearities have been adequately solved on cheaper meshes. Consequently the computational costs are reduced by keeping the precision of the simulation at the desired level. The new contribution of our work in this context is the derivation of a goal-oriented strategy for the adaptive control of a Newton-type algorithm to solve a nonlinear PDE-constrained optimization problem.
This work is organized as follows. In Section 2 we formulate the general optimization problem; in Section 3 we present our adaptive strategy; in Section 4 we introduce the application in optimal electrode design; in Section 5 we delineate the algorithms and in Section 6 we present some numerical results. Finally, in Section 7, an outlook to possible extensions of the presented method is given.
2 Optimization problem
We consider the following optimization problem with parameters
[TABLE]
We assume that is a reflexive Banach space. Let be a semi-linear form and for every , where denotes the dual space of . Furthermore, we assume that and are twice (Fréchet) differentiable and that for each the state equation (2) has a unique solution . Let us denote the (nonlinear) control-to-state map by .
Under these assumptions we can consider a reduced formulation of the optimization problem, with a reduced objective functional . If the reduced objective functional is coercive the existence of local minimizers to (1)-(2) follows by standard arguments, see e.g. [15, 20]. The coercivity assumption is needed in case of unconstrained optimization problems to assure boundedness of the minimizing sequence. Therefore, for the practical solution of the problem, we consider a Tikhonov regularization term in the objective functional. If in addition the functional is convex, the optimization problem has a unique solution. Since in this work we allow nonlinearities in the model, we cannot assume convexity of the reduced functional. Therefore, the theoretical results assure only the existence of local minimizers.
To derive the optimality conditions, we introduce the Lagrange functional
[TABLE]
The first-order necessary optimality conditions are given by the KKT system
[TABLE]
The first equation corresponds to the dual equation for the adjoint variable , the second equation is called the control equation and the third equation is the state equation for the primal variable .
2.1 Model problem
To simplify the notation in the introduction of the error estimator in the next section, we consider a model problem of the form
[TABLE]
where , , and are positive real numbers, denotes the scalar product and . The corresponding KKT system reads
Problem 2.1** (KKT system of the model problem)**
Find such that
[TABLE]
By introducing the semi-linear form
[TABLE]
we can write the KKT system in compact form as
[TABLE]
The derivation of a corresponding adaptive Newton method for other functionals and semi-linear forms fulfilling the assumptions made above is straight-forward given that the KKT system is solvable with a Newton-type solver. The modification of the optimization problem to the specific application presented in this paper will be made later in Section 4.
2.2 Discretization
We choose conforming finite element spaces for the state variable and the dual variable . The control space is already finite dimensional, therefore we do not need a discretization of the control variable. The discrete optimality system reads
Problem 2.2** (Discrete KKT system of the model problem)**
Find , and , such that
[TABLE]
An essential problem in solving a discretized PDE system is the choice of the computational mesh on which depends the discretization error, i.e. the error due to the finite dimensional approximation given by the finite elements.
3 Adaptive strategy
In the case of optimization problems it is of interest to control the accuracy of the solution of the first-order optimality conditions. The accuracy depends on the discretization error and it “measures” the quality of the approximation of the optimal point, i.e. of the optimal control and optimal state. In the context of PDE constrained optimization problems, the two typical methods to solve the problem are the reduced approach and the all-at-once approach. Here we use the all-at-once approach, in which the optimality conditions are expressed in terms of the gradient of the Lagrangian functional defined in the previous section. In particular, in absence of control and/or state constraints the optimality conditions are given by
[TABLE]
and the discrete counterpart is
[TABLE]
Since the discrete approximation is accurate only up to a certain tolerance that depends on the actual mesh refinement, it makes sense for efficiency reasons to solve the optimality system only up to a certain accuracy as well.
The idea of our adaptive inexact Newton-type method is to balance the accuracy of the first order optimality conditions, i.e. of the KKT system, with the accuracy of its discrete approximation with respect to a goal functional, rather than with respect to some (global) norms of the solution or of the residuals. This is possible exploiting the flexibility of the DWR which allows to control the error with respect to an arbitrary functional.
In Section 3.1, we briefly introduce the DWR method and in Section 3.2 we explain how to split the error into two contributions: one from the mesh discretization and the other from the inexact solution of the KKT system.
3.1 Dual weighted residual (DWR) method
We are interested in estimating the error measured in a quantity of interest:
[TABLE]
Following the seminal work of Becker and Rannacher [6] we obtain the error identity by weighting the residual of the KKT system by an appropriate dual problem. Let be the solution of the KKT system (2). For the DWR error representation we need the residual of the system, , defined by
[TABLE]
with . Furthermore, we need the following adjoint problem to define the error estimator
Problem 3.1** (Dual problem)**
Find such that
[TABLE]
By setting , the dual system reads
[TABLE]
with the adjoint bilinear form \mathcal{A}^{*}(\cdot,\cdot)(\cdot):\bigl{(}\mathcal{V}\times\mathbb{R}^{s}\times\mathcal{V}\bigr{)}^{3}\rightarrow\mathbb{R} defined as
[TABLE]
Its discretized counterpart is
Problem 3.2** (Discretized dual problem)**
Find such that
[TABLE]
Since the model problem is nonlinear in we need to define the following dual residual to derive the error estimator
[TABLE]
with .
With these definitions, following [4, Proposition 6.2], we get the error estimator
Theorem 3.1** (A posteriori error estimator)**
Let , be the solutions of Problem 2.1 and 2.2 and let , be the solutions of the continuous dual problem 3.1 and its discretized version 3.2. It holds the error identity
[TABLE]
with the residual and the adjoint residual defined in (3.1) and (3.1). The remainder term is given by
[TABLE]
where is the semi-linear form (5) and the primal and dual errors are and .
Proof 3.1
The proof follows by application of Proposition 6.1 from [4] with the following Lagrange functional
[TABLE]
We sketch it here for later purposes. Introducing the notation and and reminding the definition of the semi-linear form , see expression (5), we can rewrite it as
[TABLE]
Furthermore, it is
[TABLE]
where we have used the fact that and satisfy (6) and (7) respectively. Considering the relation
[TABLE]
the error identity follows from the error representation of the trapezoidal rule
[TABLE]
In fact, since it is
[TABLE]
where is the remainder term of the trapezoidal rule. From this relation, using the definitions (3.1) and (3.1), the identity (12) can be deduced observing that
[TABLE]
3.2 Balancing of discretization and iteration error
In this work, we consider an inexact Newton-type method to solve the nonlinear KKT system (2.2). We introduce the notation to indicate the inexact solution of the KKT system, which is obtained when the stopping criterion
[TABLE]
is reached and the notation to indicate the “perturbed” dual solution obtained by solving exactly (up to machine precision) the “perturbed dual equation”
[TABLE]
We use the term “perturbed dual equation” for the adjoint equation in which we set the inexact primal solution as coefficient.
Since and are approximations of and , an additional term appears in the error identity (12) that accounts for the inexact Galerkin projection (14).
Following [27, Proposition 3.1] we have the error estimator
Theorem 3.2** (Error estimator with inexact Galerkin projection)**
[TABLE]
with the residuals of the primal problem (3.1) and of the dual problem (3.1) and the remainder term as in Problem 3.1.
Proof 3.2
Introducing the notation , and the Lagrangian as in Theorem (3.1), the proof follows from [27, Proposition 3.1]. Let us consider the Lagrangian
[TABLE]
It follows that
[TABLE]
where we have used the fact that satisfies (6), while equation (7) is solved only approximately. Considering the trapezoidal rule and its remainder term, we get analogously to Theorem 3.1 the identity
[TABLE]
from which the error representation (15) can be deduced.
Definition 1** (Splitting of the error estimator)**
For ease of presentation of the results and to derive the adaptive Newton strategy we split the error estimator into two parts. These are identified with the discretization error and the error due to the inexact Newton solution of the discrete KKT system :
[TABLE]
Furthermore, using the error identity (15) we define
[TABLE]
To evaluate the quality of the error estimator, we use the effectivity index
[TABLE]
An index close to one means that the estimator is reliable. In the numerical examples in Section 6, we will observe that the indicator has a good effectivity index already at the beginning of the Newton iterations, when the solution approximation is inaccurate.
We conclude this section by anticipating that our adaptive strategy defined in the algorithms in Section 5 exploits the error splitting and attempts to balance the two error contributions, i.e. to reach the balance , during the Newton iterations. In this way the adaptive strategy attempts to reduce the goal functional of the optimization problem on coarse meshes and it proceeds with mesh refinement only if the discretization error is dominating.
Remark 1
In the residual (3.1) the term related to the residuum of the control equation is always zero because the control is finite dimensional. We keep it in the error representation because the same term in the residual in (15) is nonzero due to the inexact Galerkin projection. In fact, this term is essential to get a reliable error estimator. Also in the dual residual (3.1) the control term is zero. We keep the full expression here for the sake of completeness in the case of an infinite dimensional control space.
4 Application: Optimal electrode design
As already mentioned in the introduction, we apply our adaptive strategy to the optimal design of a micro-pipette to be used in electroporation. The objective is to maximize the area around the micro-pipette, where the voltage exceeds a certain threshold , while on the other hand an upper bound for the voltage shall not be reached.
The micro-pipette is covered by an isolating material such that the current can only flow to the biological tissue through the micro-pipette holes. While standard micro-pipettes have only one hole at the tip, holes can also be created on the sides of the micro-pipette using nanoengineering techniques [31].
As some of the parameters, as e.g. the conductivity of the medium , are only known in a very rough approximation, we cannot expect to obtain quantitative results at this stage. Therefore, it seems justified for a qualitative study to restrict the setting to a two-dimensional simplification. Furthermore, we restrict the possible design of the holes to a symmetric setting with the same size of the openings on both sides. In this context we are interested in the position and size of the openings as design parameters.
The domain of interest is a region around the micro-pipette , where neuronal cells might be activated. To reduce the influence of exterior boundary conditions, we use a larger box around the micro-pipette as simulation domain (Figure 3), excluding the micro-pipette itself. If we choose the box large enough, we can assume without loss of generality zero voltage at the outer boundary.
We assume that a fixed current is applied at the top of the micro-pipette. Knowing the resistances of the electrode, the approximation of the fluxes through the holes of the micro-pipette can be derived by physical laws (see the appendix) and are defined as flux (Neumann) conditions at the boundary of . The fluxes are expressed as functions of the radii and positions of the holes (which are the control variables for the optimal design), therefore the control variables define the Neumann boundary conditions as a finite dimensional parametrization.
4.1 Governing equations
The governing equations can be derived as follows. In the absence of electric charge the Gauss law states
[TABLE]
for the electric field and the conductivity . With the electrostatic potential () (18) reads
[TABLE]
We assume zero Dirichlet conditions at the outer boundaries of the box denoted by , see Figure 3. Then, we can rewrite (19) in terms of the voltage
[TABLE]
The boundary condition at the micro-pipette is a flux condition
[TABLE]
The flux is zero at the isolated parts of the micro-pipette. At the holes , the flux is given by
[TABLE]
where denotes the current density at hole . Let us assume that the number of holes is fixed. Our design parameters will be the vertical position in terms of the midpoint of the holes and their sizes . The fluxes depend in a highly nonlinear way on (see the appendix). As the derivation of the analytical expressions for more than two sets of holes are complex, we restrict our study to a maximum of two additional sets of holes besides the hole at the tip. A possible extension of this work would be to not rely on analytical expressions for the fluxes but extend the computational domain to the interior part of the micro-pipette and approximate the fluxes with a finite element discretization. Since the restriction to two sets of holes is not a limitation to show the effectiveness of our approach, we consider the analytical expressions derived in the appendix to reduce the computational effort.
4.2 Objective functional
Our aim is to maximize the region where the voltage exceeds a certain threshold . At the same time, we have to ensure that the voltage does not exceed a critical value , with which the biological tissue might be damaged. The corresponding objective functional would be
[TABLE]
where denotes the characteristic function of the set . The main issue of the objective functional is its non-differentiability. For the gradient-based optimization algorithm we present here, the functional is required to be at least differentiable.
Therefore, we consider another objective functional
[TABLE]
where we choose a constant function that is used as a tracking term to reach the desired threshold. Moreover, to avoid the influence of a far-away region, where we cannot expect that any cell can be activated, we consider for the functional definition the previously defined domain of interest, i.e. the sub-domain around the micro-pipette.
Using this functional, the voltage does not exceed the critical value in the numerical simulations conducted for this paper. In fact, we have found that using a value slightly larger than the threshold is a good choice to get above to the threshold and to stay significantly below the critical value .
The application poses additional restrictions for the design parameters . Each hole has to lie above the tip of the micro-pipette and below the upper end of the bounding box and the holes should not overlap (otherwise the formulas derived in the appendix for the fluxes at the boundary are not valid anymore). In the numerical experiments conducted for this paper, however, these conditions were never violated. The addition of point-wise state constraints and/or control constraints , using an admissible set , can be done without significant changes in our approach using a penalty method and/or an active set strategy [21]. Hence to simplify the exposition, we do not incorporate state and control constraints in this work.
Finally, we add a regularization term with parameter to the objective functional as explained in Section 2. The optimization problem reads in variational formulation
Problem 4.1** (Optimization of the micro-pipette)**
Find the pair and that minimizes the goal functional under the PDE constrain:
[TABLE]
4.3 Karush-Kuhn-Tucker system
The Lagrange functional corresponding to problem 4.1 reads
[TABLE]
with an adjoint variable . The first-order optimality conditions are given by:
Problem 4.2** (First-order optimality conditions)**
Find , , , such that
[TABLE]
4.4 Discretization and approximation of the flux boundary conditions
We use the space of standard finite elements on a quasi-uniform finite element mesh . Altogether, the discrete optimality system reads:
Problem 4.3** (Discrete first-order optimality conditions)**
Find , , such that
[TABLE]
Denoting by the vertical position on the micro-pipette (see Figure 3) and by the position of the tip, it holds for the flux function that
[TABLE]
Note that is discontinuous in both the vertical coordinate and the parameter vector . This is a problem, since the derivative appears in the optimality system (4.3). Furthermore, numerical methods like Newton-type methods for solving (4.3) require at least the first derivative of the system which includes . To deal with this issue, we introduce a smooth approximation of . Let be the characteristic function on the interval . A smooth approximation to is given by . Based on this approximation, we define a regularized flux function by
[TABLE]
for some , see Figure 4.
Furthermore, we use a summed quadrature formula with sufficient integration points to evaluate the boundary integrals such that the decay of at the boundary of the openings is appropriately approximated.
4.5 Dual problem for the error estimation
As explained in Section 3.1 to estimate the discretization and iteration errors we need an approximation of the solution of an ad-hoc dual problem. In the specific case of the micro-pipette optimization the dual problem reads
Problem 4.4** (Dual micro-pipette problem)**
Find and such that
[TABLE]
This problem is discretized with finite elements to get the approximation . Furthermore, we observe that the system matrix of the dual problem is exactly the same matrix used in the Newton method to solve the primal problem, i.e. to solve the discrete KKT system (4.3). It is the Hessian of the Lagrange functional (21). It follows that the solution of the dual problem for the DWR method corresponds to one additional Newton step with a different right-hand side, which will be explicitly shown later in the algorithmic section 5.
4.6 A posteriori error estimators
We conclude this section by specifying the concrete error estimators for the KKT system (4.3). Following the derivation in Section 3, it holds that
[TABLE]
with and specified in (16) and (17). An evaluation of the integrals over the cells leads in general to poor local error indicators due to the oscillatory nature of the residuals, see [11]. To avoid this behavior we integrate the residuals cell-wise by parts obtaining boundary terms (jump terms) to distribute the error on the inner cell-edges. To simplify the notation we use the symbols without tilde implicitly considering that all quantities and are perturbed. Furthermore, we separate in (16) the contribution from the primal and the dual residuals, i.e. with
[TABLE]
with the boundary residuals defined on by
[TABLE]
In the error representation (15) both the continuous primal and dual solutions and are used as weights. In fact, using the continuous weights and considering the remainder term, this expression is an identity. It becomes an estimation after substituting the unknown continuous solutions with computable quantities. As shown in several applications [9, 30, 29, 26, 10, 5] one efficient method to produce computable quantities is the use of a patch-wise higher-order approximation of the terms and . In particular, we have used the following interpolation operator with
[TABLE]
where denotes the nodal interpolation into the space of quadratic polynomials on the patch mesh obtained by joining together four cells patchwise, as shown in Figure 5.
In the case of uniformly refined meshes and smooth primal and dual solutions, this weight-approximation has been justified analytically in [4].
The estimator for the iteration error is defined by
[TABLE]
5 Algorithms
In this section we introduce the algorithms that are compared in Section 6. In addition to the fully adaptive algorithm, we will also specify a global refinement strategy and a purely mesh adaptive algorithm. The latter is the standard Dual Weighted Residual method applied to (4.2). The residual of the k-th iterate is defined by
[TABLE]
The corresponding Hessian matrix is given by
[TABLE]
Let a tolerance for the Newton residual be given. We formulate the algorithms for a damped Newton method with a damping parameter . The full Newton step is obtained for .
In Algorithm 1 we present the global refinement strategy with a given number of refinement steps .
In this algorithm, neither the discretization nor the iteration error is estimated. Thus, we have no control over these errors and the usual stopping criterion is based on a tolerance on a norm of the residual. This generic criterion does not allow to control the inexactness of the optimal solution that is needed to advance with the optimization on finer grids before machine precision is reached.
Next, we introduce the purely mesh adaptive Algorithm 2. We introduce a further tolerance for the discretization error. In addition to the notation introduced above, we denote the right-hand side of the dual problem by
[TABLE]
Based on the error indicators several refinement strategies can be derived. We refer to [6] for an overview. In this work we use a refinement strategy based on a minimization of the expected error and the computational effort required for the solution on the refined mesh, see [28].
Finally, we concretize the fully adaptive Algorithm 3 which is the novelty of this contribution.
It remains to specify the constant in Algorithm 3 to determine the balancing between and . A straightforward choice would be , i.e. to stop the Newton iteration, as soon as the iteration error is smaller than the discretization error. Nevertheless, we have decided in the numerical examples conducted for this paper to use a smaller value of . In this way, we obtain that the Newton method remains in the region of quadratic convergence on the next finer grid, once this convergence rate is achieved on the previous coarser one. In the numerical examples below, we have used . In general, the optimal choice for depends on the specific application.
On the first sight, the two adaptive algorithms look very similar. The main difference is the stopping criterion of the second while-loop which depends on the balancing of the error estimators in the fully adaptive algorithm and on the Newton residual in the mesh-adaptive algorithm. The balancing criterion allows the Newton method to iterate on the actual grid as much as needed to reach the discretization error, therefore it saves at each level unneeded iterations. However, it has to be noted that in the full adaptive algorithm a dual problem has to be solved within the second while-loop in every iteration, while in the mesh-adaptive algorithm a dual problem is solved only once on each mesh level. We investigate in the next section how this additional computational effort compares to the computational savings due to the improved stopping criterion.
6 Numerical results
In this section, we study different numerical examples to test the algorithms. First, we study a simple test problem on a slit domain in Section 6.1. The purpose of this test problem is to test the error estimators and . To this end, we compute effectivity indices and investigate if the estimators are relatively independent of each other. Then we test the algorithms for optimal electrode design in Section 6.2. We compare the fully adaptive algorithm to the two other refinement algorithms introduced in Section 5 with respect to errors, degrees of freedom and computational times. Finally, we compare the optimal results for 0, 1 and 2 sets of holes in addition to the opening at the tip.
All the numerical results presented in this section are obtained using the finite element library deal.II [3]. To calculate the lengthy first and second derivatives of with respect to the design parameter (see the appendix) we have used the automatic differentiation tool ADOL–C [35]. The runtimes shown were obtained on a desktop computer with a 2.66GHz Intel Core 2 Quad processor (Q9400). As linear solver within the Newton algorithm, a direct solver is applied (UMFPACK [12]).
6.1 Test problem on a slit domain
We start by studying a test problem on the slit domain
[TABLE]
see Figure 6 on the right. We set homogeneous Dirichlet data on the outer boundary except for the upper part , where the Neumann condition is imposed. As objective functional, we set , where and . The quantity of interest is .
To test the estimator , we first show results of the global refinement strategy in Figure 6 on the left. The optimal solution shows a singularity in the gradient at the top of the slit. Therefore, the error in the goal functional as well as the error estimator decrease linearly as expected (see e.g. [13], Section 6.3.2). As the Newton algorithm is solved up to a small tolerance in the Newton residual, it holds . The effectivity indices on the finer grids are . These values show that the error estimator estimates the order of magnitude of the error correctly, the deviation of estimator and real error being mainly due to the approximation of the weight by the interpolation .
In Figure 7, we compare the results obtained by global mesh refinement to the adaptive strategy introduced in Section 5. We plot the error in against the degrees of freedom (left) and against the computational times (right). The error for the two adaptive methods differ only marginally, hence we plot only the fully adaptive result in the left plot. In this example the error decreases approximately with for global refinement and with for the adaptive mesh refinement. While the global refinement strategy shows for example an error of for degrees of freedom, the adaptive strategy reaches an error of with only degrees of freedom. The solution on an adaptively refined mesh is shown in Figure 8 on the right.
With respect to computational times, the fully adaptive and the mesh-adaptive algorithm show asymptotically the same convergence behavior, with a clear advantage of the fully adaptive algorithm. To study this difference quantitatively, we show the number of Newton steps and the computational times in Figure 8 on the left.
From the third mesh level, the mesh-adaptive algorithm needs two Newton steps on each mesh level, while the fully adaptive one needs only one. As mentioned in Section 5 the latter strategy requires the solution of a dual problem after each Newton step, while in the mesh-adaptive algorithm a dual problem has to be solved only once after the last Newton step on each mesh level. As the system matrix for the primal and dual problem have the same structure, the cost to solve them is comparable. Hence, two KKT systems have to be solved in the fully adaptive algorithm on each of the finer mesh levels, compared to three for the mesh adaptive algorithm. This ratio of 2:3 can be observed in the computational times. To reduce the error in below , the fully adaptive algorithm needs for example 131 seconds in contrast to 193 s for the mesh adaptive one. Using global refinement, 1157 s are needed to reach this tolerance, see Figure 6.
Finally, we want to test the iteration error indicator . As the iteration error of the Newton method decreases very quickly in the first Newton steps, this is barely visible in the previous calculations. To investigate the iteration error indicator in more detail, we use a damped Newton iteration with a damping factor that reduces the convergence rate of the iteration significantly.
Given an iterate , the next iterate is defined by
[TABLE]
where is the Newton direction and the damping parameter is chosen as . To keep the discretization error small, we choose a very fine mesh with nodes. The results are shown in Table 1. We observe that the discretization error varies slightly in the first iterates by less than 25% and stays then nearly constant. This indicates that the two error estimators are asymptotically independent. Moreover, we see that the iteration error dominates the overall error until the ninth iteration. Up to then, the effectivity index lies between and . This indicates that the iteration error indicator is very reliable in this test problem. After about 14 iterations, the discretization error becomes dominant and the efficiency indices are about as observed in the previous test. At a certain iteration the two errors are comparable but with opposite sign, i.e. . A cancellation problem occurs and the efficiency index in step 11 becomes negative. This is typical when trying to split the error in different contributions and cannot be avoided.
As last example in this section, we study a problem in which the nonlinearity causes more Newton steps to test the mesh-adaptive algorithm. Therefore, we introduce a further non-linearity in the state equation
[TABLE]
We set the right-hand side to and use the same objective functional and the quantity of interest as above. We compare the number of Newton steps and the computational times of the fully adaptive and the mesh-adaptive algorithm in Table 2. On the finer mesh levels, the mesh-adaptive algorithm requires 5 Newton steps per mesh level, which means that 6 KKT systems have to be solved, while the fully adaptive algorithm refines the mesh after 2 Newton steps, i.e. 4 KKT systems have to be solved. Therefore, we observe again a ratio of roughly 2:3 in the computational times.
6.2 Optimal electrode design
In this section we consider the micro-pipette geometry described in Section 4. We use the Neumann boundary condition
[TABLE]
with as described in the appendix (40) and (39). The optimization problem is given in (20), the continuous and discrete KKT system in (4.2) and (4.3). First, we study the configuration with two openings on each side and keeping the sizes and fixed. The design parameters are thus the vertical position of the holes, in terms of their midpoints and .
The objective functional is given by
[TABLE]
where , and a sub-domain as shown in Figure 3. The domain has a size of , the sub-domain of and the sizes of the openings are fixed as . Moreover, the thickness of the micro-pipette wall is , the inclination angle of the micro-pipette is , the conductivity and the applied current on the top of the micro-pipette is . We approximate the function by the differentiable function defined in (24) with . As goal functional, we consider again the error in the design parameter .
In Figure 9 we show the error estimators and as well as the effectivity index in the course of the fully adaptive algorithm on the left side. On each mesh level one Newton step was enough to reduce the iteration error below the discretization error . On the other hand, is around on the coarse mesh levels and the corresponding Newton residual is far away from being below the tolerance . Therefore, the purely mesh-adaptive algorithm needs more Newton steps (2-4) on each mesh level, see Table 3. Note that although the contribution of the iteration error to the goal functional is very small from the fourth mesh level () the Newton residual might still be much larger, such that the purely mesh adaptive algorithm needs at least a second Newton step before .
The effectivity indices are close to 1 on all fine mesh levels. The error is well estimated on all mesh levels besides the third one with 3670 nodes. Here, the error changes its sign, which is not yet captured by the estimator. On the right, we show the optimal solution on an adaptively refined mesh. Note that most of the refinement takes place around the two upper openings of the micro-pipette. The optimal positions of the openings found by the adaptive algorithm for initial values and are and above the tip of the micro-pipette, see also Figure 2.
In Table 3, we compare the mesh adaptive against the fully adaptive algorithm in terms of Newton steps and computational times. As mentioned before, the iteration error is reduced below the discretization error already after the first Newton step in the fully adaptive algorithm, while 2 to 4 Newton steps are necessary in the mesh-adaptive algorithm to reduce the Newton residual below the tolerance . On the finer meshes we have to solve 2 primal and 1 dual KKT systems for the mesh adaptive algorithm and 1 primal and 1 dual system for the fully adaptive algorithm. Thus, the computational times show again a ratio of roughly 2:3 on the finer meshes.
On the left side of Figure 10, we compare the global refinement algorithm against the adaptive ones by plotting the error against degrees of freedom. As the plots of the two adaptive algorithms are indistinguishable, we plot again only the errors for the fully adaptive algorithm. The global refinement strategy converges with a rate slightly smaller than , while the adaptive algorithms converge significantly faster. On the right side, we plot the error over the computational time for the two adaptive algorithms. Due to the observations made above for the number of KKT systems to be solved, the two adaptive algorithms show again a very similar asymptotic behavior in terms of computational times, with an advantage of roughly for the fully adaptive algorithm.
Finally, we want to compare the effect of a different number of openings. In the case of only one opening at the bottom, nothing is to be optimized. Solving the state equation to obtain the electric field yields an objective value of . The voltage distribution is shown in Figure 11 on the left. The black contour line corresponds to the threshold .
For a fair comparison of micro-pipettes with one and two sets of openings, we have to optimize not only the position , but also the size of the openings. Due to the complicated structure of the boundary fluxes (see the appendix), we decided not to implement the additional derivatives that would be necessary for a simultaneous optimization of size and position. Instead, we alternately optimize size and position by keeping the respective other parameters fixed, see Table 4 for the case of two openings.
The optimal parameters the optimization algorithm has found were sizes of , and positions of and in the case of two openings and and for one opening. The optimal functional value is given by for one set of holes and for two sets. While we obtain a reduction of more than between the case without a hole and the case with one set of holes, the reduction between one and two sets of holes is only around . This can also be seen from the voltage distribution in Figure 11.
These results show that the modified micro-pipettes yield a significantly larger region where cell membranes are made permeable. Moreover, the results indicate that more than one set of holes does not bring a significant advantage anymore, as a relatively large region around the micro-pipette is activated already by one hole per side. The second hole that is placed relatively close to the tip of the micro-pipette by the optimization algorithm, seems to have a much smaller effect. However, the overall voltage distribution is more uniform and the peak potential regions at the holes (red) are reduced, which may have an advantageous effect for the health of cells (without losing any/much of the overall electroporation volume).
7 Conclusion & Outlook
We have presented an adaptive optimization algorithm for the optimal design of a micro-pipette for electroporation used for neuronal networks tracing. The main contribution is the derivation of the goal-oriented strategy that allows to steer the number of Newton steps balancing the discretization error and the solution error with respect to a (nonlinear) functional that represents a quantity of interest for the specific optimization problem.
Possible extension of this approach is the balance of the linearization error and the error due to the linear solver as in [27]. Furthermore, more sophisticated optimization algorithms as the one presented in [37] can be considered in this framework to increase the robustness of the optimization method. In addition, globalization techniques as the one presented in [1] that allow to control the convergence behavior of the Newton method become essential in certain practical cases and should be considered in future works.
Another possible extension is to include control and/or state constraints in the formulation. This is possible, as already mentioned, without significant changes in the approach presented here. Furthermore, the algorithm presented can be used and adapted to many other applications for which a Newton-type method can be applied.
Using the adaptive algorithm we have shown that quantitative improvement of the micro-pipette design can be obtained by a model-based optimization method. This approach is a promising tool with a significant impact in the neurosciences.
8 Appendix
In the appendix, we derive the flux function and its dependency on sizes and positions of the -th hole, . A scheme of the electric circuit is shown in Figure 12. For simplicity, we present only the case of a micro-pipette with two holes on each side. The derivation of corresponding formulas for a different number of holes is analogous.
We assume that a fixed current is applied at the top of the micro-pipette. We calculate the current that flows out of the micro-pipette at the holes . The flux function at hole is then given by the current density
[TABLE]
The micro-pipette is filled with a conducting liquid. We assign a specific resistance , , to each of the parts of the micro-pipette. The resistances of the conducting liquid in the small holes on the left and right in between the isolating wall are denoted by and , the resistances of the parts in the interior of the micro-pipette by and . Denoting the thickness of the wall by , the resistance of a hole is given by
[TABLE]
where is the electrical resistivity. To calculate the resistance of the conical part below , we introduce the notation for the area inside the micro-pipette at position , see Figure 13. The area of at the tip of the micro-pipette is given by , the area of at the first hole by
[TABLE]
where is the inclination angle of the micro-pipette. The resistance of the conical part below is then given by (see e.g. [17])
[TABLE]
Similarly, we get for the resistance of the part between the points and
[TABLE]
The voltage difference between point and a point far off the micro-pipette can be used to derive the following formula by using Ohm’s law (see Figure 12)
[TABLE]
Here, stands for the total resistance of the parts , and which is given by
[TABLE]
Furthermore, by Kirchhoff’s current law the current splits at point to
[TABLE]
(35) and (36) can be solved for the two unknowns and . In the same way, it holds at point
[TABLE]
and
[TABLE]
Given , (37) and (38) define and . Inserting the formulas for the resistances, a direct calculation results in
[TABLE]
with and
[TABLE]
As we use a two dimensional setting the size of is given by . The flux function at hole is thus given by
[TABLE]
Acknowledgements
We are grateful to Prof. Andreas T. Schaefer for generous collaborative support and fruitful discussions of this work.
T.C. was supported by the Deutsche Forschungsgemeinschaft (DFG) through the project CA 633/2-1.
The reference list from the paper itself. Each links out to its DOI / PubMed record.
- 1[1] M. Amrein and T. P. Wihler. Fully adaptive Newton–Galerkin methods for semilinear elliptic partial differential equations. SIAM Journal on Scientific Computing , 37(4):A 1637–A 1657, 2015.
- 2[2] I. Babuška, J. R. Whiteman, and T. Strouboulis. Finite elements. An introduction to the method and error estimation. Oxford: Oxford University Press, 2011.
- 3[3] W. Bangerth, R. Hartmann, and G. Kanschat. deal.II – a general purpose object oriented finite element library. ACM Trans. Math. Softw. , 33(4):24/1–24/27, 2007.
- 4[4] W. Bangerth and R. Rannacher. Adaptive Finite Element Methods for Differential Equations . Birkhäuser Verlag, 2003.
- 5[5] R. Becker, M. Braack, D. Meidner, R. Rannacher, and B. Vexler. Adaptive finite element methods for pde-constrained optimal control problems. In W. Jäger, R. Rannacher, and J. Warnatz, editors, Reactive Flows, Diffusion and Transport , pages 177–205. Springer Berlin Heidelberg, 2007.
- 6[6] R. Becker and R. Rannacher. An optimal control approach to a posteriori error estimation in finite element methods. Acta Numerica , 10:1–102, 2001.
- 7[7] C. Bernardi, J. Dakroub, G. Mansour, and T. Sayah. A posteriori analysis of iterative algorithms for a nonlinear problem. Journal of Scientific Computing , 65(2):672–697, 2015.
- 8[8] M. Braack and A. Ern. A posteriori control of modeling errors and discretization errors. Multiscale Modeling & Simulation , 1(2):221–238, 2003.
