원시데이터 수집 시스템
선정목록으로

An Adjoint Method for High-Resolution EPMA Based on the Spherical Harmonics (PN) Model of Electron Transport

간접 관련 화학·수지 · (21) 에폭시수지 (14) 드라이 필름(포토레지스트)(15) 디스플레이 패널재료(16) CPI(투명 폴리이미드)

기본 정보

저자
  1. Tamme Claus — ACoM, Applied and Computational Mathematics, RWTH Aachen University, Aachen, Germany
  2. Gaurav Achuda — GFE, Central Facility for Electron Microscopy, RWTH Aachen University, Aachen, Germany
  3. Jonas Bünger — ACoM, Applied and Computational Mathematics, RWTH Aachen University, Aachen, Germany
  4. Silvia Richter — GFE, Central Facility for Electron Microscopy, RWTH Aachen University, Aachen, Germany
  5. Manuel Torrilhon — ACoM, Applied and Computational Mathematics, RWTH Aachen University, Aachen, Germany
DOI
10.1080/23324309.2024.2303508
저널
Journal of Computational and Theoretical Transport
발행년도
2024
발행기관
Taylor & Francis
피인용수
1
라이선스
cc-by
논문 유형
–
언어
–
원문 페이지
http://dx.doi.org/10.1080/23324309.2024.2303508
토픽
Advancements in Photolithography Techniques
OpenAlex ID
W4391897074

평가 내용

관련도
간접 관련
사업분야
화학·수지 · (21) 에폭시수지
부 분야
(14) 드라이 필름(포토레지스트), (15) 디스플레이 패널재료, (16) CPI(투명 폴리이미드)
R&D 측면
분석·모델링
확신도
0.80
근거 용어
Electron Probe Microanalysis (EPMA), chemical composition, material structure, reconstruction method, mass concentration
판단 근거
이 논문은 전자 프로브 미세분석(EPMA)을 통해 미세 영역의 화학 조성과 구조를 정밀하게 재구성하는 수학적 모델링 및 알고리즘 연구를 다룹니다. 이는 코오롱인더스트리의 에폭시, 드라이 필름, 디스플레이 소재 등 고분자 및 전자재료의 미세 구조와 성분 분석 공정에 응용될 수 있는 분석 기술입니다.
R&D 활용 포인트
고분자 복합소재, 반도체용 드라이 필름, 디스플레이용 필름의 미세 성분 분포 및 계면 구조를 정밀 분석하는 데 활용하여 제품의 품질 관리 및 물성 최적화에 기여할 수 있습니다.
평가 입력
섹션 본문 64,123자 중 30,032자 발췌

초록

Electron Probe Microanalysis (EPMA) is a nondestructive technique to determine the chemical composition of material samples in the micro- to nanometer range. Based on intensity measurements of x-radiation, the reconstruction of the material composition and structure poses an inverse problem. The reconstruction methods currently applied are based on models that assume a homogeneous or a layered structure of the studied material. To increase the spatial resolution of reconstruction in EPMA the combination of a more sophisticated reconstruction method, which is based on a model that allows complex material structure, together with multiple measurements with varying beam configurations is required. We present a deterministic k-ratio model that is based on the PN model, an approximation of the radiative transfer equation for electron transport. Our goal is to approximate a maximum likelihood solution of the inverse problem using gradient-based optimization. We detail the application of the model in the context of algorithmic differentiation, in particular by deriving its continuous adjoint formulation. Algorithmic differentiation provides the flexibility to adapt the reconstruction method to various material parametrizations and thus to regularize and take into account prior knowledge. Through examples, we verify our implementation and demonstrate the flexibility of the reconstruction/differentiation method.

본문 68,302자

본문 펼치기
Electron Probe Microanalysis (EPMA) is a nondestructive technique to determine the chemical composition of material samples in the micro-to nanometer range.Based on intensity measurements of x-radiation, the reconstruction of the material composition and structure poses an inverse problem.The reconstruction methods currently applied are based on models that assume a homogeneous or a layered structure of the studied material.To increase the spatial resolution of reconstruction in EPMA the combination of a more sophisticated reconstruction method, which is based on a model that allows complex material structure, together with multiple measurements with varying beam configurations is required.We present a deterministic k-ratio model that is based on the P N model, an approximation of the radiative transfer equation for electron transport.Our goal is to approximate a maximum likelihood solution of the inverse problem using gradientbased optimization.We detail the application of the model in the context of algorithmic differentiation, in particular by deriving its continuous adjoint formulation.Algorithmic differentiation provides the flexibility to adapt the reconstruction method to various material parametrizations and thus to regularize and take into account prior knowledge.Through examples, we verify our implementation and demonstrate the flexibility of the reconstruction/ differentiation method. Introduction Electron Probe Microanalysis (EPMA) (Heinrich and Newbury 1991;Reimer 1998) is an imaging technique used for the quantitative analysis of the composition of solid material samples at the micro-to nanometer scale. Introduction The sample is excited by a focused beam of electrons which induces multiple relaxation processes inside the sample.In EPMA, the emission of characteristic x-rays is of special focus.If an electron that is induced by the beam strikes a bound electron that occupies an atomic shell of an atom inside the specimen, the bound electron is ejected from its shell and the atom is left with a vacancy.Outer shell electrons fill this vacancy by emitting a quantized x-ray with an energy corresponding to the energy level difference of the excited (initial) and the relaxed (final) level.The energy levels of electron shells are characteristic of a specific atom, hence the energy of the emitted x-ray provides information about the composition of the material sample.Reconstructing the chemical composition from intensities of emitted x-radiation (normalized into k-ratios ðk a Þ a2A , A : measurement setups) forms the inverse problem in EPMA.In Figure 1, we outline the main physical processes that occur during an experiment. Introduction The crucial ingredient to the inverse problem of reconstruction is the definition of a model k 8 P : P !R jAj that maps parameters p 2 P � R n p (P : parameter space, n p : number of parameters) to k-ratios ðk 8 PÞðpÞ 2 R jAj (jAj : number of measurements).Then the reconstruction can be formalized as the following inverse problem: Find the set of parameters p � such that the modeled k-ratios ðk 8 PÞðp � Þ reproduce the experimental k-ratios k exp as good as possible. Introduction The applications of EPMA are manifold (Llovet et al. 2021;Moy, Fournelle, and von der Handt 2019;Pinard et al. 2013).From geology, and material scatter inside the sample and strike bound electrons that leave a vacancy (blue circle).Outer shell electrons (blue discs) fill this vacancy and release an x-ray of characteristic energy (red wobbly line).The x-ray travels through the sample and is counted by a detector.Beam electrons only excite a certain volume of the sample, the interaction volume (gray ellipses) which scales with the beam energy l � : Introduction science to electronics, researchers rely on EPMA to determine the material composition and structure of samples.Every application brings with it different prior knowledge and objectives that must be considered in the reconstruction.We subdivide our model into a k-ratio model k : ðG !R n e Þ !R jAj , q 7 !k½q� and a material parametrization P : P !ðG !R n e Þ, p 7 !PðpÞ ¼ q: Thereby q i ðxÞ is the mass concentration of element i in a compound with n e constituents at a point x 2 G: The sample domain G � R 3 will be specified later.While the k-ratio model k can handle general materials, the reconstruction can be tailored to specific applications via the material parametrization P (e.g., using prior knowledge).In particular, our definition includes reconstruction approaches currently applied in EPMA, which are however very restrictive on the material parametrizations P: ZAF-models assume homogeneity of the material inside the interaction volume of each beam.Effectively, this assumption limits the spatial resolution of EPMA to the size of the interaction volume (Buse and Kearns 2020;Carpenter and Jolliff 2015;Moy and Fournelle 2017).Reconstruction methods based on the integration of /ðqzÞ-curves currently only allow for samples that are layered in depth (Moy and Fournelle 2020).We aim to leverage a more sophisticated k-ratio model and the combination of kratio measurements from various beam positions and energies (resp.measurement setups A) to obtain a high-resolution spatial image of the material composition. Introduction In this article, we present our model for k-ratios (taken from B€ unger, Richter, and Torrilhon 2022) with a detail on the dependence on the mass concentrations q).The main part is dedicated to the derivation of an efficient and modular approach to compute the derivatives of our model, facilitating its integration into differentiable programming (Dorigo et al. 2023).We derive our differentiation approach based on the Adjoint Mode of Algorithmic Differentiation (Griewank 2003;Naumann 2011) and the Continuous Adjoint Method (Plessix 2006).The derivative forms the crucial part in the implementation of gradient-based optimization methods that find a local minimum of an objective function as a candidate solution of the inverse problem.We show the agreement of our gradient computation with finite differences and show the advantages of the adjoint method in terms of computation time.We also provide reconstruction experiments that compare different parametrizations in 1D and show a 2D reconstruction example. The inverse problem of reconstruction In theory (Stuart 2010;Tarantola 2005), the solution of the inverse problems is defined as knowledge of the posterior uncertainty of the parameters based on the likelihood of the data, which describes the uncertainty of the model and the measurement, and the prior uncertainty of the parameters. The inverse problem of reconstruction So far, we consider a Bayesian inversion of the presented problem as intractable.However, the statistical understanding interprets our approach as finding the maximum likelihood estimate under the assumption of an isotropic Gaussian likelihood.We define the reconstruction problem as the following optimization problem: The inverse problem of reconstruction a2A ððk a 8 PÞðpÞ − k exp a Þ 2 |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } ¼ðJ 8 k 8 PÞðpÞ The inverse problem of reconstruction (1) Assuming that the objective function J 8 k 8 P is differentiable w.r.t.p, gradient-based optimization methods (Steepest Descent, Conjugate Gradient, L-BFGS) (Nocedal and Wright 2006) can be utilized to iteratively approximate a local minimum p � 2 P: For an efficient application of gradient-based methods, the efficient computation of the gradient is crucial.Additionally, we require our code to remain modular, such that either different parts of the model and, more importantly, the parametrization of the mass concentrations P is exchangeable.We remark that the computation of maximum likelihood estimates can be ambiguous and ill-posed depending on the number of available measurements and the chosen parametrization.Additional prior information about the material would be necessary that could enter our minimization problem (1) as an additional regularization term Rðqð�Þ, pÞ: Regarding the ill-posedness of the inverse problem, we refer to further research and note that the addition of a differentiable regularization term is possible. The forward model The characteristic x-ray intensity model used in this article combines a model for electron transport based on the continuous slowing down approximation (CSD) of the linear Boltzmann equation (radiative transfer) with a subsequently applied model for x-ray generation and attenuation.In B€ unger (2021);B€ unger, Sarna, and Torrilhon (2022);B€ unger, Richter, and Torrilhon (2022), the model is derived in more detail.Here we derive and summarize the main equations and address the dependence on mass concentrations q in detail. K-ratios In EPMA, x-ray intensity is measured by counting all characteristic x-rays emitted by electron scattering induced by the electron beam.Because of multiple uncertain quantities concerning the experimental device, the x-ray intensity I a is normalized into a k-ratio k a using standard intensities I std a measured from a known reference sample. K-ratios Therefore, the normalization eliminates uncertain multiplicative factors that influence the intensity, e.g., the detector efficiency. K-ratios An experiment yields multiple k-ratios.Each k-ratio corresponds to a specific x-ray transition and a specific experimental setup, e.g., the beam position, energy or angle.To distinguish between k-ratios, we use a ¼ ða L , a B Þ 2 A to denote a multi-index, that contains all information about the transition a L and the beam setup a B . K-ratios a ¼ðZ i 2 fZ 1 , Z 2 , :::, Z n e g, I 2 fK, L1, :::, M1, :::g, F 2 fL1, :::, M1, :::g, |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } K-ratios The individual symbols are the atomic number Z i 2 a L , the initial (excited) I 2 a L and the final (relaxed) F 2 a L x-ray level of the electron-transition, 1 the mean and variance of the beam's position ðl x, beam , R x, beam Þ 2 a B , of the beam's energy ðl �, beam , R �, beam Þ 2 a B and the mean and concentration parameter of the beam's direction ðl X, beam , j X, beam Þ 2 a B : Characteristic X-ray emission model Based on mass concentrations q, we aim for a generic model for k-ratios k a which, according to the usual definition in EPMA, are computed as the ratio of a measured I a and a standard intensity I std a : Characteristic X-ray emission model Both intensities can be computed from the same model, only the underlying mass concentrations, q resp.q std a , changes.Neglecting multiplicative factors that cancel due to the normalization with standard intensities I std a , we formulate the intensity of characteristic xrays I a as the integral of the attenuation field A a , the number of atoms N a and the generation field of characteristic x-rays I a over a domain G � R 3 of the sample which is chosen such that G covers the support of I a , i.e., I a ðxÞ ¼ 0 8x 2 R 3 n G: Characteristic X-ray emission model 1 In IUPAC notation (Jenkins et al. 1991), an x-ray level corresponds to an electron configuration that is typically described by the removal of an electron from the configuration of neutral ground state (e.g., K, L 2 ).A characteristic x-ray is emitted by transitioning from an initial to a final x-ray level, namely the x-ray transition (e.g., K − L 2 ). Characteristic X-ray emission model The attenuation field A a describes the intensity reduction of generated x-rays while traveling through the sample toward the detector.Attenuation is quantified by Beer-Lamberts law where the attenuation coefficient l a is the weighted sum of mass concentrations q i and mass attenuation coefficients s a, i : 2 Characteristic X-ray emission model In ( 6) the integration domain is the straight line lðx, x d Þ � G from a point x 2 G toward the detector position x d 2 @G, such that the line lðx, x d Þ lies inside the domain G. Neglecting the part outside the domain G assumes that xrays travel unattenuated in the vacuum surrounding the material sample. Characteristic X-ray emission model The number of atoms N a (per unit volume) is given by the division of the mass concentration field q i by the atomic mass A a of the element Z i 2 a: Characteristic X-ray emission model The third factor that influences the x-ray intensities I a is the field of characteristic x-ray generation. Characteristic X-ray emission model It contains the electron fluence w a ðx, �, XÞ ¼ jvð�Þjf ðx, �, XÞ (vð�Þ : electron velocity, f ðx, �, XÞ : number density of electrons) of beam electrons at x 2 G with energy � 2 E ¼ ½� cut , � max � into direction X 2 S 2 inside the material probe which is weighted by the x-ray production cross-section r a : 3 The energy interval E is defined by the cutoff energy � cut , which is chosen so small that no more ionization can occur, and � max , which is chosen sufficiently large to capture all beam electrons. 2 In the literature the mass attenuation coefficient is commonly denoted using ðl=qÞ a, i : It depends on the medium i and the x-ray wavelength a.For brevity of notation, we write s a, i : 3 For x-ray transitions a L where the initial state is K, the x-ray production cross-section can be replaced by the ionization cross-section of the K shell (k-ratio normalization eliminates the fluorescence yield).For other transitions, e.g.L or M as the final state, the x-ray production cross-section should include the ionization crosssection of all lower shells weighted by transition probabilities. 2 Describing the electron fluence w a forms the most difficult part of modeling the emission of characteristic x-rays for inhomogeneous samples.We detail our model for the electron fluence w a in the following section. Deterministic electron transport model The dynamics of the beam electrons are described by a linear Boltzmann equation, an integro-differential equation describing the evolution of electron number density in phase-space (position-velocity space), whereby the physical processes governing the evolution of the electron number density are free-flight phases interrupted by elastic and inelastic collisions with atoms of the material probe.Since the timescale of the physical processes is very small in comparison to the duration of the experimental measurements of x-ray intensities, it is valid to neglect the time dependence and assume a steady-state distribution of beam electrons immediately after switching on the electron beam.Furthermore, as inelastic scattering crosssections are highly peaked around small energy losses, i.e., electrons most probably lose a significant amount of energy in a sequence of small energy losses, it is common in EPMA to model the energy loss of projectile electrons as a continuous deceleration along the trajectory.These simplifications lead to modeling the beam electrons by the Boltzmann equation of electron transport in continuous slowing down (CSD, resp.BCSD) approximation -an evolution equation in energy space given by (Larsen et al. 1997) Deterministic electron transport model where the energy loss is governed by the stopping power S and the scattering operator Q accounts for elastic and inelastic collisions (CSD-average).Both, the stopping power S and the scattering operator Q are derived from cross-sections for compounds, which are defined by means of the additivity approximation.We use the cross-sections from Salvat et al. (2007) that are also used in B€ unger (2021); Olbrant (2012).Assuming a well-defined atomic mass, we can write both as the sum of atomic quantities S i and Q i 4 weighted by mass concentrations q i .S q ½ � ðx, �Þ ¼ Deterministic electron transport model X n e i¼1 q i ðxÞS i ð�Þ (10) Deterministic electron transport model 4 Deterministic electron transport model For brevity of notation we divide both quantities by the respective atomic masses. Deterministic electron transport model The BCSD model describes the evolution of the electron fluence w a in energy space and consequently needs to be equipped with initial and boundary conditions.As the evolution is prescribed from high to low energies an initial condition defines the electron fluence at the maximal energy � max w a ðx, � ¼ � max , XÞ ¼ w a, 0 ðx, XÞ ¼ 0: Deterministic electron transport model (12) Deterministic electron transport model We will initialize the electron fluence at an energy � max sufficiently larger than the mean beam energy l �, beam by w a, 0 ðx, XÞ ¼ 0 and model the electron beam by boundary conditions.The electron transport model can be equipped with Dirichlet-type boundary conditions by prescribing the incoming half of the electron fluence at the boundary Deterministic electron transport model where n denotes the outward-pointing normal-vector at x 2 @G and w a, in is a given distribution of incoming particles.We model electron beams by a product of Gaussian distributions in space and energy together with a von-Mises-Fisher distribution in direction.An electron beam that is aligned with the outward-pointing normal n of the polished material surface and focused onto the point l x, beam 2 @G is modeled by Deterministic electron transport model where N a, x ðxÞ is the probability density function of a Gaussian with mean l x, beam 2 a and covariance R x, beam 2 a: Respectively the distribution in energy N a, � ð�Þ (Gaussian with mean l �, beam 2 a and variance R �, beam 2 a) and the distribution in direction F a, X ðXÞ (von-Mises-Fisher with mean l X, beam 2 a and concentration j X, beam 2 a) is defined. Spherical harmonic approximation A numerical solution of the electron transport model in Equation ( 9) is expensive due to the high dimension of phase space of w a ðx, �, XÞ and complexity of the scattering operator Q: Therefore, we employ the method of moments to derive a modal approximation of the linear Boltzmann equation.We reduce the phase space by replacing the direction X as an independent variable by a small set of moments to model the electron fluence w.Here we consider the spherical harmonic (P N ) moment approximation (Case and Zweifel 1967;Mark 1944;Mark 1945;Seibold and Frank 2014), i.e., we approximate the electron fluence w by its series expansion in spherical harmonics Y k l : S 2 !R truncated after some finite degree l � N 2 N: Spherical harmonic approximation where the expansion coefficients are the spherical harmonic moments of the angular distribution Spherical harmonic approximation and we model the fluence through the system of evolution equations of its moments u l, k a which we refer to as the P N equations.The P N equations are obtained by weakly enforcing Equation ( 9) for w P N a on the test space spanned by spherical harmonics up to degree N. By gathering the coeffi- Spherical harmonic approximation the equation for u a can be written as F a ðu a , qÞ ¼ 0: Spherical harmonic approximation |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } ¼F a ðu a , qÞ Spherical harmonic approximation With the following definitions for A ðdÞ and Q½q�: Spherical harmonic approximation Using the method of moments, we reduced the phase space by two dimensions at the cost of replacing a scalar equation with a system of ðN þ 1Þ 2 equations.Additionally, A ðdÞ and Q exhibit structures that can be exploited to develop efficient numerical solvers.Q½q�ðx, �Þ is diagonal as spherical harmonics are eigenfunctions of the collision operator Q½q� such that the computational cost of the scattering operation grows linearly in the number of moments. Spherical harmonic approximation The transport matrices A ðdÞ inherit a sparsity pattern from the recursion relation of spherical harmonics.When ordering spherical harmonics that are odd (even) in Cartesian direction d into a vector function Spherical harmonic approximation Hence, the even (odd) moments u ½e, d� a couple with the odd (even) moments u ½o, d� a only through their spatial derivatives in direction d, which can be employed by central finite difference schemes on staggered grids (Seibold and Frank 2014). Spherical harmonic approximation We employ the boundary conditions introduced in B€ unger, Sarna, and Torrilhon (2022).The boundary conditions follow from taking half moments of the Boltzmann boundary condition (13) with odd (in direction d 2 f1, 2, 3g) spherical harmonics as weighting functions and a stabilization step that is similar to the truncation of the series expansion in (15).For a given boundary point x 2 @G with outward pointing boundary normal e d we formulate boundary conditions for the moment vector Spherical harmonic approximation The boundary conditions are given by Spherical harmonic approximation These boundary conditions are compatible with the characteristics of the P N equations ( 17) and allow us to assure energy stability, see B€ unger, Sarna, and Torrilhon (2022) for details.From (12) we derive the following initial condition for the moments u a : Spherical harmonic approximation The P N equations ( 17) describe the evolution of all ðN þ 1Þ 2 moments u a of w a , whereas the intensity model ( 8) only requires the angular average of w a because we assumed the isotropic emission of x-rays.The spherical harmonic Y 0 0 ðXÞ is constant, so we identify the moment u 0, 0 a / Ð S 2 w a ðx, �, XÞdX as part of our x-ray emission model and simplify the integral (8) to the following. Mass concentration model Typically, the quantities of interest in EPMA are weight fractions x i ðxÞ ¼ M i ðdxÞ MðdxÞ that form a partition of unity P n e i¼1 x i ðxÞ ¼ 1: In order to determine mass concentrations qðxÞ from weight fractions xðxÞ, additional assumptions are necessary.We neglect the influence of different molecular or crystal structures and assume that the compound fx 1 , :::, x n e g is formed in a volume-preserving manner.Then the total volume is VðdxÞ ¼ P n e i¼1 V i ðdxÞ ¼ M i ðdxÞ x i ðxÞMðdxÞ q pure i : We derive the following relation between mass fractions and mass concentrations. M i ðdxÞ x j ðxÞ q M i ðdxÞ with the additional constraints, that p pc i, k � 0 and 26), ( 27) forms the piecewise-constant material parametrization P pc : P !ðG !R n e Þ: In the examples, we will replace the weight fraction parametrization x pc ðxÞ to investigate other parametrizations PðpÞ: Differentiation of the forward model As described in the introduction, we consider the inverse problem as a minimization problem and apply iterative gradient-based optimization methods to find a candidate solution p � : Differentiation of the forward model Gradient-based optimization methods require the gradient of the objective function dJ dp : An efficient implementation of the gradient of our model, that simultaneously remains extensible and modular (particularly regarding the parametrization) is a challenge.While automatic algorithmic differentiation tools have the potential to transform any numerical code, the current versions of AD tools in julia (Zygote.jl,ReverseDiff.jl)cannot be applied to our model due to memory limitations and lack of performance. Differentiation of the forward model In the following, we present a method, that adopts the structural implementation of derivative code of numerical code from algorithmic differentiation (AD).We focus on the adjoint mode of AD, since we are mainly interested in the gradient of the scalar objective function.The advantage of the adjoint mode is that it scales with the number of outputs, whereas with numerical differentiation (finite differences) or the tangent mode of AD, the complexity scales with the number of inputs.Also, the analytical derivation of our method provides a clear understanding that facilitates its memory-efficient implementation. Differentiation of the forward model The core idea of AD is to base the derivative computation on local function transformations that are automatically composed.This also achieves modularity, i.e., if a particular function is modified, only the corresponding transformation needs to be adjusted. Adjoint algorithmic differentiation Algorithmic differentiation (AD) (Burghardt et al. 2022;H€ user 2022;Innes 2018;Kreyszig 1991;Naumann 2011) defines a framework to compute derivatives of numerical program code.In contrast to symbolic or numerical differentiation (finite differences), algorithmic differentiation is without approximation error and modular, so the code remains extensible.Also, the automatic differentiation of numerical code is possible.We review the basic definitions of AD with a (unusual) focus on high/infinite dimensional spaces.Alongside a motivating example, we describe the systematic composition into code that is able to compute derivatives. Adjoint algorithmic differentiation Consider a differentiable function f : U � X !Y, x 7 !f ðxÞ ¼ y, where X and Y are Hilbert spaces and U is the open domain of f.Given an input x 2 U, we define the tangent operator @f ðxÞ @x ½�� : X !Y as the linear bounded operator that satisfies Adjoint algorithmic differentiation Additionally, given a tangent _ x 2 X of the input, we define the tangent _ y of the output by Adjoint algorithmic differentiation Given the tangent operator @f ðxÞ @x ½��, the corresponding adjoint operator Adjoint algorithmic differentiation where h�, �i X and h�, �i Y are the respective inner products of X and Y. Adjoint algorithmic differentiation Similarly to the tangent, given an adjoint � y 2 Y of the output, we define the adjoint � x of the input by Adjoint algorithmic differentiation Consequently, the identity h� y, _ yi Y ¼ h� x, _ xi X holds for all _ x 2 X and � y 2 Y: Adjoint algorithmic differentiation In real, finite dimensional spaces (e.g., Adjoint algorithmic differentiation ), the tangent operator can be represented by the Jacobian Df ðxÞ 2 R m�n and the adjoint operator by its transpose Df ðxÞ T 2 R n�m : For examples in infinite dimensional (function) spaces, we refer to Sec. 3.2. Adjoint algorithmic differentiation The core idea of AD is to subdivide a function into individual subfunctions (with individual tangent and adjoint operators) and intermediate variables (with intermediate tangents and adjoints).As an example, consider the following decomposition of f : U ! Y, x 7 !f ðxÞ ¼ y into two subfunctions g : U ! V and h : V � U ! Y where we use an intermediate variable v 2 V (V is another Hilbert space). Adjoint algorithmic differentiation Given x 2 U, v 2 V and y 2 Y as well as an input tangent _ x 2 X, the tangent _ y of is given by Adjoint algorithmic differentiation where we employ the chain rule to split the tangent operator of f into a combination of tangent operators of g and h.Additionally, we identify the tangent _ v of the intermediate variable.To find the corresponding adjoint operator, we successively use adjoint operators of the subfunctions g and h to isolate _ Adjoint algorithmic differentiation x in the inner product identity Adjoint algorithmic differentiation To summarize, given the adjoint � y 2 Y, the adjoints � v and � x are Adjoint algorithmic differentiation Based on the chain rule, the composition of individual tangent and adjoint operators of a larger decomposition into an algorithm to compute the derivative is very systematic and can be implemented automatically.We describe the methodology using an arbitrary decomposition of a function f : x 7 !f ðxÞ ¼ y with n inputs and m outputs into subfunctions / i¼1, :::I : Adjoint algorithmic differentiation With ðv j Þ j�i we denote all predecessors of v i , i.e., all intermediate variables v j that v i directly depends on, and with ðv j Þ j�i we denote all successors of v i .Tangent mode AD is the successive computation of tangents Adjoint algorithmic differentiation Given an input tangent _ x, a tangent _ v i represents the directional derivative of v i into direction _ Adjoint algorithmic differentiation x: Note that the tangent mode follows the sequence of operations in the evaluation of the primal.In adjoint mode AD, the sequence of operations is reversed.To compute an adjoint � v i , we consider the adjoints ð� v k Þ k�i of all intermediate variables, that depend on v i . Adjoint algorithmic differentiation Usually, in AD literature the single assignment code is considered, where all intermediate variables v i 2 R are scalar, and the tangent operators (resp.multiplication with a scalar) is self-adjoint.Then the � � can be neglected.For real multivariate intermediate variables the adjoint is the transpose � � ¼ � T : Adjoint algorithmic differentiation We briefly comment on some aspects of AD: Adjoint algorithmic differentiation Computational Complexity: Implementations of tangent and adjoint mode AD differ in algorithmic complexity.The Jacobian of a function f : R n !R m is obtained using tangent mode AD by j ¼ 1, :::, n successive executions of (38) where the input tangents are seeded with unit vectors _ Adjoint algorithmic differentiation x ¼ e j : Elements of the Jacobian are then retrieved from ðDf ðxÞÞ ij ¼ _ y i _ x¼e j : Adjoint algorithmic differentiation In contrast to the tangent mode, using adjoint mode AD the Jacobian is obtained by i ¼ 1, :::, m successive applications of (39) where the output adjoints are seeded with unit vector � y ¼ e i : Elements of the Jacobian are then retrieved from ðDf ðxÞÞ ij ¼ � x j � y¼e i : Adjoint algorithmic differentiation Hence, to compute the full Jacobian, an implementation of tangent mode scales in the number of input variables while the adjoint mode scales in the number of output variables.Modularity and Extensibility: An implementation of either tangent or adjoint mode AD is modular and extensible.It consists of a systematic composition of individual tangent and adjoint operators.For example, changing one subfunction in (37) only affects its corresponding tangent and adjoint operator in (38) resp.( 39).Implementations of the other operators remain.Computational Graph: Both modes of AD can be visualized using a computational graph consisting of vertices for each variable (input, output, intermediate) and directed edges for direct dependence of variables.Assume a labeling of the edges with their corresponding tangent/adjoint operator applied to the tail(tangent)/head(adjoint) of the edge.The tangent is defined as the sum of all incoming edge tangent operators, while the adjoint is defined as the sum of all outgoing edge adjoint operators (c.f.Equations ( 38) and ( 39)).Checkpointing -Adjoint Memory Consumption: While the tangents can be implemented alongside the execution of the primal function and intermediate primal variables (x, v) are available, they must be kept in memory for the computation of adjoints.Storing all intermediate variables is expensive.Checkpointing remedies the high memory consumption by recomputing certain intermediate variables while computing the adjoint operators.In the example (36), the primal v ¼ gðxÞ would be recomputed while evaluating the adjoint of h. Adjoint algorithmic differentiation Our model includes the special case, that the mapping from qðxÞ to u a ðx, �Þ is given implicitly by the PDE in Equation ( 17).We state the two basic steps of calculating adjoints in implicit relations and refer to the Appendix A for a more detailed derivation.Consider the implicit definition Fðy ¼ gðxÞ, xÞ ¼ 0 (with differentiable F(y, x)), where we assume that it uniquely defines the differentiable mapping y ¼ gðxÞ: We introduce an additional intermediate adjoint variable � F: Then, given the adjoint � y of the output, the adjoint � x of the input can be computed from Adjoint algorithmic differentiation without explicit definition of � x ¼ @gðxÞ @x � ½� y�: Differentiation method for our model In the following, we will successively define adjoint operators for the individual parts of the model described in Sec. 2. All derivations follow the same scheme: First, we define the tangent operator using the directional derivative and second we derive the adjoint operator from the inner product identity.We will elaborate on complex derivations and only state the adjoint operator for simple ones.In this paper, the only relevant derivatives are with respect to the mass concentrations q, hence all quantities that do not depend on q are treated as constants and their adjoints are omitted. Differentiation method for our model Compared to the forward computation, adjoints are computed in reversed order.We follow this behavior while deriving the adjoint operators for the individual dependencies.For brevity of notation we omit the accumulation of adjoints (tangents) and respectively only consider the operators that describe the direct propagation.The accumulation becomes apparent in the high-level computational graph in Figure 2. If multiple edges leave a node, the adjoints of all outgoing edges have to be summed up. Differentiation method for our model � J� : The final operator (1) of our model computes the squared error J from a set of simulated k-ratios k a , a 2 fa 1 , :::g: Given the adjoint � J, which for the computation of derivatives @J @� must be chosen � J ¼ 1, the definition of the adjoint operator of the squared error from Differentiation method for our model � � k a � : Also the adjoint operator for normalization with standard intensities in Equation ( 4) is derived by simple means. Differentiation method for our model We elaborate on the adjoint operators derived from Equation (5).Linearity of the integral in (5) directly yields the tangent _ I a : Using the standard definition of the inner products in R, ha, bi R ¼ ab and in L 2 ðGÞ, ha, bi L 2 ðGÞ ¼ Ð G a T ðxÞbðxÞdx we derive adjoints � A a , � N a and � I a : We detail � A a : � N a ðxÞ ¼ A a ðxÞI a ðxÞ � I a and � I a ðxÞ ¼ N a ðxÞA a ðxÞ � I a (44) Differentiation method for our model � ½� q ¼ @N a @q � � N a � : From Equation ( 7), we find the adjoint operator. Differentiation method for our model � ½� q ¼ @A a @q � � A a � : Deriving the adjoint from the attenuation given in ( 6) requires more analysis.The tangent of the absorption operator A _ a ½q�ðxÞ is given by the directional derivative into direction _ qðxÞ: Differentiation method for our model By inserting the tangent A _ a into the definition of the adjoint (31), we derive the adjoint of the attenuation operator.In the following derivation, we rewrite the line integral from ( 46) as an integral over the whole space G by introducing dðdðx, x d , yÞÞ to denote the Dirac, that indicates the line segment lðx, x d Þ: So dðx, x d , yÞ denotes the distance of y to the line segment lðx, x d Þ between x and x d . Differentiation method for our model By swapping the order of integration dydx to dxdy, we are able to separate _ q i , but the interpretation of dðdðx, x d , yÞÞ changes.For a given y, dðdðx, x d , yÞÞ now indicates the points x of all lines lðx, x d Þ that contain y.In other words: dðdðx, x d , yÞÞ indicates the line lðy, x d � Þ from y to the point reflection x d � 2 @G of x d 2 @G at x 2 G: Exemplarily, we illustrate lðx, x d Þ, lðx, x d � Þ and dðx, x d , yÞ in Figure 3. From (47), we identify the adjoint operator of (6). Differentiation method for our model Where the integration domain lðx, x d � Þ is the line between x and reflection x d � of x d at x. 25), the only relevant moment for the ionization field I a is u ð0, 0Þ a , hence the adjoint � u a : Differentiation method for our model � ½� q ¼ @u a @q � � u a � : The relation between q and u a is implicitly given by the P N equations and the boundary conditions, i.e., by the implicit PDE operator F a ðu a , qÞ ¼ 0 (17).We describe the derivation of the adjoint operators (40) for the P N equations.For a detailed derivation of (40) we refer to the Appendix A. Let us introduce the auxiliary adjoint � F a and derive the operators @F a @u a � ½�� and @F a @q � ½�� in the following.Successively, both operators form the adjoint @u a @q � ½��: In particular, we elaborate on the identities Differentiation method for our model (50) � ½ @F a @u a � � F a ¼ � u a � : The adjoint operator @F a @u a � applied to � F a describes the continuous adjoint equation. S q ½ � ðx, �Þ@ � � F a ðx, �Þ − S q |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } S q In analogy to the reversed application of adjoint operators, the adjoint equation describes the evolution of the adjoint � F a in reversed direction (w.r.t. the energy �).Initial and boundary conditions follow from the derivation. S q Derivation Linearity of F a in u a directly yields the tangent @F a @u a _ u a : Using integration by parts and symmetry of A ðdÞ and Q, we obtain S q |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } S q The last two terms in (54) vanish due to the initial and boundary conditions imposed to _ u a and � F a : The former term is zero because of the conditions _ u a ð�, the integrand in ( 56) is zero because S q ðdÞ ÂðdÞ Þ |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } S q Using that L ðdÞ ¼ L T ðdÞ , defined in ( 23), is symmetric.� ½� q ¼ − @F a @q � � F a � : The tangent @F a @q _ q follows directly from linearity of F a (and S and Q) in q.For the adjoint we find S q ::: S q and identify S q The adjoint of the mass concentration model ( 26) can again be derived by simple means.� x pc i ðxÞ ¼ q tot ðxÞq i ðxÞ − q 2 tot ðxÞ q pure i X n e k¼1 S q x k ðxÞ� q k ðxÞ (60) S q x pc � : The indicator functions in ( 27) lead to a partitioning of the integration domain G into G k for the � p i, k : S q This completes the derivation of adjoint formulations for all parts of the model presented in Sec. 2. Note that for nonlinear operators, the primary result is required to calculate the adjoint, and therefore must be saved during the forward execution or recalculated.This is analogous to discrete adjoint tools.Furthermore, all derived operators are modular and only need to be assembled according to the computational graph.When replacing parts of the model, only the corresponding adjoint operator needs to be adjusted.In the examples in Sections 4.3 and 4.4, we will use this modularity and exchange the parametrizations P: Computational effort The motivation for deriving and implementing the adjoint formulation of our model is that of the efficiency advantage over finite differences and the tangent mode of AD.Our implementation inherits the runtime complexity of the adjoint mode, as the runtime of a Jacobian calculation scales in the number of output variables of the primal.The price to pay for faster execution is the higher memory requirement since all primal variables have to be stored during forward execution or recalculated later. Computational effort Leveraging the convenience of automated AD tools to derive the discrete adjoint code of our implementation was not possible with current tools in julia.However, our approach somewhat mimics the development approach that tools, e.g., Zygote.jl or ChainRulesCore.jltake.Instead of implementing only tangent and adjoint versions of low-level operations, they aim for efficient implementations of high-level methods.We adopt this approach and derive an adjoint version in the continuous framework and implement discretized versions of the operators in code. Computational effort The high-level view offers further insight, and one more possibility to reduce the computational effort for the gradient.Note that the naive adjoint implementation requires jAj "solves" of the adjoint PDE (same amount as the forward).We separate the multi-index into a ¼ ða L , a B Þ 2 A L � A B where a L describes the k-ratio line (material, transition) and a B the beam setup (position, energy).We revisit Equations (44)( 49) and ( 51).We realize that the only dependence of all equations from a B is due to the scalar � I a : Instead of computing � I a , � u a and � F a , we consider Computational effort � I a and eliminate thereby the dependence from the beam setup a B .The operators for Ĩ a L , ũa L and Fa L do not depend on a B .The accumulation of the adjoint � q i (cf.Equation ( 59), where we sum over all incoming edges in the computational graph 2), can then be rewritten to Computational effort Instead of solving the adjoint PDE for every � F a it is sufficient to compute Fa L for every a L .The number of expensive adjoint PDE solves that are required is reduced from jAj to jA L j: Numerical examples Preliminary results for the examples presented in section 4.3 and 4.4 can be found in (Achuda et al. 2023). Implementation and discretization Conceptually the discretization of the P N -equation ( 17) and the adjoint P Nequation ( 51) are the most challenging.For the numerical computation of the moments u a and � F a we implemented a 3D staggered grid finite-difference method based on the method StaRMAP presented in (Seibold and Frank 2014).StaRMAP is specifically designed to exploit the structure of P N -equations.Individual sets of moments u a are discretized on the staggered grids in such a way, that sparsity of the transport matrices A ðdÞ decouples the system and enables the use of second-order central differences that approximate the spatial derivative on the respective displaced grid.Second-order integration in energy is achieved using a splitting of the moments and half steps for each part of the solution. Implementation and discretization The boundary conditions in ( 22) and ( 53) are used to compute moments on ghost nodes, located outside the computational domain G. Values of the moments for ghost nodes are set, such that the boundary condition holds for interpolated moments on the boundary of the domain @G: For details see B€ unger (2021). Implementation and discretization For integrations in energy and space as well as the line integral for the absorption we use the trapezoidal rule. Comparison: sensitivities of a 1D material with finite differences We consider a binary material consisting of copper Cu and nickel Ni and compare sensitivities @I a @p computed using our implementation (resp.� p where � I a is seeded with unit vectors) with sensitivities computed by central finite differences.By means of this comparison of our implementation to finite differences we address several questions at the same time: Comparison: sensitivities of a 1D material with finite differences � By introducing a second parametrization, we exemplarily show the modularity of our implementation.� We provide insight into the nature of the model.The sensitivity @I a @p is the linear approximation of intensities with respect to model parameters, hence a large sensitivity relates to a strong dependency and a small sensitivity to a weak dependency.This is particularly interesting for the inverse problem because it also unveils possible difficulties in the reconstruction.� Agreement with finite differences validates our implementation.� We demonstrate the claimed superiority of our method compared to finite differences in terms of computation time. Comparison: sensitivities of a 1D material with finite differences We introduce an alternative parametrization, where K k ðxÞ, k 2 f1, :::n k g are triangular functions covering the domain G, in particular Comparison: sensitivities of a 1D material with finite differences The partition of unity P n e i¼1 x i ðxÞ ¼ 1 is (again) guaranteed by p pl i, k � 0 and P n e −1 j¼1 p pl j, k � 1: We refer to the parametrization as piecewise-linear. Comparison: sensitivities of a 1D material with finite differences The adjoint of the piecewise-linear parametrization � p pl is given by Comparison: sensitivities of a 1D material with finite differences Modularity is set out by the fact, that only the parametrization and its adjoint are implemented, the rest of the code remains unchanged.Now both parametrizations, the piecewise-constant parametrization (with n k ¼ 20 parameters) and the piecewise-linear parametrization (also with n k ¼ 20 parameters) are employed to compute sensitivities @I a @p pc resp.@I a @p pl : The physical setup and the settings of the P N approximation for this example can be found in Table 1.Parameter values for the parametrizations are sampled independently from a uniform distribution in ½0, 1�: Comparison: sensitivities of a 1D material with finite differences We visualize the sensitivities by plotting x pc 1 ðxÞj p¼ @Ia @p pc and x pl 1 ðxÞj p¼ @Ia @p pl in Figure 4. Using the parametrizations xðxÞ is gentle abuse but since the parameters in x pc and x pl are related to space points, an interpretation of the plot is possible.Increasing a parameter, increases the mass concentration of Cu and simultaneously decreases the mass concentration of Ni, hence the positive values for Cu x-rays and the negative value for Ni x-rays.In depth the sensitivity decreases because with greater depth the generation of x-rays decreases and the absorption increases.Figure 4 also compares sensitivities computed by our method (colored, solid lines) with the sensitivities computed by central finite differences (black, dashed lines).The curves coincide.Additionally, we compare relative errors Comparison: sensitivities of a 1D material with finite differences of sensitivities in Table 2. Derivatives computed by algorithmic differentiation are exact (AD computes the exact derivative of the numerical approximation up to machine precision) (Naumann 2011).Our method as well as finite differences only provide approximations of the derivative.For A visualization of the sensitivities computed using our method and finite differences. Comparison: sensitivities of a 1D material with finite differences We abuse the parametrization function of each parametrization and plot x 1 ðxÞj p¼ @Ia @p : The curves computed using our method (solid lines) coincide with the curves computed using finite differences (black dashed lines).A quantitative comparison of sensitivity values is given in Table 2. Comparison: sensitivities of a 1D material with finite differences our method, the underlying approximation of the adjoint state variable introduces errors, for finite differences the approximation error originates from the perturbation h. Comparison: sensitivities of a 1D material with finite differences In Table 3, the superiority of our method in terms of computation time compared to finite differences becomes apparent.We compare the runtime of a central finite difference method (2nd order) with our implementation for two different numbers of parameters (n p ¼ 20 and n p ¼ 40).The runtime of the forward model is � 0:5s, and the computation of the derivative with finite differences clearly scales with the number of parameters n p .The runtime of our implementation scales in the number of outputs (here jAj ¼ 4) and clearly does not scale with n p .Note the minor overhead because of the backward execution. 1D reconstruction of a sharp and a diffusive interface We present the reconstruction of a coated material consisting of iron Fe and nickel Ni with a sharp (discontinuous) and a diffusive (continuous) interface between the layers. 1D reconstruction of a sharp and a diffusive interface � We show the necessity of choosing a suitable parametrization.� We compare the previously defined parametrizations (( 27) and ( 63)) to an additional non-linear parametrization (66) 1D reconstruction of a sharp and a diffusive interface We introduce another parametrization that is based on the non-linear structure of a neural network (with x as the input and x nl as the output.The activation function for one hidden layer is tanhðÞ and sigðÞ for the output layer to enforce 0 � x nl i � 1).The parametrization uses n p ¼ 10 parameters, which we call p nl ¼ ða 1 , a 2 , a 3 , b 1 , b 2 , b 3 , â1 , â2 , â3 , bÞ T : 1D reconstruction of a sharp and a diffusive interface |ffl ffl ffl ffl {zffl ffl ffl ffl } 1D reconstruction of a sharp and a diffusive interface x nl 1 ðxÞ ¼ sigð 1D reconstruction of a sharp and a diffusive interface |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } ¼ŵðxÞ Þ (66b) 1D reconstruction of a sharp and a diffusive interface The adjoints for the non-linear parametrization are given in the following. 1D reconstruction of a sharp and a diffusive interface For a fair comparison, the number of parameters in the other parametrizations is also chosen to be 10.For the binary material the scalar x 1 ðxÞ completely describes the material, because x 2 ðxÞ ¼ 1 − x 1 ðxÞ: 1D reconstruction of a sharp and a diffusive interface The artificial measurements for the reconstruction are k-ratios from multiple different beam energies between 9 keV and 15 keV: To compute the measurements we assume the reference material to be given.Additional P N model settings and the considered x-rays are tabulated in Table 4.We choose the BFGS method implemented in Optim.jl(Mogensen and Riseth 2018) as optimization method (with additional box-constraints for the piecewise-constant and the piecewise-linear parametrization, and no constraints for the non-linear parametrization). 1D reconstruction of a sharp and a diffusive interface In Figure 5, the reconstructed density of the material with a sharp interface is visualized using the different parametrizations.From initial configurations (piecewise-constant, piecewise-linear: 0.5 Fe and 0.5 Ni; non-linear: random) the parametrizations iterate toward the reference density (black line) during the optimization.We visualize the initial, first, fifth iteration and the 100th iteration.The inability of the piecewise-linear parametrization to represent discontinuities becomes apparent.However, the piecewise-constant parametrization only approximates perfectly because one of the subdomain interfaces matches the interface of the reference material.On the other hand, the non-linear parametrization is flexible enough to identify the location of the interface and to approximate the discontinuity. 1D reconstruction of a sharp and a diffusive interface In Figure 6, the reconstructed density of the material with a diffusive interface is visualized.Except for the reference material, exactly the same settings as for the reconstruction of the sharp interface are used.Again, the parametrizations iterate toward the reference density (black line).For the diffusive interface, none of the parametrizations can reconstruct the interface perfectly, but the piecewise-linear and the non-linear parametrizations perform better than the piecewise-constant parametrization.In Figure 7, we visualize the normalized error, the value of the objective function jjkðpÞ − k exp jj 2 , the error of the mass concentrations jjqðxÞ − q true jj 2 and the error of additional k-ratio measurements jjk þ ðpÞ − k exp þ jj 2 (with beam energies 11 keV and 14 keV) during the iterations of the optimization.The kinks in the error of the objective function are an artifact of the Optim.jlimplementation.Their default implementation is based on the combination of a line search method (Hager and Zhang 2005) and the BFGS algorithm presented in (Nocedal and Wright 2006). 1D reconstruction of a sharp and a diffusive interface Differences in the performance of the different parametrizations are clearly visible.The error in the mass concentrations for the piecewise-constant parametrization for the sharp interface is by far the smallest, due to the possible perfect reconstruction.Only the non-linear parametrization performs similarly well for both examples. 1D reconstruction of a sharp and a diffusive interface Comparing the error in mass concentrations for piecewise-constant and piecewise-linear parametrization for the sharp and the diffusive interface, they vary.A correlation between the error in mass concentrations and the error of additional k-ratios would be beneficial but is hard to obtain visually.Ideally, both would behave similarly, because then we could propose the error in additional k-ratios as a suitable reconstruction quality measure.However, the evaluation of reconstruction quality measures is beyond the scope of this work and is deferred to further research. 2D reconstruction of an ellipsoidal inclusion We describe the use case of a reconstruction of an ellipsoidal copper Cu inclusion in an iron Fe substrate from k-ratios obtained from a 12 keV electron beam and multiple beam positions.In Figure 8, we plot k-ratios obtained from an artificial line-scan of the inclusion.Only the ten k-ratios retrieved from five beam positions l y ¼ f−50, −25, 0, 25, 50g nm, which are marked by black crosses, are used for the reconstruction.To compute the k-ratios, the reference material is assumed to be given.We visualize the total density q tot of the reference material in Figure 9 and additionally show the ionization distributions of ðCu, K − L 2 Þ and ðFe, K − L 2 Þ that define the size of the interaction volume.The ellipsoidal Cu inclusion is clearly smaller than the interaction volumes.Additional settings of the k-ratio model are shown in Table 5. 2D reconstruction of an ellipsoidal inclusion The profile shows an increase in the ðCu, K − L 2 Þ k-ratio for a beam position close to � 25 nm: We assume an elliptical Cu inclusion which we parametrize by p ¼ ðl 1 , l 2 , a, b, r, â, bÞ T , where l 1 and l 2 specify position, a 2D reconstruction of an ellipsoidal inclusion And their adjoint 2D reconstruction of an ellipsoidal inclusion For the reconstruction, we use the L-BFGS algorithm implemented in Optim.jl(Mogensen and Riseth 2018).The total density of the material q tot during the iteration steps is visualized in Figure 10.From the initial guess (educated guess: higher copper concentration at x 30 nm, see Figure 10(a)) the reconstruction converges to the reference material (see Figure 9(a)).Alongside the total density of the reconstructed material, we visualize the k-ratio profiles of ðCu, K − L 2 Þ and ðFe, K − L 2 Þ in Figure 11.The shapes of the curves quickly coincide with the measured k-ratios (black crosses).At iteration 30 the measured k-ratios are already well approximated, the total density, however, is not.For sufficient reconstruction of the ellipsoidal structure, the error in the k-ratios (the objective function) must be further reduced.In Figure 12, we show the value of the objective 2D reconstruction of an ellipsoidal inclusion function jjkðpÞ − k exp jj 2 and the error in mass concentrations jjqðpÞ − q true jj 2 during the iterations of the optimization.For the first 50 iterations, the value of the objective function decreases, whereas the error in the mass concentrations remains close to the initial error.Only after the first 50 iterations, the error in the mass concentrations also decreases.In Figure 10, this effect is also observed, where only after iteration 90 the shape of the reference ellipse starts to form. Conclusion In this paper, we derive an adjoint approach to compute derivatives for a deterministic k-ratio model to be applied in reconstruction in EPMA.The k-ratio model is based on the P N -model, a moment expansion of the continuous slowing down approximation of the linear Boltzmann equation that is pioneered for EPMA in B€ unger, Richter, and Torrilhon (2022).We formulate the model with a focus on the inverse problem and describe the application of the model within an adjoint algorithmic differentiation framework.This work thus represents a building block in the development of a high-resolution reconstruction method that uses gradient-based optimization techniques.By replacing material parametrizations, experiments can be realized that reconstruct different material parameters and take into account different prior knowledge.We conclude the paper with a validation of our differentiation method and reconstruction experiments.The experiments show the influence of the material parametrization in the reconstruction and illustrate our idea of an application of our method.The combination of measurements with prior knowledge makes high-resolution reconstruction problems tractable with a reasonable amount of measurement data.At the same time, we demonstrate the extensibility of our implementation to various material structures.High-resolution imaging, i.e., the reconstruction of material structures that are smaller than the interaction volume, is possible with sufficient data or sufficient material assumptions.But there will always be a balance between the accuracy of the measurement and the model to the accuracy of the reconstruction.Especially for high resolution, the analysis of this relation is key.To achieve a reliable reconstruction result, the quantification and propagation of measurement and model uncertainties are necessary. Appendix A. Adjoint continuous implicit differentiation Consider the implicit definition: Given x 2 X, find y 2 Y such that Fðy ¼ gðxÞ, xÞ ¼ 0: We refer to the implicit function with y ¼ gðxÞ and assume that it is unique at x.Given a (tangent) direction _ Appendix A. Adjoint continuous implicit differentiation x, we realize that the directional derivative of F in direction _ x does not change.Employing the chain rule we find the following. @ @h Fðgðx þ h _ xÞ, x þ h _ xÞ h¼0 ¼ @Fðy, xÞ @y @gðxÞ @x _ @ @h We consider the previous statement in a weak sense, meaning we test the constraint with � F 2 T, where T is an appropriate space. @ @h � F, @Fðy, xÞ @y @gðxÞ @x _ @ @h We identify the tangent of y with _ y ¼ @g @x _ x ½ � and use adjoint operators @F @y � ½�� and @F @x � ½�� of the tangent operators @F @y ½�� and @F @x ½�� to derive the following.Comparing ( 72) with the definition of the adjoint (31) h� y, _ yi Y ¼ h� x, _ xi X we derive the two steps for the implicit adjoint.Given � y 2 Y, if we can find � F 2 T such that (73a) holds, the required adjoint � x is given by (73b).@Fðy, xÞ @y Example We consider the Poisson-equation in 2D with homogeneous (Dirichlet) boundary conditions.Given a domain X � R 2 with n 2 X and x : X !R a suitable right-hand side.The primal problem is to find y : X !R with yðnÞ ¼ 0 8n 2 @X such that Fðy, xÞ ¼ Dyð�Þ − xð�Þ ¼ 0: Example (74) Example To derive the adjoint, we first analyze the left-hand side of (72).Using integration by parts twice, we derive the adjoint operator @F @y � ½��: h � F, @Fðy, xÞ @y _ y ½ �i ¼ h � F, D_ yi ¼ The boundary integral in (75) yields boundary conditions for the adjoint � F: Since _ yðnÞ ¼ 0 8n 2 @X, we assign � FðnÞ ¼ 0 8n 2 @X: From the right-hand side of (72) we trivially find @Fðy, xÞ @x Example Computing the adjoint � x therefore consists of the following steps.Given � yð�Þ find � Fð�Þ with � FðnÞ ¼ 0 8n 2 @X such that (77a) holds.Then, the required adjoint � xð�Þ is given by (77b) (trivial for this example). Figure 1 . Figure 1.A sketch of the physical processes in EPMA.The sample G is rastered by electron beams (blue) with different positions l x .Electrons e -from the electron beam (blue dotted line) scatter inside the sample and strike bound electrons that leave a vacancy (blue circle).Outer shell electrons (blue discs) fill this vacancy and release an x-ray of characteristic energy (red wobbly line).The x-ray travels through the sample and is counted by a detector.Beam electrons only excite a certain volume of the sample, the interaction volume (gray ellipses) which scales with the beam energy l � : Figure 1 . ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } :¼q tot ðxÞ (26) As a first possibility, we model weight fractions x pc i ðxÞ as a piecewiseconstant function.We subdivide the spatial domain G into n k 2 N disjoint subdomains G k and introduce the indicator function 1 G k ðxÞ: To guarantee the partition of unity we only use n p ¼ n k � ðn e − 1Þ parameters p pc i, k and define the parametrization Figure 1 . � I a A _ a ðxÞdx ¼ hN a ð�ÞI a ð�Þ � I a |ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl } :¼ � A a ð�Þ , A _ a ð�Þi L 2 ðGÞ (43) Accordingly, the adjoints � N a ð�Þ and � I a ð�Þ are derived. Figure 2 . Figure 2. The abstract computational graph of our model.Straight edges (bottom to top) correspond to the primal function evaluation.Bend edges (top to bottom) correspond to the adjoint evaluation and are labeled with the respective adjoint operators.Dashed boxes highlight the individual model evaluation for every experimental setup a 2 A: Note that multiple adjoint edges entering a node correspond to the accumulation of the respective adjoint operators.This is not explicitly addressed in the derivation in section 3.2. Figure 3 . Figure 3.The absorption path lðx, x d Þ ¼ fyjdðx, x d , yÞ ¼ 0g from x toward the detector position x d (solid line) and the path used for the adjoint lðx, x d � Þ ¼ fyjdðy, x d , xÞ ¼ 0g (dotted line).G is the computational domain. Figure 3 . Figure 4.A visualization of the sensitivities computed using our method and finite differences.We abuse the parametrization function of each parametrization and plot x 1 ðxÞj p¼ @Ia Figure 5 . Figure5.The reconstructed density of a material with a sharp interface between an iron Fe layer covering an Ni substrate.We use the piecewise-constant, the piecewise-linear and the non-linear parametrization for the reconstruction.For the piecewise-constant and the piecewise-linear parametrization, the geometry (interfaces) are visualized by gray vertical lines.The black line shows the reference density.All parametrizations converge.The piecewise-constant parametrization has a clear advantage because the interface aligns with an interface of the parametrization.The piecewise-linear parametrization cannot approximate the discontinuous interface, hence it converges to presented smoothed representation.The non-linear parametrization is flexible enough to identify the location of the interface and also approximates the discontinuity using a strong gradient. Figure 6 . Figure 6.The reconstructed density of a material with a diffusive interface between an iron Fe layer covering an Ni substrate.We use the piecewise-constant, the piecewise-linear and the non-linear parametrization for the reconstruction.For the piecewise-constant and the piecewise-linear parametrization, the geometry (interfaces) are visualized by gray vertical lines.The black line shows the reference density.All parametrizations converge.None of the parametrizations can represent the interface perfectly.The piecewise-linear and the non-linear parametrization perform better for this example, because of their flexibility to approximate continuous functions. Figure 7 . Figure 7.The value of the objective function and additional reconstruction quality measures during the iterations of the optimization for all parametrizations.The objective function jjkðpÞ − k exp jj 2 is visualized as a solid line.Also, the error in the mass concentrations jjqðxÞ − q true ðxÞjj 2 (dashed line) and the error of k-ratios jjk þ ðpÞ − k exp þ jj 2 (dotted line) from additional beam energies (11keV and 14keV) is plotted. Figure 8 . Figure 8.The k-ratio profile of the elliptical Cu inclusion in the Fe substrate computed using a 12 keV electron beam.Dashed lines show the k-ratio profiles of ðCu, K − L 2 Þ (blue) and ðFe, K − L 2 Þ (orange) with a high beam resolution.Black markers show the k-ratios which are used for the reconstruction.While not directly visible, the shape and height of the k-ratio curves encode information about the shape and location of the inclusion and the structure of the interface between inclusion and substrate. Figure 9 . Figure 9.The total density and two ionization distribution fields of the reference material.The ionization distribution curves determine the size of the interaction volume.The size of the ellipsoidal Cu inclusion is smaller than the interaction volume. Figure 10 . Figure 10.The reconstructed density q tot of the Fe material with a Cu inclusion during the iterations of the L-BFGS optimization. Figure 11 . Figure 11.The k-ratio profile of ðCu, K − L 2 Þ and ðFe, K − L 2 Þ during the iterations of the reconstruction.Black crosses mark the measured k-ratios which are considered in the objective function jjkðpÞ − k exp jj 2 (cf.8).The visualized iterations are the same as in 10.Note that the kratios quickly converge to the measured values, although the shape of the ellipse does not yet coincide with the shape of the ellipse in the true material (9). Figure 12 . Figure 12.Errors of the objective function jjkðpÞ − k exp jj 2 and the error of the mass concentrations jjqðpÞ − q true jj 2 during the iterations of the L-BFGS optimization.Although the objective function significantly decreases for the first 50 iterations, the error of the mass concentrations remains close to the initial error.The same behavior is noticed in 10 and 11. Figure 12 . ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl } ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl } � FðnÞr_ yðnÞn − _ yðnÞr � FðnÞndS |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } � R |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } � �¼� max |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } Þj �¼� min |ffl ffl ffl ffl ffl ffl ffl ffl fflffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } � a : With the divergence theorem Table 1 . Model settings used for the comparison of 1D sensitivities. Table 2 . Relative errors in the sensitivities/derivatives of intensities for multiple x-rays a L and parametrization methods xðxÞ: Sensitivities/derivatives are computed using our implementation and using a central finite difference approximation of order 2. Table 3 . Runtimes of the computation of sensitivities/derivatives using our implementation and a central finite difference approximation of order 2 (FiniteDiff.jl). Table 4 . Model settings used for the reconstruction of the 1D interfaces. Table 5 . Model settings used for the 2D reconstruction of the ellipsoidal Cu inclusion.

섹션 본문 184문단 · 62,759자

(제목 없음)

1Electron Probe Microanalysis (EPMA) is a nondestructive technique to determine the chemical composition of material samples in the micro-to nanometer range.Based on intensity measurements of x-radiation, the reconstruction of the material composition and structure poses an inverse problem.The reconstruction methods currently applied are based on models that assume a homogeneous or a layered structure of the studied material.To increase the spatial resolution of reconstruction in EPMA the combination of a more sophisticated reconstruction method, which is based on a model that allows complex material structure, together with multiple measurements with varying beam configurations is required.We present a deterministic k-ratio model that is based on the P N model, an approximation of the radiative transfer equation for electron transport.Our goal is to approximate a maximum likelihood solution of the inverse problem using gradientbased optimization.We detail the application of the model in the context of algorithmic differentiation, in particular by deriving its continuous adjoint formulation.Algorithmic differentiation provides the flexibility to adapt the reconstruction method to various material parametrizations and thus to regularize and take into account prior knowledge.Through examples, we verify our implementation and demonstrate the flexibility of the reconstruction/ differentiation method.

Introduction

2Electron Probe Microanalysis (EPMA) (Heinrich and Newbury 1991;Reimer 1998) is an imaging technique used for the quantitative analysis of the composition of solid material samples at the micro-to nanometer scale.

3The sample is excited by a focused beam of electrons which induces multiple relaxation processes inside the sample.In EPMA, the emission of characteristic x-rays is of special focus.If an electron that is induced by the beam strikes a bound electron that occupies an atomic shell of an atom inside the specimen, the bound electron is ejected from its shell and the atom is left with a vacancy.Outer shell electrons fill this vacancy by emitting a quantized x-ray with an energy corresponding to the energy level difference of the excited (initial) and the relaxed (final) level.The energy levels of electron shells are characteristic of a specific atom, hence the energy of the emitted x-ray provides information about the composition of the material sample.Reconstructing the chemical composition from intensities of emitted x-radiation (normalized into k-ratios ðk a Þ a2A , A : measurement setups) forms the inverse problem in EPMA.In Figure 1, we outline the main physical processes that occur during an experiment.

4The crucial ingredient to the inverse problem of reconstruction is the definition of a model k 8 P : P !R jAj that maps parameters p 2 P � R n p (P : parameter space, n p : number of parameters) to k-ratios ðk 8 PÞðpÞ 2 R jAj (jAj : number of measurements).Then the reconstruction can be formalized as the following inverse problem: Find the set of parameters p � such that the modeled k-ratios ðk 8 PÞðp � Þ reproduce the experimental k-ratios k exp as good as possible.

5The applications of EPMA are manifold (Llovet et al. 2021;Moy, Fournelle, and von der Handt 2019;Pinard et al. 2013).From geology, and material scatter inside the sample and strike bound electrons that leave a vacancy (blue circle).Outer shell electrons (blue discs) fill this vacancy and release an x-ray of characteristic energy (red wobbly line).The x-ray travels through the sample and is counted by a detector.Beam electrons only excite a certain volume of the sample, the interaction volume (gray ellipses) which scales with the beam energy l � :

6science to electronics, researchers rely on EPMA to determine the material composition and structure of samples.Every application brings with it different prior knowledge and objectives that must be considered in the reconstruction.We subdivide our model into a k-ratio model k : ðG !R n e Þ !R jAj , q 7 !k½q� and a material parametrization P : P !ðG !R n e Þ, p 7 !PðpÞ ¼ q: Thereby q i ðxÞ is the mass concentration of element i in a compound with n e constituents at a point x 2 G: The sample domain G � R 3 will be specified later.While the k-ratio model k can handle general materials, the reconstruction can be tailored to specific applications via the material parametrization P (e.g., using prior knowledge).In particular, our definition includes reconstruction approaches currently applied in EPMA, which are however very restrictive on the material parametrizations P: ZAF-models assume homogeneity of the material inside the interaction volume of each beam.Effectively, this assumption limits the spatial resolution of EPMA to the size of the interaction volume (Buse and Kearns 2020;Carpenter and Jolliff 2015;Moy and Fournelle 2017).Reconstruction methods based on the integration of /ðqzÞ-curves currently only allow for samples that are layered in depth (Moy and Fournelle 2020).We aim to leverage a more sophisticated k-ratio model and the combination of kratio measurements from various beam positions and energies (resp.measurement setups A) to obtain a high-resolution spatial image of the material composition.

7In this article, we present our model for k-ratios (taken from B€ unger, Richter, and Torrilhon 2022) with a detail on the dependence on the mass concentrations q).The main part is dedicated to the derivation of an efficient and modular approach to compute the derivatives of our model, facilitating its integration into differentiable programming (Dorigo et al. 2023).We derive our differentiation approach based on the Adjoint Mode of Algorithmic Differentiation (Griewank 2003;Naumann 2011) and the Continuous Adjoint Method (Plessix 2006).The derivative forms the crucial part in the implementation of gradient-based optimization methods that find a local minimum of an objective function as a candidate solution of the inverse problem.We show the agreement of our gradient computation with finite differences and show the advantages of the adjoint method in terms of computation time.We also provide reconstruction experiments that compare different parametrizations in 1D and show a 2D reconstruction example.

The inverse problem of reconstruction

8In theory (Stuart 2010;Tarantola 2005), the solution of the inverse problems is defined as knowledge of the posterior uncertainty of the parameters based on the likelihood of the data, which describes the uncertainty of the model and the measurement, and the prior uncertainty of the parameters.

9So far, we consider a Bayesian inversion of the presented problem as intractable.However, the statistical understanding interprets our approach as finding the maximum likelihood estimate under the assumption of an isotropic Gaussian likelihood.We define the reconstruction problem as the following optimization problem:

10a2A ððk a 8 PÞðpÞ − k exp a Þ 2 |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } ¼ðJ 8 k 8 PÞðpÞ

11(1) Assuming that the objective function J 8 k 8 P is differentiable w.r.t.p, gradient-based optimization methods (Steepest Descent, Conjugate Gradient, L-BFGS) (Nocedal and Wright 2006) can be utilized to iteratively approximate a local minimum p � 2 P: For an efficient application of gradient-based methods, the efficient computation of the gradient is crucial.Additionally, we require our code to remain modular, such that either different parts of the model and, more importantly, the parametrization of the mass concentrations P is exchangeable.We remark that the computation of maximum likelihood estimates can be ambiguous and ill-posed depending on the number of available measurements and the chosen parametrization.Additional prior information about the material would be necessary that could enter our minimization problem (1) as an additional regularization term Rðqð�Þ, pÞ: Regarding the ill-posedness of the inverse problem, we refer to further research and note that the addition of a differentiable regularization term is possible.

The forward model

12The characteristic x-ray intensity model used in this article combines a model for electron transport based on the continuous slowing down approximation (CSD) of the linear Boltzmann equation (radiative transfer) with a subsequently applied model for x-ray generation and attenuation.In B€ unger (2021);B€ unger, Sarna, and Torrilhon (2022);B€ unger, Richter, and Torrilhon (2022), the model is derived in more detail.Here we derive and summarize the main equations and address the dependence on mass concentrations q in detail.

K-ratios

13In EPMA, x-ray intensity is measured by counting all characteristic x-rays emitted by electron scattering induced by the electron beam.Because of multiple uncertain quantities concerning the experimental device, the x-ray intensity I a is normalized into a k-ratio k a using standard intensities I std a measured from a known reference sample.

14Therefore, the normalization eliminates uncertain multiplicative factors that influence the intensity, e.g., the detector efficiency.

15An experiment yields multiple k-ratios.Each k-ratio corresponds to a specific x-ray transition and a specific experimental setup, e.g., the beam position, energy or angle.To distinguish between k-ratios, we use a ¼ ða L , a B Þ 2 A to denote a multi-index, that contains all information about the transition a L and the beam setup a B .

16a ¼ðZ i 2 fZ 1 , Z 2 , :::, Z n e g, I 2 fK, L1, :::, M1, :::g, F 2 fL1, :::, M1, :::g, |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl }

17The individual symbols are the atomic number Z i 2 a L , the initial (excited) I 2 a L and the final (relaxed) F 2 a L x-ray level of the electron-transition, 1 the mean and variance of the beam's position ðl x, beam , R x, beam Þ 2 a B , of the beam's energy ðl �, beam , R �, beam Þ 2 a B and the mean and concentration parameter of the beam's direction ðl X, beam , j X, beam Þ 2 a B :

Characteristic X-ray emission model

18Based on mass concentrations q, we aim for a generic model for k-ratios k a which, according to the usual definition in EPMA, are computed as the ratio of a measured I a and a standard intensity I std a :

19Both intensities can be computed from the same model, only the underlying mass concentrations, q resp.q std a , changes.Neglecting multiplicative factors that cancel due to the normalization with standard intensities I std a , we formulate the intensity of characteristic xrays I a as the integral of the attenuation field A a , the number of atoms N a and the generation field of characteristic x-rays I a over a domain G � R 3 of the sample which is chosen such that G covers the support of I a , i.e., I a ðxÞ ¼ 0 8x 2 R 3 n G:

201 In IUPAC notation (Jenkins et al. 1991), an x-ray level corresponds to an electron configuration that is typically described by the removal of an electron from the configuration of neutral ground state (e.g., K, L 2 ).A characteristic x-ray is emitted by transitioning from an initial to a final x-ray level, namely the x-ray transition (e.g., K − L 2 ).

21The attenuation field A a describes the intensity reduction of generated x-rays while traveling through the sample toward the detector.Attenuation is quantified by Beer-Lamberts law where the attenuation coefficient l a is the weighted sum of mass concentrations q i and mass attenuation coefficients s a, i : 2

22In ( 6) the integration domain is the straight line lðx, x d Þ � G from a point x 2 G toward the detector position x d 2 @G, such that the line lðx, x d Þ lies inside the domain G. Neglecting the part outside the domain G assumes that xrays travel unattenuated in the vacuum surrounding the material sample.

23The number of atoms N a (per unit volume) is given by the division of the mass concentration field q i by the atomic mass A a of the element Z i 2 a:

24The third factor that influences the x-ray intensities I a is the field of characteristic x-ray generation.

25It contains the electron fluence w a ðx, �, XÞ ¼ jvð�Þjf ðx, �, XÞ (vð�Þ : electron velocity, f ðx, �, XÞ : number density of electrons) of beam electrons at x 2 G with energy � 2 E ¼ ½� cut , � max � into direction X 2 S 2 inside the material probe which is weighted by the x-ray production cross-section r a : 3 The energy interval E is defined by the cutoff energy � cut , which is chosen so small that no more ionization can occur, and � max , which is chosen sufficiently large to capture all beam electrons.

2

26In the literature the mass attenuation coefficient is commonly denoted using ðl=qÞ a, i : It depends on the medium i and the x-ray wavelength a.For brevity of notation, we write s a, i : 3 For x-ray transitions a L where the initial state is K, the x-ray production cross-section can be replaced by the ionization cross-section of the K shell (k-ratio normalization eliminates the fluorescence yield).For other transitions, e.g.L or M as the final state, the x-ray production cross-section should include the ionization crosssection of all lower shells weighted by transition probabilities.

27Describing the electron fluence w a forms the most difficult part of modeling the emission of characteristic x-rays for inhomogeneous samples.We detail our model for the electron fluence w a in the following section.

Deterministic electron transport model

28The dynamics of the beam electrons are described by a linear Boltzmann equation, an integro-differential equation describing the evolution of electron number density in phase-space (position-velocity space), whereby the physical processes governing the evolution of the electron number density are free-flight phases interrupted by elastic and inelastic collisions with atoms of the material probe.Since the timescale of the physical processes is very small in comparison to the duration of the experimental measurements of x-ray intensities, it is valid to neglect the time dependence and assume a steady-state distribution of beam electrons immediately after switching on the electron beam.Furthermore, as inelastic scattering crosssections are highly peaked around small energy losses, i.e., electrons most probably lose a significant amount of energy in a sequence of small energy losses, it is common in EPMA to model the energy loss of projectile electrons as a continuous deceleration along the trajectory.These simplifications lead to modeling the beam electrons by the Boltzmann equation of electron transport in continuous slowing down (CSD, resp.BCSD) approximation -an evolution equation in energy space given by (Larsen et al. 1997)

29where the energy loss is governed by the stopping power S and the scattering operator Q accounts for elastic and inelastic collisions (CSD-average).Both, the stopping power S and the scattering operator Q are derived from cross-sections for compounds, which are defined by means of the additivity approximation.We use the cross-sections from Salvat et al. (2007) that are also used in B€ unger (2021); Olbrant (2012).Assuming a well-defined atomic mass, we can write both as the sum of atomic quantities S i and Q i 4 weighted by mass concentrations q i .S q ½ � ðx, �Þ ¼

30X n e i¼1 q i ðxÞS i ð�Þ (10)

314

32For brevity of notation we divide both quantities by the respective atomic masses.

33The BCSD model describes the evolution of the electron fluence w a in energy space and consequently needs to be equipped with initial and boundary conditions.As the evolution is prescribed from high to low energies an initial condition defines the electron fluence at the maximal energy � max w a ðx, � ¼ � max , XÞ ¼ w a, 0 ðx, XÞ ¼ 0:

34(12)

35We will initialize the electron fluence at an energy � max sufficiently larger than the mean beam energy l �, beam by w a, 0 ðx, XÞ ¼ 0 and model the electron beam by boundary conditions.The electron transport model can be equipped with Dirichlet-type boundary conditions by prescribing the incoming half of the electron fluence at the boundary

36where n denotes the outward-pointing normal-vector at x 2 @G and w a, in is a given distribution of incoming particles.We model electron beams by a product of Gaussian distributions in space and energy together with a von-Mises-Fisher distribution in direction.An electron beam that is aligned with the outward-pointing normal n of the polished material surface and focused onto the point l x, beam 2 @G is modeled by

37where N a, x ðxÞ is the probability density function of a Gaussian with mean l x, beam 2 a and covariance R x, beam 2 a: Respectively the distribution in energy N a, � ð�Þ (Gaussian with mean l �, beam 2 a and variance R �, beam 2 a) and the distribution in direction F a, X ðXÞ (von-Mises-Fisher with mean l X, beam 2 a and concentration j X, beam 2 a) is defined.

Spherical harmonic approximation

38A numerical solution of the electron transport model in Equation ( 9) is expensive due to the high dimension of phase space of w a ðx, �, XÞ and complexity of the scattering operator Q: Therefore, we employ the method of moments to derive a modal approximation of the linear Boltzmann equation.We reduce the phase space by replacing the direction X as an independent variable by a small set of moments to model the electron fluence w.Here we consider the spherical harmonic (P N ) moment approximation (Case and Zweifel 1967;Mark 1944;Mark 1945;Seibold and Frank 2014), i.e., we approximate the electron fluence w by its series expansion in spherical harmonics Y k l : S 2 !R truncated after some finite degree l � N 2 N:

39where the expansion coefficients are the spherical harmonic moments of the angular distribution

40and we model the fluence through the system of evolution equations of its moments u l, k a which we refer to as the P N equations.The P N equations are obtained by weakly enforcing Equation ( 9) for w P N a on the test space spanned by spherical harmonics up to degree N. By gathering the coeffi-

41the equation for u a can be written as F a ðu a , qÞ ¼ 0:

42|ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } ¼F a ðu a , qÞ

43With the following definitions for A ðdÞ and Q½q�:

44Using the method of moments, we reduced the phase space by two dimensions at the cost of replacing a scalar equation with a system of ðN þ 1Þ 2 equations.Additionally, A ðdÞ and Q exhibit structures that can be exploited to develop efficient numerical solvers.Q½q�ðx, �Þ is diagonal as spherical harmonics are eigenfunctions of the collision operator Q½q� such that the computational cost of the scattering operation grows linearly in the number of moments.

45The transport matrices A ðdÞ inherit a sparsity pattern from the recursion relation of spherical harmonics.When ordering spherical harmonics that are odd (even) in Cartesian direction d into a vector function

46Hence, the even (odd) moments u ½e, d� a couple with the odd (even) moments u ½o, d� a only through their spatial derivatives in direction d, which can be employed by central finite difference schemes on staggered grids (Seibold and Frank 2014).

47We employ the boundary conditions introduced in B€ unger, Sarna, and Torrilhon (2022).The boundary conditions follow from taking half moments of the Boltzmann boundary condition (13) with odd (in direction d 2 f1, 2, 3g) spherical harmonics as weighting functions and a stabilization step that is similar to the truncation of the series expansion in (15).For a given boundary point x 2 @G with outward pointing boundary normal e d we formulate boundary conditions for the moment vector

48The boundary conditions are given by

49These boundary conditions are compatible with the characteristics of the P N equations ( 17) and allow us to assure energy stability, see B€ unger, Sarna, and Torrilhon (2022) for details.From (12) we derive the following initial condition for the moments u a :

50The P N equations ( 17) describe the evolution of all ðN þ 1Þ 2 moments u a of w a , whereas the intensity model ( 8) only requires the angular average of w a because we assumed the isotropic emission of x-rays.The spherical harmonic Y 0 0 ðXÞ is constant, so we identify the moment u 0, 0 a / Ð S 2 w a ðx, �, XÞdX as part of our x-ray emission model and simplify the integral (8) to the following.

Mass concentration model

51Typically, the quantities of interest in EPMA are weight fractions x i ðxÞ ¼

M i ðdxÞ

52MðdxÞ that form a partition of unity P n e i¼1 x i ðxÞ ¼ 1: In order to determine mass concentrations qðxÞ from weight fractions xðxÞ, additional assumptions are necessary.We neglect the influence of different molecular or crystal structures and assume that the compound fx 1 , :::, x n e g is formed in a volume-preserving manner.Then the total volume is VðdxÞ ¼ P n e i¼1 V i ðdxÞ ¼

53x i ðxÞMðdxÞ q pure i : We derive the following relation between mass fractions and mass concentrations.

54x j ðxÞ q

55with the additional constraints, that p pc i, k � 0 and 26), ( 27) forms the piecewise-constant material parametrization P pc : P !ðG !R n e Þ: In the examples, we will replace the weight fraction parametrization x pc ðxÞ to investigate other parametrizations PðpÞ:

Differentiation of the forward model

56As described in the introduction, we consider the inverse problem as a minimization problem and apply iterative gradient-based optimization methods to find a candidate solution p � :

57Gradient-based optimization methods require the gradient of the objective function dJ dp : An efficient implementation of the gradient of our model, that simultaneously remains extensible and modular (particularly regarding the parametrization) is a challenge.While automatic algorithmic differentiation tools have the potential to transform any numerical code, the current versions of AD tools in julia (Zygote.jl,ReverseDiff.jl)cannot be applied to our model due to memory limitations and lack of performance.

58In the following, we present a method, that adopts the structural implementation of derivative code of numerical code from algorithmic differentiation (AD).We focus on the adjoint mode of AD, since we are mainly interested in the gradient of the scalar objective function.The advantage of the adjoint mode is that it scales with the number of outputs, whereas with numerical differentiation (finite differences) or the tangent mode of AD, the complexity scales with the number of inputs.Also, the analytical derivation of our method provides a clear understanding that facilitates its memory-efficient implementation.

59The core idea of AD is to base the derivative computation on local function transformations that are automatically composed.This also achieves modularity, i.e., if a particular function is modified, only the corresponding transformation needs to be adjusted.

Adjoint algorithmic differentiation

60Algorithmic differentiation (AD) (Burghardt et al. 2022;H€ user 2022;Innes 2018;Kreyszig 1991;Naumann 2011) defines a framework to compute derivatives of numerical program code.In contrast to symbolic or numerical differentiation (finite differences), algorithmic differentiation is without approximation error and modular, so the code remains extensible.Also, the automatic differentiation of numerical code is possible.We review the basic definitions of AD with a (unusual) focus on high/infinite dimensional spaces.Alongside a motivating example, we describe the systematic composition into code that is able to compute derivatives.

61Consider a differentiable function f : U � X !Y, x 7 !f ðxÞ ¼ y, where X and Y are Hilbert spaces and U is the open domain of f.Given an input x 2 U, we define the tangent operator @f ðxÞ @x ½�� : X !Y as the linear bounded operator that satisfies

62Additionally, given a tangent _ x 2 X of the input, we define the tangent _ y of the output by

63Given the tangent operator @f ðxÞ @x ½��, the corresponding adjoint operator

64where h�, �i X and h�, �i Y are the respective inner products of X and Y.

65Similarly to the tangent, given an adjoint � y 2 Y of the output, we define the adjoint � x of the input by

66Consequently, the identity h� y, _ yi Y ¼ h� x, _ xi X holds for all _ x 2 X and � y 2 Y:

67In real, finite dimensional spaces (e.g.,

68), the tangent operator can be represented by the Jacobian Df ðxÞ 2 R m�n and the adjoint operator by its transpose Df ðxÞ T 2 R n�m : For examples in infinite dimensional (function) spaces, we refer to Sec. 3.2.

69The core idea of AD is to subdivide a function into individual subfunctions (with individual tangent and adjoint operators) and intermediate variables (with intermediate tangents and adjoints).As an example, consider the following decomposition of f : U ! Y, x 7 !f ðxÞ ¼ y into two subfunctions g : U ! V and h : V � U ! Y where we use an intermediate variable v 2 V (V is another Hilbert space).

70Given x 2 U, v 2 V and y 2 Y as well as an input tangent _ x 2 X, the tangent _ y of is given by

71where we employ the chain rule to split the tangent operator of f into a combination of tangent operators of g and h.Additionally, we identify the tangent _ v of the intermediate variable.To find the corresponding adjoint operator, we successively use adjoint operators of the subfunctions g and h to isolate _

72x in the inner product identity

73To summarize, given the adjoint � y 2 Y, the adjoints � v and � x are

74Based on the chain rule, the composition of individual tangent and adjoint operators of a larger decomposition into an algorithm to compute the derivative is very systematic and can be implemented automatically.We describe the methodology using an arbitrary decomposition of a function f : x 7 !f ðxÞ ¼ y with n inputs and m outputs into subfunctions / i¼1, :::I :

75With ðv j Þ j�i we denote all predecessors of v i , i.e., all intermediate variables v j that v i directly depends on, and with ðv j Þ j�i we denote all successors of v i .Tangent mode AD is the successive computation of tangents

76Given an input tangent _ x, a tangent _ v i represents the directional derivative of v i into direction _

77x: Note that the tangent mode follows the sequence of operations in the evaluation of the primal.In adjoint mode AD, the sequence of operations is reversed.To compute an adjoint � v i , we consider the adjoints ð� v k Þ k�i of all intermediate variables, that depend on v i .

78Usually, in AD literature the single assignment code is considered, where all intermediate variables v i 2 R are scalar, and the tangent operators (resp.multiplication with a scalar) is self-adjoint.Then the � � can be neglected.For real multivariate intermediate variables the adjoint is the transpose � � ¼ � T :

79We briefly comment on some aspects of AD:

80Computational Complexity: Implementations of tangent and adjoint mode AD differ in algorithmic complexity.The Jacobian of a function f : R n !R m is obtained using tangent mode AD by j ¼ 1, :::, n successive executions of (38) where the input tangents are seeded with unit vectors _

81x ¼ e j : Elements of the Jacobian are then retrieved from ðDf ðxÞÞ ij ¼ _ y i _ x¼e j :

82In contrast to the tangent mode, using adjoint mode AD the Jacobian is obtained by i ¼ 1, :::, m successive applications of (39) where the output adjoints are seeded with unit vector � y ¼ e i : Elements of the Jacobian are then retrieved from ðDf ðxÞÞ ij ¼ � x j � y¼e i :

83Hence, to compute the full Jacobian, an implementation of tangent mode scales in the number of input variables while the adjoint mode scales in the number of output variables.Modularity and Extensibility: An implementation of either tangent or adjoint mode AD is modular and extensible.It consists of a systematic composition of individual tangent and adjoint operators.For example, changing one subfunction in (37) only affects its corresponding tangent and adjoint operator in (38) resp.( 39).Implementations of the other operators remain.Computational Graph: Both modes of AD can be visualized using a computational graph consisting of vertices for each variable (input, output, intermediate) and directed edges for direct dependence of variables.Assume a labeling of the edges with their corresponding tangent/adjoint operator applied to the tail(tangent)/head(adjoint) of the edge.The tangent is defined as the sum of all incoming edge tangent operators, while the adjoint is defined as the sum of all outgoing edge adjoint operators (c.f.Equations ( 38) and ( 39)).Checkpointing -Adjoint Memory Consumption: While the tangents can be implemented alongside the execution of the primal function and intermediate primal variables (x, v) are available, they must be kept in memory for the computation of adjoints.Storing all intermediate variables is expensive.Checkpointing remedies the high memory consumption by recomputing certain intermediate variables while computing the adjoint operators.In the example (36), the primal v ¼ gðxÞ would be recomputed while evaluating the adjoint of h.

84Our model includes the special case, that the mapping from qðxÞ to u a ðx, �Þ is given implicitly by the PDE in Equation ( 17).We state the two basic steps of calculating adjoints in implicit relations and refer to the Appendix A for a more detailed derivation.Consider the implicit definition Fðy ¼ gðxÞ, xÞ ¼ 0 (with differentiable F(y, x)), where we assume that it uniquely defines the differentiable mapping y ¼ gðxÞ: We introduce an additional intermediate adjoint variable � F: Then, given the adjoint � y of the output, the adjoint � x of the input can be computed from

85without explicit definition of � x ¼ @gðxÞ @x � ½� y�:

Differentiation method for our model

86In the following, we will successively define adjoint operators for the individual parts of the model described in Sec. 2. All derivations follow the same scheme: First, we define the tangent operator using the directional derivative and second we derive the adjoint operator from the inner product identity.We will elaborate on complex derivations and only state the adjoint operator for simple ones.In this paper, the only relevant derivatives are with respect to the mass concentrations q, hence all quantities that do not depend on q are treated as constants and their adjoints are omitted.

87Compared to the forward computation, adjoints are computed in reversed order.We follow this behavior while deriving the adjoint operators for the individual dependencies.For brevity of notation we omit the accumulation of adjoints (tangents) and respectively only consider the operators that describe the direct propagation.The accumulation becomes apparent in the high-level computational graph in Figure 2. If multiple edges leave a node, the adjoints of all outgoing edges have to be summed up.

88� J� : The final operator (1) of our model computes the squared error J from a set of simulated k-ratios k a , a 2 fa 1 , :::g: Given the adjoint � J, which for the computation of derivatives @J @� must be chosen � J ¼ 1, the definition of the adjoint operator of the squared error from

89� � k a � : Also the adjoint operator for normalization with standard intensities in Equation ( 4) is derived by simple means.

90We elaborate on the adjoint operators derived from Equation (5).Linearity of the integral in (5) directly yields the tangent _ I a : Using the standard definition of the inner products in R, ha, bi R ¼ ab and in L 2 ðGÞ, ha, bi L 2 ðGÞ ¼ Ð G a T ðxÞbðxÞdx we derive adjoints � A a , � N a and � I a : We detail � A a : � N a ðxÞ ¼ A a ðxÞI a ðxÞ � I a and � I a ðxÞ ¼ N a ðxÞA a ðxÞ � I a (44)

91� ½� q ¼ @N a @q � � N a � : From Equation ( 7), we find the adjoint operator.

92� ½� q ¼ @A a @q � � A a � : Deriving the adjoint from the attenuation given in ( 6) requires more analysis.The tangent of the absorption operator A _ a ½q�ðxÞ is given by the directional derivative into direction _ qðxÞ:

93By inserting the tangent A _ a into the definition of the adjoint (31), we derive the adjoint of the attenuation operator.In the following derivation, we rewrite the line integral from ( 46) as an integral over the whole space G by introducing dðdðx, x d , yÞÞ to denote the Dirac, that indicates the line segment lðx, x d Þ: So dðx, x d , yÞ denotes the distance of y to the line segment lðx, x d Þ between x and x d .

94By swapping the order of integration dydx to dxdy, we are able to separate _ q i , but the interpretation of dðdðx, x d , yÞÞ changes.For a given y, dðdðx, x d , yÞÞ now indicates the points x of all lines lðx, x d Þ that contain y.In other words: dðdðx, x d , yÞÞ indicates the line lðy, x d � Þ from y to the point reflection x d � 2 @G of x d 2 @G at x 2 G: Exemplarily, we illustrate lðx, x d Þ, lðx, x d � Þ and dðx, x d , yÞ in Figure 3. From (47), we identify the adjoint operator of (6).

95Where the integration domain lðx, x d � Þ is the line between x and reflection x d � of x d at x. 25), the only relevant moment for the ionization field I a is u ð0, 0Þ a , hence the adjoint � u a :

96� ½� q ¼ @u a @q � � u a � : The relation between q and u a is implicitly given by the P N equations and the boundary conditions, i.e., by the implicit PDE operator F a ðu a , qÞ ¼ 0 (17).We describe the derivation of the adjoint operators (40) for the P N equations.For a detailed derivation of (40) we refer to the Appendix A. Let us introduce the auxiliary adjoint � F a and derive the operators @F a @u a � ½�� and @F a @q � ½�� in the following.Successively, both operators form the adjoint @u a @q � ½��: In particular, we elaborate on the identities

97(50) � ½ @F a @u a � � F a ¼ � u a � : The adjoint operator @F a @u a � applied to � F a describes the continuous adjoint equation.

S q

98½ � ðx, �Þ@ � � F a ðx, �Þ −

99|ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl }

100In analogy to the reversed application of adjoint operators, the adjoint equation describes the evolution of the adjoint � F a in reversed direction (w.r.t. the energy �).Initial and boundary conditions follow from the derivation.

101Derivation Linearity of F a in u a directly yields the tangent @F a @u a _ u a : Using integration by parts and symmetry of A ðdÞ and Q, we obtain

102|ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl }

103The last two terms in (54) vanish due to the initial and boundary conditions imposed to _ u a and � F a : The former term is zero because of the conditions _ u a ð�, the integrand in ( 56) is zero because

104ðdÞ ÂðdÞ Þ |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl }

105Using that L ðdÞ ¼ L T ðdÞ , defined in ( 23), is symmetric.� ½� q ¼ − @F a @q � � F a � : The tangent @F a @q _ q follows directly from linearity of F a (and S and Q) in q.For the adjoint we find

106:::

107and identify

108The adjoint of the mass concentration model ( 26) can again be derived by simple means.� x pc i ðxÞ ¼ q tot ðxÞq i ðxÞ − q 2 tot ðxÞ q pure i X n e k¼1

109x k ðxÞ� q k ðxÞ (60)

110x pc � : The indicator functions in ( 27) lead to a partitioning of the integration domain G into G k for the � p i, k :

111This completes the derivation of adjoint formulations for all parts of the model presented in Sec. 2. Note that for nonlinear operators, the primary result is required to calculate the adjoint, and therefore must be saved during the forward execution or recalculated.This is analogous to discrete adjoint tools.Furthermore, all derived operators are modular and only need to be assembled according to the computational graph.When replacing parts of the model, only the corresponding adjoint operator needs to be adjusted.In the examples in Sections 4.3 and 4.4, we will use this modularity and exchange the parametrizations P:

Computational effort

112The motivation for deriving and implementing the adjoint formulation of our model is that of the efficiency advantage over finite differences and the tangent mode of AD.Our implementation inherits the runtime complexity of the adjoint mode, as the runtime of a Jacobian calculation scales in the number of output variables of the primal.The price to pay for faster execution is the higher memory requirement since all primal variables have to be stored during forward execution or recalculated later.

113Leveraging the convenience of automated AD tools to derive the discrete adjoint code of our implementation was not possible with current tools in julia.However, our approach somewhat mimics the development approach that tools, e.g., Zygote.jl or ChainRulesCore.jltake.Instead of implementing only tangent and adjoint versions of low-level operations, they aim for efficient implementations of high-level methods.We adopt this approach and derive an adjoint version in the continuous framework and implement discretized versions of the operators in code.

114The high-level view offers further insight, and one more possibility to reduce the computational effort for the gradient.Note that the naive adjoint implementation requires jAj "solves" of the adjoint PDE (same amount as the forward).We separate the multi-index into a ¼ ða L , a B Þ 2 A L � A B where a L describes the k-ratio line (material, transition) and a B the beam setup (position, energy).We revisit Equations (44)( 49) and ( 51).We realize that the only dependence of all equations from a B is due to the scalar � I a : Instead of computing � I a , � u a and � F a , we consider

115� I a and eliminate thereby the dependence from the beam setup a B .The operators for Ĩ a L , ũa L and Fa L do not depend on a B .The accumulation of the adjoint � q i (cf.Equation ( 59), where we sum over all incoming edges in the computational graph 2), can then be rewritten to

116Instead of solving the adjoint PDE for every � F a it is sufficient to compute Fa L for every a L .The number of expensive adjoint PDE solves that are required is reduced from jAj to jA L j:

Numerical examples

117Preliminary results for the examples presented in section 4.3 and 4.4 can be found in (Achuda et al. 2023).

Implementation and discretization

118Conceptually the discretization of the P N -equation ( 17) and the adjoint P Nequation ( 51) are the most challenging.For the numerical computation of the moments u a and � F a we implemented a 3D staggered grid finite-difference method based on the method StaRMAP presented in (Seibold and Frank 2014).StaRMAP is specifically designed to exploit the structure of P N -equations.Individual sets of moments u a are discretized on the staggered grids in such a way, that sparsity of the transport matrices A ðdÞ decouples the system and enables the use of second-order central differences that approximate the spatial derivative on the respective displaced grid.Second-order integration in energy is achieved using a splitting of the moments and half steps for each part of the solution.

119The boundary conditions in ( 22) and ( 53) are used to compute moments on ghost nodes, located outside the computational domain G. Values of the moments for ghost nodes are set, such that the boundary condition holds for interpolated moments on the boundary of the domain @G: For details see B€ unger (2021).

120For integrations in energy and space as well as the line integral for the absorption we use the trapezoidal rule.

Comparison: sensitivities of a 1D material with finite differences

121We consider a binary material consisting of copper Cu and nickel Ni and compare sensitivities @I a @p computed using our implementation (resp.� p where � I a is seeded with unit vectors) with sensitivities computed by central finite differences.By means of this comparison of our implementation to finite differences we address several questions at the same time:

122� By introducing a second parametrization, we exemplarily show the modularity of our implementation.� We provide insight into the nature of the model.The sensitivity @I a @p is the linear approximation of intensities with respect to model parameters, hence a large sensitivity relates to a strong dependency and a small sensitivity to a weak dependency.This is particularly interesting for the inverse problem because it also unveils possible difficulties in the reconstruction.� Agreement with finite differences validates our implementation.� We demonstrate the claimed superiority of our method compared to finite differences in terms of computation time.

123We introduce an alternative parametrization, where K k ðxÞ, k 2 f1, :::n k g are triangular functions covering the domain G, in particular

124The partition of unity P n e i¼1 x i ðxÞ ¼ 1 is (again) guaranteed by p pl i, k � 0 and P n e −1 j¼1 p pl j, k � 1: We refer to the parametrization as piecewise-linear.

125The adjoint of the piecewise-linear parametrization � p pl is given by

126Modularity is set out by the fact, that only the parametrization and its adjoint are implemented, the rest of the code remains unchanged.Now both parametrizations, the piecewise-constant parametrization (with n k ¼ 20 parameters) and the piecewise-linear parametrization (also with n k ¼ 20 parameters) are employed to compute sensitivities @I a @p pc resp.@I a @p pl : The physical setup and the settings of the P N approximation for this example can be found in Table 1.Parameter values for the parametrizations are sampled independently from a uniform distribution in ½0, 1�:

127We visualize the sensitivities by plotting x pc 1 ðxÞj p¼ @Ia @p pc and x pl 1 ðxÞj p¼ @Ia @p pl in Figure 4. Using the parametrizations xðxÞ is gentle abuse but since the parameters in x pc and x pl are related to space points, an interpretation of the plot is possible.Increasing a parameter, increases the mass concentration of Cu and simultaneously decreases the mass concentration of Ni, hence the positive values for Cu x-rays and the negative value for Ni x-rays.In depth the sensitivity decreases because with greater depth the generation of x-rays decreases and the absorption increases.Figure 4 also compares sensitivities computed by our method (colored, solid lines) with the sensitivities computed by central finite differences (black, dashed lines).The curves coincide.Additionally, we compare relative errors

128of sensitivities in Table 2. Derivatives computed by algorithmic differentiation are exact (AD computes the exact derivative of the numerical approximation up to machine precision) (Naumann 2011).Our method as well as finite differences only provide approximations of the derivative.For A visualization of the sensitivities computed using our method and finite differences.

129We abuse the parametrization function of each parametrization and plot x 1 ðxÞj p¼ @Ia @p : The curves computed using our method (solid lines) coincide with the curves computed using finite differences (black dashed lines).A quantitative comparison of sensitivity values is given in Table 2.

130our method, the underlying approximation of the adjoint state variable introduces errors, for finite differences the approximation error originates from the perturbation h.

131In Table 3, the superiority of our method in terms of computation time compared to finite differences becomes apparent.We compare the runtime of a central finite difference method (2nd order) with our implementation for two different numbers of parameters (n p ¼ 20 and n p ¼ 40).The runtime of the forward model is � 0:5s, and the computation of the derivative with finite differences clearly scales with the number of parameters n p .The runtime of our implementation scales in the number of outputs (here jAj ¼ 4) and clearly does not scale with n p .Note the minor overhead because of the backward execution.

1D reconstruction of a sharp and a diffusive interface

132We present the reconstruction of a coated material consisting of iron Fe and nickel Ni with a sharp (discontinuous) and a diffusive (continuous) interface between the layers.

133� We show the necessity of choosing a suitable parametrization.� We compare the previously defined parametrizations (( 27) and ( 63)) to an additional non-linear parametrization (66)

134We introduce another parametrization that is based on the non-linear structure of a neural network (with x as the input and x nl as the output.The activation function for one hidden layer is tanhðÞ and sigðÞ for the output layer to enforce 0 � x nl i � 1).The parametrization uses n p ¼ 10 parameters, which we call p nl ¼ ða 1 , a 2 , a 3 , b 1 , b 2 , b 3 , â1 , â2 , â3 , bÞ T :

135|ffl ffl ffl ffl {zffl ffl ffl ffl }

136x nl 1 ðxÞ ¼ sigð

137|ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } ¼ŵðxÞ Þ (66b)

138The adjoints for the non-linear parametrization are given in the following.

139For a fair comparison, the number of parameters in the other parametrizations is also chosen to be 10.For the binary material the scalar x 1 ðxÞ completely describes the material, because x 2 ðxÞ ¼ 1 − x 1 ðxÞ:

140The artificial measurements for the reconstruction are k-ratios from multiple different beam energies between 9 keV and 15 keV: To compute the measurements we assume the reference material to be given.Additional P N model settings and the considered x-rays are tabulated in Table 4.We choose the BFGS method implemented in Optim.jl(Mogensen and Riseth 2018) as optimization method (with additional box-constraints for the piecewise-constant and the piecewise-linear parametrization, and no constraints for the non-linear parametrization).

141In Figure 5, the reconstructed density of the material with a sharp interface is visualized using the different parametrizations.From initial configurations (piecewise-constant, piecewise-linear: 0.5 Fe and 0.5 Ni; non-linear: random) the parametrizations iterate toward the reference density (black line) during the optimization.We visualize the initial, first, fifth iteration and the 100th iteration.The inability of the piecewise-linear parametrization to represent discontinuities becomes apparent.However, the piecewise-constant parametrization only approximates perfectly because one of the subdomain interfaces matches the interface of the reference material.On the other hand, the non-linear parametrization is flexible enough to identify the location of the interface and to approximate the discontinuity.

142In Figure 6, the reconstructed density of the material with a diffusive interface is visualized.Except for the reference material, exactly the same settings as for the reconstruction of the sharp interface are used.Again, the parametrizations iterate toward the reference density (black line).For the diffusive interface, none of the parametrizations can reconstruct the interface perfectly, but the piecewise-linear and the non-linear parametrizations perform better than the piecewise-constant parametrization.In Figure 7, we visualize the normalized error, the value of the objective function jjkðpÞ − k exp jj 2 , the error of the mass concentrations jjqðxÞ − q true jj 2 and the error of additional k-ratio measurements jjk þ ðpÞ − k exp þ jj 2 (with beam energies 11 keV and 14 keV) during the iterations of the optimization.The kinks in the error of the objective function are an artifact of the Optim.jlimplementation.Their default implementation is based on the combination of a line search method (Hager and Zhang 2005) and the BFGS algorithm presented in (Nocedal and Wright 2006).

143Differences in the performance of the different parametrizations are clearly visible.The error in the mass concentrations for the piecewise-constant parametrization for the sharp interface is by far the smallest, due to the possible perfect reconstruction.Only the non-linear parametrization performs similarly well for both examples.

144Comparing the error in mass concentrations for piecewise-constant and piecewise-linear parametrization for the sharp and the diffusive interface, they vary.A correlation between the error in mass concentrations and the error of additional k-ratios would be beneficial but is hard to obtain visually.Ideally, both would behave similarly, because then we could propose the error in additional k-ratios as a suitable reconstruction quality measure.However, the evaluation of reconstruction quality measures is beyond the scope of this work and is deferred to further research.

2D reconstruction of an ellipsoidal inclusion

145We describe the use case of a reconstruction of an ellipsoidal copper Cu inclusion in an iron Fe substrate from k-ratios obtained from a 12 keV electron beam and multiple beam positions.In Figure 8, we plot k-ratios obtained from an artificial line-scan of the inclusion.Only the ten k-ratios retrieved from five beam positions l y ¼ f−50, −25, 0, 25, 50g nm, which are marked by black crosses, are used for the reconstruction.To compute the k-ratios, the reference material is assumed to be given.We visualize the total density q tot of the reference material in Figure 9 and additionally show the ionization distributions of ðCu, K − L 2 Þ and ðFe, K − L 2 Þ that define the size of the interaction volume.The ellipsoidal Cu inclusion is clearly smaller than the interaction volumes.Additional settings of the k-ratio model are shown in Table 5.

146The profile shows an increase in the ðCu, K − L 2 Þ k-ratio for a beam position close to � 25 nm: We assume an elliptical Cu inclusion which we parametrize by p ¼ ðl 1 , l 2 , a, b, r, â, bÞ T , where l 1 and l 2 specify position, a

147And their adjoint

148For the reconstruction, we use the L-BFGS algorithm implemented in Optim.jl(Mogensen and Riseth 2018).The total density of the material q tot during the iteration steps is visualized in Figure 10.From the initial guess (educated guess: higher copper concentration at x 30 nm, see Figure 10(a)) the reconstruction converges to the reference material (see Figure 9(a)).Alongside the total density of the reconstructed material, we visualize the k-ratio profiles of ðCu, K − L 2 Þ and ðFe, K − L 2 Þ in Figure 11.The shapes of the curves quickly coincide with the measured k-ratios (black crosses).At iteration 30 the measured k-ratios are already well approximated, the total density, however, is not.For sufficient reconstruction of the ellipsoidal structure, the error in the k-ratios (the objective function) must be further reduced.In Figure 12, we show the value of the objective

149function jjkðpÞ − k exp jj 2 and the error in mass concentrations jjqðpÞ − q true jj 2 during the iterations of the optimization.For the first 50 iterations, the value of the objective function decreases, whereas the error in the mass concentrations remains close to the initial error.Only after the first 50 iterations, the error in the mass concentrations also decreases.In Figure 10, this effect is also observed, where only after iteration 90 the shape of the reference ellipse starts to form.

Conclusion

150In this paper, we derive an adjoint approach to compute derivatives for a deterministic k-ratio model to be applied in reconstruction in EPMA.The k-ratio model is based on the P N -model, a moment expansion of the continuous slowing down approximation of the linear Boltzmann equation that is pioneered for EPMA in B€ unger, Richter, and Torrilhon (2022).We formulate the model with a focus on the inverse problem and describe the application of the model within an adjoint algorithmic differentiation framework.This work thus represents a building block in the development of a high-resolution reconstruction method that uses gradient-based optimization techniques.By replacing material parametrizations, experiments can be realized that reconstruct different material parameters and take into account different prior knowledge.We conclude the paper with a validation of our differentiation method and reconstruction experiments.The experiments show the influence of the material parametrization in the reconstruction and illustrate our idea of an application of our method.The combination of measurements with prior knowledge makes high-resolution reconstruction problems tractable with a reasonable amount of measurement data.At the same time, we demonstrate the extensibility of our implementation to various material structures.High-resolution imaging, i.e., the reconstruction of material structures that are smaller than the interaction volume, is possible with sufficient data or sufficient material assumptions.But there will always be a balance between the accuracy of the measurement and the model to the accuracy of the reconstruction.Especially for high resolution, the analysis of this relation is key.To achieve a reliable reconstruction result, the quantification and propagation of measurement and model uncertainties are necessary.

Appendix A. Adjoint continuous implicit differentiation

151Consider the implicit definition: Given x 2 X, find y 2 Y such that Fðy ¼ gðxÞ, xÞ ¼ 0: We refer to the implicit function with y ¼ gðxÞ and assume that it is unique at x.Given a (tangent) direction _

152x, we realize that the directional derivative of F in direction _ x does not change.Employing the chain rule we find the following.

@ @h

153Fðgðx þ h _ xÞ, x þ h _ xÞ h¼0 ¼ @Fðy, xÞ @y @gðxÞ @x _

154We consider the previous statement in a weak sense, meaning we test the constraint with � F 2 T, where T is an appropriate space.

155� F, @Fðy, xÞ @y @gðxÞ @x _

156We identify the tangent of y with _ y ¼ @g @x _ x ½ � and use adjoint operators @F @y � ½�� and @F @x � ½�� of the tangent operators @F @y ½�� and @F @x ½�� to derive the following.Comparing ( 72) with the definition of the adjoint (31) h� y, _ yi Y ¼ h� x, _ xi X we derive the two steps for the implicit adjoint.Given � y 2 Y, if we can find � F 2 T such that (73a) holds, the required adjoint � x is given by (73b).@Fðy, xÞ @y

Example

157We consider the Poisson-equation in 2D with homogeneous (Dirichlet) boundary conditions.Given a domain X � R 2 with n 2 X and x : X !R a suitable right-hand side.The primal problem is to find y : X !R with yðnÞ ¼ 0 8n 2 @X such that Fðy, xÞ ¼ Dyð�Þ − xð�Þ ¼ 0:

158(74)

159To derive the adjoint, we first analyze the left-hand side of (72).Using integration by parts twice, we derive the adjoint operator @F @y � ½��: h � F, @Fðy, xÞ @y _ y ½ �i ¼ h � F, D_ yi ¼ The boundary integral in (75) yields boundary conditions for the adjoint � F: Since _ yðnÞ ¼ 0 8n 2 @X, we assign � FðnÞ ¼ 0 8n 2 @X: From the right-hand side of (72) we trivially find @Fðy, xÞ @x

160Computing the adjoint � x therefore consists of the following steps.Given � yð�Þ find � Fð�Þ with � FðnÞ ¼ 0 8n 2 @X such that (77a) holds.Then, the required adjoint � xð�Þ is given by (77b) (trivial for this example).

Figure 1 .

161Figure 1.A sketch of the physical processes in EPMA.The sample G is rastered by electron beams (blue) with different positions l x .Electrons e -from the electron beam (blue dotted line) scatter inside the sample and strike bound electrons that leave a vacancy (blue circle).Outer shell electrons (blue discs) fill this vacancy and release an x-ray of characteristic energy (red wobbly line).The x-ray travels through the sample and is counted by a detector.Beam electrons only excite a certain volume of the sample, the interaction volume (gray ellipses) which scales with the beam energy l � :

162ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } :¼q tot ðxÞ (26) As a first possibility, we model weight fractions x pc i ðxÞ as a piecewiseconstant function.We subdivide the spatial domain G into n k 2 N disjoint subdomains G k and introduce the indicator function 1 G k ðxÞ: To guarantee the partition of unity we only use n p ¼ n k � ðn e − 1Þ parameters p pc i, k and define the parametrization

163� I a A _ a ðxÞdx ¼ hN a ð�ÞI a ð�Þ � I a |ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl } :¼ � A a ð�Þ , A _ a ð�Þi L 2 ðGÞ (43) Accordingly, the adjoints � N a ð�Þ and � I a ð�Þ are derived.

Figure 2 .

164Figure 2. The abstract computational graph of our model.Straight edges (bottom to top) correspond to the primal function evaluation.Bend edges (top to bottom) correspond to the adjoint evaluation and are labeled with the respective adjoint operators.Dashed boxes highlight the individual model evaluation for every experimental setup a 2 A: Note that multiple adjoint edges entering a node correspond to the accumulation of the respective adjoint operators.This is not explicitly addressed in the derivation in section 3.2.

Figure 3 .

165Figure 3.The absorption path lðx, x d Þ ¼ fyjdðx, x d , yÞ ¼ 0g from x toward the detector position x d (solid line) and the path used for the adjoint lðx, x d � Þ ¼ fyjdðy, x d , xÞ ¼ 0g (dotted line).G is the computational domain.

166Figure 4.A visualization of the sensitivities computed using our method and finite differences.We abuse the parametrization function of each parametrization and plot x 1 ðxÞj p¼ @Ia

Figure 5 .

167Figure5.The reconstructed density of a material with a sharp interface between an iron Fe layer covering an Ni substrate.We use the piecewise-constant, the piecewise-linear and the non-linear parametrization for the reconstruction.For the piecewise-constant and the piecewise-linear parametrization, the geometry (interfaces) are visualized by gray vertical lines.The black line shows the reference density.All parametrizations converge.The piecewise-constant parametrization has a clear advantage because the interface aligns with an interface of the parametrization.The piecewise-linear parametrization cannot approximate the discontinuous interface, hence it converges to presented smoothed representation.The non-linear parametrization is flexible enough to identify the location of the interface and also approximates the discontinuity using a strong gradient.

Figure 6 .

168Figure 6.The reconstructed density of a material with a diffusive interface between an iron Fe layer covering an Ni substrate.We use the piecewise-constant, the piecewise-linear and the non-linear parametrization for the reconstruction.For the piecewise-constant and the piecewise-linear parametrization, the geometry (interfaces) are visualized by gray vertical lines.The black line shows the reference density.All parametrizations converge.None of the parametrizations can represent the interface perfectly.The piecewise-linear and the non-linear parametrization perform better for this example, because of their flexibility to approximate continuous functions.

Figure 7 .

169Figure 7.The value of the objective function and additional reconstruction quality measures during the iterations of the optimization for all parametrizations.The objective function jjkðpÞ − k exp jj 2 is visualized as a solid line.Also, the error in the mass concentrations jjqðxÞ − q true ðxÞjj 2 (dashed line) and the error of k-ratios jjk þ ðpÞ − k exp þ jj 2 (dotted line) from additional beam energies (11keV and 14keV) is plotted.

Figure 8 .

170Figure 8.The k-ratio profile of the elliptical Cu inclusion in the Fe substrate computed using a 12 keV electron beam.Dashed lines show the k-ratio profiles of ðCu, K − L 2 Þ (blue) and ðFe, K − L 2 Þ (orange) with a high beam resolution.Black markers show the k-ratios which are used for the reconstruction.While not directly visible, the shape and height of the k-ratio curves encode information about the shape and location of the inclusion and the structure of the interface between inclusion and substrate.

Figure 9 .

171Figure 9.The total density and two ionization distribution fields of the reference material.The ionization distribution curves determine the size of the interaction volume.The size of the ellipsoidal Cu inclusion is smaller than the interaction volume.

Figure 10 .

172Figure 10.The reconstructed density q tot of the Fe material with a Cu inclusion during the iterations of the L-BFGS optimization.

Figure 11 .

173Figure 11.The k-ratio profile of ðCu, K − L 2 Þ and ðFe, K − L 2 Þ during the iterations of the reconstruction.Black crosses mark the measured k-ratios which are considered in the objective function jjkðpÞ − k exp jj 2 (cf.8).The visualized iterations are the same as in 10.Note that the kratios quickly converge to the measured values, although the shape of the ellipse does not yet coincide with the shape of the ellipse in the true material (9).

Figure 12 .

174Figure 12.Errors of the objective function jjkðpÞ − k exp jj 2 and the error of the mass concentrations jjqðpÞ − q true jj 2 during the iterations of the L-BFGS optimization.Although the objective function significantly decreases for the first 50 iterations, the error of the mass concentrations remains close to the initial error.The same behavior is noticed in 10 and 11.

175ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl } ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl }

�

176FðnÞr_ yðnÞn − _ yðnÞr � FðnÞndS |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl }

177R |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl }

178�¼� max |ffl ffl ffl ffl ffl ffl ffl ffl ffl ffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl } Þj �¼� min |ffl ffl ffl ffl ffl ffl ffl ffl fflffl {zffl ffl ffl ffl ffl ffl ffl ffl ffl ffl }

179a : With the divergence theorem

Table 1 .

180Model settings used for the comparison of 1D sensitivities.

Table 2 .

181Relative errors in the sensitivities/derivatives of intensities for multiple x-rays a L and parametrization methods xðxÞ: Sensitivities/derivatives are computed using our implementation and using a central finite difference approximation of order 2.

Table 3 .

182Runtimes of the computation of sensitivities/derivatives using our implementation and a central finite difference approximation of order 2 (FiniteDiff.jl).

Table 4 .

183Model settings used for the reconstruction of the 1D interfaces.

Table 5 .

184Model settings used for the 2D reconstruction of the ellipsoidal Cu inclusion.

참고문헌 28건

  1. The Art of Differentiating Computer Programs 2011 10.1137/1.9781611972078
  2. Electron Probe Quantitation Springer eBooks · Springer Nature · 1991 10.1007/978-1-4899-2617-3
  3. Inverse Problem Theory and Methods for Model Parameter Estimation Society for Industrial and Applied Mathematics eBooks · Society for Industrial and Applied Mathematics · 2005 10.1137/1.9780898717921
  4. Characterization of Dual-Phase Steel Microstructure by Combined Submicrometer EBSD and EPMA Carbon Measurements Microscopy and Microanalysis · Oxford University Press · 2013 10.1017/s1431927613001554
  5. A New Conjugate Gradient Method with Guaranteed Descent and an Efficient Line Search SIAM Journal on Optimization · Society for Industrial and Applied Mathematics · 2005 10.1137/030601880
  6. Electron dose calculations using the Method of Moments Medical Physics · Wiley · 1997 10.1118/1.597920
  7. IUPAC—nomenclature system for x‐ray spectroscopy X-Ray Spectrometry · Wiley · 1991 10.1002/xrs.1300200308
  8. Introductory functional analysis with applications 1978
  9. A review of the adjoint-state method for computing the gradient of a functional with geophysical applications Geophysical Journal International · Oxford University Press · 2006 10.1111/j.1365-246x.2006.02978.x
  10. Inverse problems: A Bayesian perspective Acta Numerica · Cambridge University Press · 2010 10.1017/s0962492910000061
  11. StaRMAP---A Second Order Staggered Grid Method for Spherical Harmonics Moment Equations of Radiative Transfer ACM Transactions on Mathematical Software · Association for Computing Machinery · 2014 10.1145/2590808
  12. A mathematical view of automatic differentiation Acta Numerica · Cambridge University Press · 2003 10.1017/s0962492902000132
  13. Scanning Electron Microscopy Springer series in optical sciences/SPringer series in optical sciences · Springer Nature · 1998 10.1007/978-3-540-38967-5
  14. Improvements in EPMA: Spatial Resolution and Analytical Accuracy Microscopy and Microanalysis · Oxford University Press · 2015 10.1017/s1431927615007990
  15. Numerical Optimization (Springer Series in Operations Research and Financial Engineering) 2000
  16. Models and numerical methods for time- and energy-dependent particle transport 2012
  17. Analytical Spatial Resolution in EPMA: What is it and How can it be Estimated? Microscopy and Microanalysis · Oxford University Press · 2017 10.1017/s1431927617006158
  18. Optim: A mathematical optimization package for Julia The Journal of Open Source Software · Open Journals · 2018 10.21105/joss.00615
  19. Don't Unroll Adjoint: Differentiating SSA-Form Programs. arXiv (Cornell University) · Cornell University · 2018
  20. Solving the iron quantification problem in low-kV EPMA: An essential step toward improved analytical spatial resolution in electron probe microanalysis—Olivines American Mineralogist · Mineralogical Society of America · 2019 10.2138/am-2019-6865
  21. Stable Boundary Conditions and Discretization for $P_N$ Equations Journal of Computational Mathematics · Global Science Press · 2022 10.4208/jcm.2104-m2019-0231
  22. Electron probe microanalysis: A review of recent developments and applications in materials science and engineering Progress in Materials Science · Elsevier BV · 2020 10.1016/j.pmatsci.2020.100673
  23. BadgerFilm: An Open Source Thin Film Analysis Program Microscopy and Microanalysis · Oxford University Press · 2020 10.1017/s1431927620014853
  24. Spatial resolution limits of EPMA IOP Conference Series Materials Science and Engineering · IOP Publishing · 2020 10.1088/1757-899x/891/1/012005
  25. Discrete adjoint methodology for general multiphysics problems Structural and Multidisciplinary Optimization · Springer Science+Business Media · 2022 10.1007/s00158-021-03117-5
  26. A Model for Characteristic X-Ray Emission in Electron Probe Microanalysis Based on the (Filtered) Spherical Harmonic () Method for Electron Transport Microscopy and Microanalysis · Oxford University Press · 2022 10.1017/s1431927622000083
  27. Don't Unroll Adjoint: Differentiating SSA-Form Programs arXiv (Cornell University) · Cornell University · 2018 10.48550/arxiv.1810.07951
  28. Toward the end-to-end optimization of particle physics instruments with differentiable programming Reviews in Physics · Elsevier BV · 2023 10.1016/j.revip.2023.100085