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

Adjoint DSMC for nonlinear Boltzmann equation constrained optimization

관련 필름·전자재료 · (13) 프리즘 필름

기본 정보

저자
  1. Russel E. Caflisch — Courant Institute of Mathematical Sciences, New York University, New York, NY 10012, United States of America
  2. Denis A. Silantyev — Courant Institute of Mathematical Sciences, New York University, New York, NY 10012, United States of America
  3. Yunan Yang — Courant Institute of Mathematical Sciences, New York University, New York, NY 10012, United States of America
DOI
10.1016/j.jcp.2021.110404
저널
Journal of Computational Physics
발행년도
2021
발행기관
Elsevier BV
피인용수
17
라이선스
publisher-specific-oa
논문 유형
–
언어
–
원문 페이지
https://doi.org/10.1016/j.jcp.2021.110404
토픽
Thermal properties of materials
OpenAlex ID
W3082715535

평가 내용

관련도
관련
사업분야
필름·전자재료 · (13) 프리즘 필름
부 분야
–
R&D 측면
–
확신도
–
근거 용어
–
판단 근거
임베딩 유사도 기반 평가로 '필름·전자재료 > 프리즘 필름' 분야에 선정된 논문입니다.
R&D 활용 포인트
–
평가 입력
–

초록

초록이 없습니다.

본문 74,626자

본문 펼치기
Applications for kinetic equations such as optimal design and inverse problems often involve finding unknown parameters through gradient-based optimization algorithms. Based on the adjoint-state method, we derive two different frameworks for approximating the gradient of an objective functional constrained by the nonlinear Boltzmann equation. While the forward problem can be solved by the DSMC method, it is difficult to efficiently solve the high-dimensional continuous adjoint equation obtained by the "optimize-then-discretize" approach. This challenge motivates us to propose an adjoint DSMC method following the "discretize-then-optimize" approach for Boltzmannconstrained optimization. We also analyze the properties of the two frameworks and their connections. Several numerical examples are presented to demonstrate their accuracy and efficiency. (Denis Silantyev), yunan.yang@nyu.edu (Yunan Yang) arXiv:2009.01363v3 [math.NA] 10 May 2021Derivation of the continuous adjoint equationFollowing the adjoint-state method, we aim to derive the adjoint equations for our optimization problem starting with the Lagrangianin which κ(v) in J 2 is a Lagrange multiplier that enforces the initial condition for any v ∈ R 3 , and γ(v, t) in J 3 is a Lagrange multiplier that enforces the Boltzmann equation for any v and t.We remark that f (v, t) is any function here, and its dependence on the Boltzmann equation and the initial condition is imposed through Lagrange multipliers.We rewrite J 3 to calculate its Fréchet derivative with respect to f .After integrating by parts, we haveand for 0 < t < T the Fréchet derivatives are0.572335 ± 0.0001 0.213839 ± 2.1e-06 0.213836 ± 8.6e-07 ± 0.0002 J 1 = T y (t = 2) 0.213831 ± 0.0003 0.572331 ± 2.1e-06 0.213842 ± 3.1e-07 ± 0.0002 J 1 = T z (t = 2) 0.213834 ± 0.0002 0.213830 ± 2.8e-08 0.572322 ± 5.6e-07 ± 0.0002 J 1 = m4 x (t = 2) 2.289942 ± 0.0011 0.996551 ± 7.5e-06 0.996538 ± 6.0e-06 ± 0.0009 J 1 = m4 y (t = 2) 1.071492 ± 0.0025 3.147580 ± 7.5e-06 1.139506 ± 5.5e-06 ± 0.0011 J 1 = m4 z (t = 2) 1.071524 ± 0.0006 1.139418 ± 1.1e-06 3.147446 ± 5.7e-07 ± 0.0014 J 1 = T x (t = 2) 0.572316 ± 1.1e-05 0.213836 ± 8.4e-06 0.213835 ± 7.7e-06 J 1 = T y (t = 2) 0.213846 ± 9.5e-06 0.572337 ± 1.1e-05 0.213839 ± 9.5e-06 J 1 = T z (t = 2) 0.213838 ± 8.9e-06 0.213828 ± 7.5e-06 0.572325 ± 1.2e-05 J 1 = m4 x (t = 2) 2.289879 ± 1.3e-04 0.996589 ± 8.6e-05 0.996541 ± 8.3e-05 J 1 = m4 y (t = 2) 1.071577 ± 9.1e-05 3.147648 ± 1.8e-04 1.139492 ± 9.0e-05 J 1 = m4 z (t = 2) 1.071486 ± 8.0e-05 1.139424 ± 8.0e-05 3.147454 ± 1.7e-04 ± e rand ∂J 1∂T 0 z J 1 = T x (t = 2) 0.572229 ± 3.6e-03 0.213398 ± 8.9e-04 0.213809 ± 1.1e-03 J 1 = T y (t = 2) 0.211871 ± 4.3e-03 0.573324 ± 2.6e-03 0.213879 ± 1.7e-03 J 1 = T z (t = 2) 0.216833 ± 3.2e-03 0.211929 ± 1.3e-03 0.572561 ± 2.3e-03 J 1 = m4 x (t = 2) 2.285860 ± 1.9e-02 0.992066 ± 8.6e-03 0.992431 ± 9.4e-03 J 1 = m4 y (t = 2) 1.066416 ± 2.7e-02 3.147584 ± 1.7e-02 1.133434 ± 1.4e-02 J 1 = m4 z (t = 2) 1. Introduction The development of modern technology requires accuracy in modeling physical processes. One critical task is to model the kinetic behavior of rarefied gas, which is required for low-pressure gas flow and cannot be accurately described by the Navier-Stokes equations. The Boltzmann equation models the dynamics of a many-particle system through a velocity distribution function, with a nonlinear collision operator that describes binary particle interactions. The Boltzmann equation is a powerful tool from the kinetic theory describing molecular gas dynamics, radiative transfer, plasma physics, and grain and polymer flow [4]. Introduction The Boltzmann equation can also be used for design, optimization, control, and inverse problems. A few of the many examples include the design of the semiconductor device, the topology optimization of the gas flow channel, and risk management in quantitative finance [22,23,21,42,31]. One may use a kinetic perspective to tackle optimal control problems for a large system of interacting agents. Common kinetic models involve the Boltzmann model and some mean-field models [44,17,3,24,25,2]. Many of these applications involve finding unknown or optimal parameters in Boltzmann-type equations such that an objective function formed by the computational or experimental data is optimized, i.e., optimization problems with PDE constraints. However, due to the challenges caused by the complex nonlinear collision term, the linear Boltzmann equation [22] or simplified collision operators such as the Bhatnagar-Gross-Krook (BGK) model [8,42], the Ellipsoidal Statistical model [30], or the Shakhov model [43] have been used as alternatives. Although these simplified models provide good approximations for many scenarios, the original nonlinear collision operator is still preferred for better accuracy [19]. Introduction The main contribution of this work involves the derivation of two optimization frameworks based on the spatially homogeneous Boltzmann equation with the nonlinear collision operator and the design of an efficient adjoint DSMC method for the gradient calculation. In this paper, we focus on the collision kernel for Maxwell molecules, but we expect our method to be generalized to other collision kernels. The frameworks should be broadly applicable to optimal control, optimal design, and general computational inverse problems. We employ two different approaches to derive numerical algorithms: optimize-then-discretize (OTD) and discretize-then-optimize (DTO) [29]. Fig. 1 summarizes the Boltzmannconstrained optimization problem (18) the continuous optimality condition (20) and the adjoint equation (19a) a Lagrangian (28) based on the DSMC method for the state equation (13) solve state and adjoint equations (13) & (19a) numerically and compute (20) the discrete optimality (29) and the adjoint DSMC equation (34) the gradient of (18) optimize OTD discretize approximate discretize DTO optimize approximate Figure 1: A diagram summarizing the OTD approach (solid line) and the DTO approach (dash line) to compute the gradient with respect to the unknown parameter for the optimization problem (18) constrained by the Boltzmann equation (13). Introduction these two approaches. In the OTD approach, we obtain a continuous adjoint equation as an optimality condition, which we discretize by a grid-based method or a Monte Carlo type method. In the DTO approach, we discretize the Boltzmann equation and the objective function using the direct simulation Monte Carlo method (DSMC) [10,38,15], from which a discrete optimality condition and the adjoint DSMC system are derived. The adjoint DSMC from the DTO approach is radically more cost-effective than the continuous adjoint equation in the OTD approach. To our knowledge, this is the first efficient numerical scheme to compute the gradient for nonlinear Boltzmann equation constrained optimization. In addition to the derivations, we also analyze the properties of the two adjoint systems and investigate connections between them. The analysis provides a better understanding of the adjoint-state method for constrained optimization problems. The paper is arranged as follows. In Section 2, we briefly review the homogeneous Boltzmann equation with a nonlinear collision operator, the linearization of the collision operator, and the classical DSMC algorithm for the numerical solution. We derive the continuous adjoint equation for the continuous Boltzmann equation in Section 3 following the Lagrangian method. A particle method is then proposed to solve the continuous adjoint equation numerically. In Section 4, we regard the DSMC discretization of the Boltzmann equation as the forward problem and the particle velocities as the state variables. We then obtain equations for the adjoint particles following the adjointstate method. Since one can compute the gradient of the optimization problem by both the continuous and the discrete adjoint systems, we analyze their properties and prove the critical connections between the two adjoint systems in Section 5. Finally, we show several numerical examples in Section 6 to demonstrate the accuracy of the gradient formulae obtained by both the continuous and the DSMC adjoint systems. Detailed comparison in terms of memory, accuracy, and computational cost of different numerical schemes are presented. Conclusion and future research directions follow in Section 7. Two appendices provide additional details on the numerical methods and numerical analysis of the results. Boltzmann equation and the direct simulation Monte Carlo (DSMC) method In this section, we first give a short introduction to the Boltzmann equation and some of its relevant properties. The later part of the section is devoted to the description of the classical DSMC method. Boltzmann equation We consider the Boltzmann equation Boltzmann equation with the initial condition Boltzmann equation where f (x, v, t) is a nonnegative probability density function that describes the time evolution of the distribution of particles which move with velocity v ∈ R 3 at the position x ∈ R 3 at time t > 0. The bilinear (nonlinear) collision operator Q( f, f ) that describes the binary collisions among particles is defined as follows: Boltzmann equation in which (v , v 1 ) represent the post-collisional velocities associated with the pre-collisional velocities (v, v 1 ) and the σ integral is over the surface of unit sphere S 2 . By conserving the momentum v + v 1 and the energy v 2 + v 2 1 , we have Boltzmann equation where σ is a collision parameter representing a unit direction of the relative velocity of particles after collision (2). We will hereafter use the shorthand notation f, f 1 , f , f 1 to denote f (v), f (v 1 ), f (v ) and f (v 1 ). The collision operator Q has the following symmetries, which are related to the conservation of mass, momentum and energy: The transformations Boltzmann equation with v and v 1 defined by (2) are isometries for (σ, v, v 1 ) ∈ S 2 × R 3 × R 3 [18,46]. We define the unit vector along the Boltzmann equation whereq is related to q by a change of variable [46]. It follows that for any measurable function Boltzmann equation These symmetries are used repeatedly through the paper. The kernel q is a nonnegative function that characterizes the details of the binary interactions. For the Variable Hard Sphere (VHS) model, the collision kernel is Boltzmann equation In particular, when β = 0, the collision kernel corresponds to the Maxwellian gas, which (along with C β being constant) is the model that we focus on in this paper. For the Coulomb interaction, the collision kernel is given by the Rutherford formula Operator formulation for collisions In this section, we rewrite the collision rules (2), in an operator formulation that clarifies some properties that will be useful for the analysis in later sections. First we denote α = (v − v 1 )ˆand σ = (v − v 1 )ˆusing the notation xˆ= x/|x|, in which the equation for σ and the relation |v − v 1 | = |v − v 1 | follow from (2). As described in [46, P.53], the change of variables Operator formulation for collisions is an involution with unit Jacobian. Operator formulation for collisions We can rewrite (2), in terms of operators, as Operator formulation for collisions where A(σ, α) = 1 2 Operator formulation for collisions where I is the identity matrix in R 3 and B = A T = A −1 . Now consider small perturbations δv and δv 1 in the pre-collision velocities v and v 1 . Since the collision parameter vector σ is chosen independently of v and v 1 for a Maxwellian gas, there is no need to perturb σ; i.e., δσ = 0. Also Operator formulation for collisions The resulting first-order variations δv and δv 1 in the post-collision velocities are δv The linearized collision operator The linearized collision operator is defined through perturbation theory [18], most frequently by linearization around a Maxwellian equilibrium. In this subsection, we define the linearized operator, due to multiplicative perturbation [5,14] around a non-equilibrium distribution and its adjoint operator under a weighted L 2 inner product. The linearized collision operator For a general velocity distribution f , consider the multiplicative perturbationf = f (1 + ψ). Since the collision operator Q(f,f ) defined in (1) is bilinear, The linearized collision operator in which ≈ means that quadratic terms in ψ are neglected. We define the linearized operator L[ f ] based on f and applied to ψ as The linearized collision operator In an original paper of Maxwell in 1866 [35], the Boltzmann equation was written in the weak formulation [46]. Following this approach for a test function γ(v, t) and using the symmetries (3), one gets the identitŷ The linearized collision operator where γ 1 , γ and γ 1 are shorthand notations for γ(v 1 , t), γ(v , t) and γ(v 1 , t). We will use (10) to find the adjoint of L[ f ]. The linearized collision operator We replace f by f (1 + ψ) in (10) and calculate the first-order terms with respect to ψ. As in the derivation of (9), the first-order terms in the left-hand side of (10) are derived aŝ The linearized collision operator Similarly, the first-order terms in the right-hand side of (10) are derived as The linearized collision operator Combining both sides, we obtain the first-order variation equation The linearized collision operator which is equivalent to the following The linearized collision operator and (h 1 , h 2 ) L 2 (µ) =´h 1 h 2 f dv is the inner product for the weighted Hilbert space L 2 (µ) in which f dv = dµ. This shows that operator The linearized collision operator In the special case that f = M is a Maxwellian equilibrium distribution, using the symmetries (3) and the equilibrium property MM 1 = M M 1 , The linearized collision operator Comparison of (12) and (11) shows that L * [M] = L[M]; i.e., that L[M] is self adjoint. The linearized collision operator around a Maxwellian has been extensively studied in the literature [18,46,11]. The direct simulation Monte Carlo (DSMC) method In this section, we describe the classical DSMC method [10] for the spatially homogeneous Boltzmann equation following the presentation of [40]: The direct simulation Monte Carlo (DSMC) method As stated above, our focus is also on a Maxwellian gas for which the collision kernel does not depend on the relative velocity |v − v 1 |, i.e., q(v − v 1 , σ) = q(σ), but the algorithm below can be modified to apply to a general set of collision kernels [10,40]. Under this assumption, (13) can be rewritten in the form of The direct simulation Monte Carlo (DSMC) method where ρ =´R 3 f dv, µ = ρ´S 2 q(σ)dσ, and The direct simulation Monte Carlo (DSMC) method We remark that f ρ = 1 ρ f is a probability density in the velocity space for any given t. It also follows the Boltzmann equation (13) with a scaled collision kernel. Without loss of generality, we regard f = f ρ as a probability density function hereafter. The direct simulation Monte Carlo (DSMC) method In the DSMC method, we consider a set of N velocities evolving in time due to collisions whose distribution can be described by the probability distribution function f in (13). We divide time interval [0, T ] into M number of sub-intervals of size ∆t. At the k-th time interval, the particle velocities are represented as The direct simulation Monte Carlo (DSMC) method and we denote the i-th velocity particle in V k as v i (t k ) or v k,i . The forward Euler scheme applied to (14) gives The direct simulation Monte Carlo (DSMC) method where f k = f (v, k∆t). If additionally we discretize the velocity distribution at time t k = k∆t by the velocity particles V k defined in (15), which is to say The direct simulation Monte Carlo (DSMC) method we can interpret (16) in terms of probability, which is the core idea of the method. At time t k , a particle with velocity v k,i will not collide with probability (1 − µ∆t), and it will collide with another velocity particle with probability µ∆t, according to the collision law described by P( f k , f k )(v). Nanbu proposed an algorithm based on this probabilistic interpretation [38], and later its convergence was proved by Babovsky and Illner [6]. One can view Algorithm 1 as the realization of DSMC with the forward Euler scheme (16). (14) is convenient to illustrate the core idea of DSMC but does not apply to all collision models. The acceptance-rejection method using "virtual collisions" is required to sample from a more general cross section [15]. Given the velocity of particles from the previous time step, V k−1 . 4: Select N c /2 collision pairs (i, j) uniformly among all possible pairs without replacement. 5: For those selected pairs, perform the collision between v k,i and v k, j based on (2); obtain the post-collision velocity v k,i and v k, j . 6: Set v k+1,i = v k,i and v k+1, j = v k, j . 7: Set v k+1,i = v k,i for all particles that have not collided. 8: end for Continuous adjoint Boltzmann equations We consider an idealized optimization problem for the spatially homogeneous Boltzmann equation (13). The initial condition is Continuous adjoint Boltzmann equations in which f 0 is the prescribed initial data depending on a parameter α. We aim to find α which optimizes the objective function at time t = T , Continuous adjoint Boltzmann equations When the number of unknowns is large, which is the dimensionality of α in our case, the adjoint-state method is necessary as an efficient numerical method for computing the gradient of a function or operator in a numerical optimization problem [9,16]. It has applications in geophysics [20], seismic imaging [41] and general inverse problems [36]. It is also the theoretical foundation that gave rise to the back-propagation method in the 1990s for neural networks and machine learning [32]. One outstanding advantage of the adjoint-state method is that the number of PDE solves is independent of the dimension of the parameter for which the gradient needs to be calculated. Continuous adjoint Boltzmann equations The calculation of δJ 32 δ f follows the derivation of collisional invariants for the Boltzmann equation [19]. It follows, using the symmetries (3), that Continuous adjoint Boltzmann equations where γ, γ 1 , γ and γ 1 are shorthand notations for γ(v, t), γ(v 1 , t), γ(v , t) and γ(v 1 , t). Now we perturb f by an amount δ f and investigate the resulting change in J 32 . We obtain the first-order variation: Continuous adjoint Boltzmann equations Thus, the Fréchet derivative of J 32 with respect to f is Continuous adjoint Boltzmann equations where the second equality follows (11). Together with all the other functional derivatives, we obtain the following equations: Continuous adjoint Boltzmann equations Based on the first-order necessary condition for optimality, we set these variations to zero to obtain the adjoint equation for the adjoint variable γ: Continuous adjoint Boltzmann equations The adjoint equation evolves backward in time from T to 0, thus the final condition (19b) is given instead of the initial condition. After time evolution, we can use γ(v, 0) to eliminate κ(v) and obtain the gradient of the objective function with respect to parameter α: Continuous adjoint Boltzmann equations The continuous adjoint equation (19a) is an integro-differential equation which shares significant similarities with the linearized Boltzmann Equation [18]. We will further analyze and discuss the adjoint system in Section 5. Continuous adjoint Boltzmann equations Given an initial guess α 0 for the model parameter, the first step is to solve the forward equations (13) numerically with initial condition (17) for f . A common choice is the DSMC method because of the nonlinear collision operator. The second step is to solve the adjoint equation (19a) numerically with the final condition (19b) for the adjoint variable γ. One can solve the adjoint equation using a finite difference method in t and grid-based quadrature in v, but this is computationally difficult because v is three dimensional, and the integral at each value of v is five-dimensional. In Section 3.2, we propose Algorithm 2 as an efficient Monte Carlo type method for solving (19a). In the third step, we compute the gradient ∂ α J based on (20) using the numerical solutions from the first two steps. Numerical examples and comparisons are presented in Section 6. One can then update α iteratively using a gradient-based optimization algorithm to find the optimal parameter. This is the "optimize-then-discretize" (OTD) approach to solve the PDEconstrained optimization numerically. Continuous adjoint Boltzmann equations We remark that the entire derivation above is unrelated to the dimensionality of the model parameter α. In practice, α can be, for example, a function of the velocity domain. Hence, an accurate numerical discretization of the parameter can contain thousands of variables. It is then infeasible to obtain the gradient by numerical differentiation. On the other hand, using the adjoint-state method, the cost of evaluating the gradient once is equivalent to only one forward solve of the Boltzmann equation (13) and one (backward) solve of the adjoint equation (19a), independent of the number of variables in α. The adjoint-state method is an extremely efficient tool for large-scale optimization problems. A particle method for the continuous adjoint Boltzmann equation The adjoint DSMC method presented in Section 4 is the main result of this work and the most efficient and accurate that we have found for solving the adjoint problem. Nevertheless, the particle method described in this section may be of independent interest. It is based on a formal derivation with several steps that are not fully justified, but are validated by the numerical results in Section 6. A particle method for the continuous adjoint Boltzmann equation The continuous adjoint equation (19a) is based on the solution to the forward equation f (v, t), t ∈ [0, T ]. Therefore, we assume that the state (forward) equation (13) has been solved numerically by the DSMC method, where the choice of collision times, collision partners, and collision angles during the simulation are all stored in memory. Based on the solution from the forward DSMC simulation, we will (approximately) solve the equation (19a) for γ(v, t) backward in time t with the "final data" (19b). A particle method for the continuous adjoint Boltzmann equation According to (13) and (19a), we have A particle method for the continuous adjoint Boltzmann equation We then multiply both sides by a time-independent test function ψ(v) and integrate over the velocity domain. The left-hand side becomesˆR A particle method for the continuous adjoint Boltzmann equation Using the symmetries (3), the right-hand side becomes A particle method for the continuous adjoint Boltzmann equation Combining both (21) and (22), we discretize the time domain of the equation using the Euler scheme in t. Consider a time interval [t k , t k+1 ] during which there is a collision of v and v 1 at t = t k to produce v and v 1 at t = t k+1 . A particle method for the continuous adjoint Boltzmann equation As in the (forward) DSMC Algorithm 1, (22) should be evaluated at t k since v and v 1 are independent before the collision so that the product f f 1 is the joint density function for v and v 1 . A particle method for the continuous adjoint Boltzmann equation On the other hand, the choice of time t at which to evaluate γ(v, t) is a new issue and not so clearcut. We choose to evaluate γ(v, t) at t k+1 based on the following considerations: First, the data for the adjoint variable comes at the final time (19b), so that (19a) should be solved backward in time, and it is most natural for the right-hand side (22) to be evaluated at the final time t k+1 of the time interval. Second, since γ is solved backward in time, we expect that γ(v, t k+1 ) is independent of f (v, t k ), so that it is reasonable to sample using these values. Third, our numerical computations in Section 6 verifies that this choice leads to a correct result. A particle method for the continuous adjoint Boltzmann equation Based on these choices, we take A particle method for the continuous adjoint Boltzmann equation Without loss of generality, we assume ρ =´f dv = 1 and µ = ρ´q A particle method for the continuous adjoint Boltzmann equation We apply Monte Carlo quadrature to approximate the integrals on both sides of (23), using the velocities from V k and V k+1 (defined as in (15)) and values of σ that were selected in the forward DSMC calculation. Similar to (15), we represent the adjoint variables as A particle method for the continuous adjoint Boltzmann equation Both sides of the resulting Monte Carlo sums for (23) are nonzero only for velocities that undergo collisions. For the Monte Carlo quadrature we have N c /2 = µ∆tN /2 collision pairs. A particle method for the continuous adjoint Boltzmann equation The j-th collision between velocities A particle method for the continuous adjoint Boltzmann equation On the left-hand side of (23), the term γ k+1 is represented byγ ,γ 1 in Γ k+1 and the term γ k is represented bŷ A particle method for the continuous adjoint Boltzmann equation On the right-hand side of (23), the terms γ k+1 , γ k+1,1 are represented byγ ,γ 1 ∈ Γ k+1 , but the terms γ k+1 , γ k+1,1 are at t = t k+1 and correspond to velocities v, v 1 V k+1 , so that the correspondingγ values are not in Γ k+1 . We will instead use the values of the continuous function γ(v, t k+1 ) and γ(v 1 , t k+1 ). A particle method for the continuous adjoint Boltzmann equation The resulting quadrature approximation for (23) by Monte Carlo sampling is A particle method for the continuous adjoint Boltzmann equation The values of the continuous adjoint function in (24) can be expressed in terms of a conditional expectation: A particle method for the continuous adjoint Boltzmann equation Since ψ is an arbitrary test function, and (24) holds for any ψ, we can match the coefficients and obtain a Monte Carlo type numerical scheme for solving γ(v, t). If velocity particle v j did not collide at time t k , A particle method for the continuous adjoint Boltzmann equation If v j and v j 1 are a collision pair at time t k , A particle method for the continuous adjoint Boltzmann equation (26b) A particle method for the continuous adjoint Boltzmann equation Following [34,45], one may approximate the expectation E[γ i (t k+1 )|v i = v j ] by numerical interpolation as the following:γ A particle method for the continuous adjoint Boltzmann equation for appropriately chosen interpolation coefficients ω(v). Given the final condition (19b), the continuous adjoint equation (19a) can be solved numerically following Algorithm 2. A particle method for the continuous adjoint Boltzmann equation Algorithm 2 Algorithm for solving the continuous adjoint equation (19) 1: Given the final-time velocity particles V M in the forward DSMC and the final condition (19b), setγ A particle method for the continuous adjoint Boltzmann equation Given Γ k+1 from the previous iteration and V k from the forward DSMC. 4: if v j ∈ V k did not collide at t k then 5: (27). 8: Setγ j (t k ) andγ j 1 (t k ) following (26). 9: end if 10: Adjoint DSMC for Boltzmann equation In this section, we derive the adjoint system based on the DTO approach. We first rewrite the objective functions and the constraints based on the DSMC method, to which the Lagrange multiplier method will be applied. Adjoint DSMC for Boltzmann equation Following Algorithm 1, we discretize the time [0, T ] into M equal intervals [t k , t k+1 ] and denote v k,i to be the velocity of the i-th particle at time t k , for 1 ≤ i ≤ N and 0 ≤ k ≤ M. We also denote v I,i to be the velocity of the i-th particle at the initial time t = 0, and v F,i to be the velocity of the i-th particle at the final time t = T . The DSMC method applied to the spatially homogeneous Boltzmann equation consists of a sequence of particle collisions in sequential order, and the time step ∆t plays no role. So we will choose ∆t in whatever way is most convenient for the exposition. In this section, ∆t will be chosen small enough that there is at most a single collision in each time step. Adjoint DSMC for Boltzmann equation Consider the new objective function J defined as Adjoint DSMC for Boltzmann equation Here, J 1 is the Monte Carlo quadrature of the objective function (18) by particle velocities {v F,i } N i=1 , J 2 is the constraint on the DSMC initial condition v = v 0 (α) using the Lagrange multiplier {γ I,i } N i=1 , and J 3 is the constraint that enforces the binary collision law (2) using the Lagrange multiplier γ k,i for each particle i at the k-th time interval. In particular, v k,i represents the post-collision velocity of particle i if it participates in the collision at the k-th time interval. Otherwise, v k,i = v k,i , which means the particle velocity remains the same at the (k + 1)-th time interval. Again, we regard that {v k,i } is a general set of velocities, and its dependence on the collision rules (2) is imposed through the Lagrange multipliers. The following variation is easily calculated: Adjoint DSMC for Boltzmann equation We proceed to derive the equations in the backward time direction from the final time t = T to the initial time t = 0. First, we consider the equations that come from the derivative of J with respect to v F,i , which are derived in Section 4.1. Second, we consider collisions that occur at a time t where 0 < t < T . The derivatives of J with respect to the velocities in these collisions are derived in Section 4.2. Velocities at the final time for DSMC We denote a particular particle velocity at the final time as w F = v F,i for some i, and the corresponding value of its dual variable is γ F = γ F,i , as shown in Fig. 2(a). The velocity w F occurs in the objective function J at two places. First, it directly appears in the term r(v F,i ) in J 1 . Second, it occurs in the last collision that involves v F,i , through the term γ F,i · (v F,i − v k,i ) in J 3 . In this term, v k,i is a velocity produced by the collision, and is a function of the two velocities before the collision, but v k,i does not depend on v F,i here. Therefore, Velocities at the final time for DSMC The resulting equation comes from the first-order optimality ∂ w F J = 0: Velocities at the final time for DSMC Equation (30) provides the starting values for solving the adjoint variable γ backward in time. Collisions away from the final time for DSMC According to the DSMC method, with V k denoting the set of velocities in the k-th time interval as in (15), the collision operator C takes V k to V k+1 = C[V k ] as follows: We first choose indices i and j, and denote the corresponding velocities as (w k ,w k ) = (v k,i , v k, j ) from V k and also choose a unit vector σ k . Here, we assume the i-th and the j-th particles collide at the k-th time interval. Then C takes (w k ,w k ) to Collisions away from the final time for DSMC On the other hand, we denote w k−1 andw k−1 to be the particle velocities whose collision produces w k . Similarly, w k is produced by particle velocities w k−1 and w k−1 . Particle velocities Collisions away from the final time for DSMC correspond to the dual (adjoint) variables Collisions away from the final time for DSMC respectively, as shown in Fig. 3, which schematically depicts the three collisions that involve particles w k andw k . Collisions away from the final time for DSMC Next, we recall the variational quantity J 3 for collisions, with dual quantities γ, as Collisions away from the final time for DSMC We use J 3k to denote the terms in J 3 that involve w k orw k : Collisions away from the final time for DSMC Note that w k−1 is a function only of w k−1 andw k−1 , and that w k−1 is a function only of w k−1 and w k−1 . Consequently, w k−1 and w k−1 , as well as w k+1 andw k+1 , do not depend on w k andw k . It follows that Collisions away from the final time for DSMC These derivatives can be calculated from (31) to get Collisions away from the final time for DSMC where xˆ= x/|x| denotes the unit vector along the direction of x. Therefore, Collisions away from the final time for DSMC Setting these two partial derivatives to 0, gives the equations Collisions away from the final time for DSMC Moreover, (33) can be rewritten using the operator notation (7) from Section 2.2 as Collisions away from the final time for DSMC in which α k = (w k −w k )ˆ. Note that (33) for γ k andγ k does not involve any variables at time interval k − 1. It follows that (33) is valid for values of γ I = γ k andγ k corresponding to a collision in which one (or both) of the velocities w I = w k started at t = 0, as depicted in Fig. 2(b). Collisions away from the final time for DSMC The adjoint DSMC equations (33a)-(33b), which we derive following the DTO approach, are the DSMC analog of the dual equation (19a), and they are one of the main results of this paper. The evolution equations for the dual variable γ are solved backward in time, from (k + 1)-th time interval to the k-th time interval, for each k. For each collision, these equations are solved for the dual variables corresponding to the particle velocity variables involved in that collision. Summary for discrete adjoint system In summary, we solve the direct equations in DSMC forward in time for the velocity particles V = {v 1 , . . . , v N } with the initial particle velocity sampled from (17) given the current value of α. Collisions are performed according to (2). Then the adjoint equations (33a)-(33b) for the adjoint particle γ are solved backward in time following Algorithm 3. At the initial time t = 0, we use (29) to calculate the gradient of the objective function with respect to the model parameter α, which can be used by optimization algorithms to update the α iteratively. Summary for discrete adjoint system Algorithm 3 Algorithm for solving the discrete adjoint DSMC system (33). 1 : Given the final-time velocity particles Given {γ k+1,1 , . . . , γ k+1,N } from the previous iteration and collision parameters in the forward DSMC. 4: if v j ∈ V k did not collide at t k then 5: Set γ k, j = γ k+1, j . 6: else if v j , v j 1 ∈ V k collided at t k then 7: : Given the final-time velocity particles Perform backward collision between γ k+1, j and γ k+1, j 1 and obtain γ k, j and γ k, j 1 following (33a) and (33b). Obtain {γ k,1 , γ k,2 , . . . , γ k,N }. 10: end for Like the continuous adjoint system (Section 3), by solving the direct equations and the adjoint equations only once, we obtain all components of the gradient ∂ α J, for any value of the dimensionality of α. We remark that the choice of collision times, collision partners, and collision angles is not included in the variational principle. These parts of the DSMC method are determined externally. : Given the final-time velocity particles The restriction to Maxwell molecules significantly simplifies the adjoint DSMC method presented in this section. Since the collision kernel q is a constant, the collision rate for a pair of velocities v and v 1 and the choice of the collision parameter σ do not depend on the values of the velocities. This implies that variations δv and δv 1 in the velocities do not cause variations in the choice of collision pairs nor in the collision parameter, which simplifies the adjoint DSMC equation (33). This is the main reason that we restricted our attention to Maxwell molecules in this work. We believe it is possible to extend the adjoint DSMC method to non-Maxwell interactions. Extension to collision kernels q = q(θ) with angular dependence should be straightforward since, in that case, the only thing that changes is the sampling of the collision parameter σ, while it is still independent of pre-collision velocities v and v 1 . Extensions to the VHS model with q = q(|v − v 1 |) collision kernel and other non-Maxwell interactions are more intricate since either the collision rates or the collision parameter σ will depend on pre-collision velocities. The former could be mitigated by using a different DSMC method with a constant collision rate such as [12], while the latter would produce additional terms in ∂ w k w k , ∂w k w k , ∂ w kw k , ∂w kw k in (32). We leave such generalizations for future work and they are beyond the scope of this paper. Relationship between the continuous adjoint and the adjoint DSMC formulation In this section, we discuss the similarities and differences between the continuous adjoint formulation (Section 3) and the adjoint DSMC formulation (Section 4). The former is derived under the "optimize-then-discretize" (OTD) approach, while the latter is based on the "discretize-then-optimize" (DTO) approach. For a given discretization scheme, OTD and DTO may not be equivalent, as demonstrated by many examples in the literature [28,13,1,29,33]. The DTO approach is particularly preferred for problems that are otherwise unsolvable under the OTD approach, such as the heat-transfer optimization problem [7,26]. Relationship between the continuous adjoint and the adjoint DSMC formulation Since DTO and OTD are generally not the same, we investigate the analytical properties of the two adjoint systems. The analysis in Section 5.1 illustrates the essential role of the continuous adjoint variable γ(v, t), as a Fréchet derivative of the objective function. We find a similar result for the discrete adjoint variable γ k,i for DSMC in Section 5.2. Based on these results, we find a direct relationship between γ(v, t) and γ k,i in Section 5.3 that connects the two adjoint systems. Relationship between the continuous adjoint and the adjoint DSMC formulation We remark that the derivatives in this section have slightly different meanings from the ones used before. In Section 3 and Section 4, the constraints for the state variables are not directly applied, but instead are imposed by the adjoint variables in the Lagrangian formulation. Here in Section 5, the derivatives with respect to f (v) or v k are computed with the assumption that they are directly constrained to satisfy the Boltzmann equation (13) or the DSMC equations, respectively. Continuous adjoint variable as a Fréchet derivative If f (v, t) is a solution of the Boltzmann equation (13), then the linearized equation for a perturbed distribution Continuous adjoint variable as a Fréchet derivative using the linearized collision operator (9). For objective function J 1 (α) =´v r(v) f (v, T )dv, the perturbation δ f causes a perturbation δJ 1 , which satisfies Continuous adjoint variable as a Fréchet derivative for any t because the perturbation δ f (t, ·) determines δ f (t , ·) for any t > t. Since J 1 is time-independent, ∀t ∈ [0, T ], we have Continuous adjoint variable as a Fréchet derivative Here, we have used the chain rule, the duality between L[ f ] and L * [ f ], and (35). Continuous adjoint variable as a Fréchet derivative Since the perturbation δ f is arbitrary, the following holds for any t Continuous adjoint variable as a Fréchet derivative Note that equation (36) for − δJ 1 δ f is the same as equation (19a) for the continuous adjoint function γ(v, t). Additionally, as seen directly from the objective function, the "final" condition for (36) is − δJ 1 δ f (v,T ) = −r(v), the same as the "final" condition (19b) for γ(v, T ). Based on these two facts, we obtain the main result of this subsection: Continuous adjoint variable as a Fréchet derivative Therefore, the continuous adjoint variable γ(v, t) is the negative Fréchet derivative of the objective function with respect to the state variable f (v, t). DSMC adjoint variable as a derivative The analysis of the DSMC adjoint variable γ is a discrete version of the analysis in the previous section for the continuous adjoint variable γ. Consider small perturbations δw k and δw k in the pre-collision velocities w k andw k . The resulting first-order variations in the post-collision velocities are δw k+1 and δw k+1 . Since no other velocities are changed at times t k and t k+1 and because J 1 is time independent, then DSMC adjoint variable as a derivative which can be rewritten in operator form, and then by using (8), as DSMC adjoint variable as a derivative Since this is true for any values of δw k and δw k , it follows that DSMC adjoint variable as a derivative By taking the transpose and using A T = B, then DSMC adjoint variable as a derivative Equation (38) shows that (∂ w k J 1 , ∂w k J 1 ) satisfies the same back-propagation rule as (34) for (γ k ,γ k ). DSMC adjoint variable as a derivative Recall (30) for the final condition for the adjoint DSMC particles, DSMC adjoint variable as a derivative in which the second equation comes from the definition of J 1 in (28). With the same final condition (39) (up to a constant scaling −N), and the same back-propagating rule (34) and (38) from t k+1 to t k , we conclude that Connections between the continuous and DSMC adjoint variables Given an empirical distribution and its limit, we know by the strong law of large numbers that Connections between the continuous and DSMC adjoint variables for every measurable set Ω ⊆ R 3 , where I Ω is the indicator function. Also, Connections between the continuous and DSMC adjoint variables Next, we derive the connections between the two derivatives at any time step t k , Connections between the continuous and DSMC adjoint variables and ∂J 1 ∂v k,i , which will directly uncover the relationship between the continuous and DSMC adjoint variables based on (37) and (40). Connections between the continuous and DSMC adjoint variables We consider two empirical density functions, Connections between the continuous and DSMC adjoint variables as the approximations to the density functions f (v, t k ) and f (v, t k ) + δ f (v, t k ), respectively. We remark that v k,i are random variables following the distribution function f (v, t k ), while we choose δv k,i to be deterministic, as follows: Connections between the continuous and DSMC adjoint variables Here, Ω is an arbitrary measurable set and η is a small constant vector. The first-order variation of the continuous and the discrete objective functions can be stated as below. For any time step t k , Connections between the continuous and DSMC adjoint variables Consider v i = v k,i as one of the N random variables following the distribution f (v, t k ), and denote φ(v) = δJ 1 δ f (v,t k ) . Based on (41), we have Connections between the continuous and DSMC adjoint variables On the other hand, (41) is related to (42) as the following Connections between the continuous and DSMC adjoint variables We assume that all v i = v k,i , for i = 1, . . . , N, are (approximately) i.i.d. random variables following the same velocity distribution f (v, t k ). Therefore, by combining (43) and (44), we have Connections between the continuous and DSMC adjoint variables Since η is an arbitrarily small vector in R 3 , then Connections between the continuous and DSMC adjoint variables where we change the variable from v i to v for the first term and apply the law of total expectation to the second term. Connections between the continuous and DSMC adjoint variables Since the set Ω is arbitrary, φ (v) = ( δJ 1 δ f (v,t k ) ) = −γ (v, t k ) and N ∂J 1 ∂v k,i = −γ k,i , which have been shown previously in (37) and (40), we obtain the following equation Connections between the continuous and DSMC adjoint variables Equation (45) serves as a bridge connecting the two adjoint systems that we have derived in Section 3 and Section 4. The unbiasedness of the adjoint DSMC gradient estimator In (20) and (29), we derive two gradient formulae, ∂ α J and ∂ α J, through the continuous and the discrete adjoint systems, respectively. Next, we show the unbiasedness of the gradient estimator ∂ α J computed through the adjoint DSMC approach: The unbiasedness of the adjoint DSMC gradient estimator There are a direct way and an indirect way to draw samples from continuous distributions f (v, 0) = f 0 (v; α), which is also our initial distribution for the Boltzmann equation: The unbiasedness of the adjoint DSMC gradient estimator The second and indirect approach is to first sample from a simpler base distribution φ( ), which is independent of the parameter α, and then transform this variate through a deterministic path g( , α). This is often referred to as the sampling path or the sampling process [27,37]. For an invertible path, we have the mass-preserving equation: The unbiasedness of the adjoint DSMC gradient estimator Recall in Section 3 where we derive the OTD framework, The unbiasedness of the adjoint DSMC gradient estimator Based on the Law of the Unconscious Statistician (LOTUS), The unbiasedness of the adjoint DSMC gradient estimator Therefore, we have The unbiasedness of the adjoint DSMC gradient estimator The last equality is based on the change of variable v = g( , α). Together with Equation (45), we have The unbiasedness of the adjoint DSMC gradient estimator In conclusion, ∂ α J is an unbiased pathwise Monte Carlo gradient estimator for the objective function J. The unbiasedness of the adjoint DSMC gradient estimator If we solve the continuous adjoint equation (19a) numerically and then compute the gradient for α following (20), the result should match the gradient computed by the DSMC adjoint approach in Section 4 within numerical error. For example, (19a) can be solved numerically by the DSMC-type scheme which we propose in Section 3.2. The continuous and the DSMC adjoint systems are equivalent in optimizing the model parameter α. We will present several numerical examples that verify the gradient accuracy and demonstrate the optimization process in Section 6. Numerical results In this section we discuss the results of numerical simulations computing the gradients of the objective function (28), Numerical results at the final time t = T with respect to the parameter α in the initial conditions f 0 (v; α). Four different methods of the gradient computation are used here: (i) finite difference method using several forward DSMC simulations with different parameter values, (ii) the adjoint DSMC method, (iii) the DSMC-type scheme for the adjoint equation, (iv) the direct discretization of the continuous adjoint equation (19a). All four methods lead to the same gradient values, but the adjoint DSMC method is the best in terms of performance given we do not need many digits of accuracy. Numerical results Here we consider Maxwellian gas, so the distribution function f (v, t) obeys the Boltzmann equation (13) with a collision operator kernel q(v − v 1 , σ) = q(σ). We further assume that q(σ) = 1/(4π) and ρ(t) =´R 3 f (v, t)dv = 1 (conserved throughout the evolution of the distribution function), and thus µ = ρ´S 2 q(σ)dσ = 1 in (14). Numerical results For the function r(v) in Section 6.1-6.4, we use v 2 l and v 4 l , l ∈ {x, y, z}, so the objective functions are Numerical results They are the second-order and the fourth-order velocity moments of the distribution function in the l-direction at the time t = t k . We have six objective functions in total. For the parameter α we use temperature values in the initial distribution function α = [T 0 x , T 0 y , T 0 z ]. We further refer to these gradients as ∂T l ∂T 0 p and ∂m4 l ∂T 0 p respectively, l, p ∈ {x, y, z}. Here the dimension of α is only 3. Still, a real advantage of these methods is, of course, when the vector α is highly multi-dimensional since the described methods allow one to compute all the components of the gradient δJ 1 δα by doing the only one forward DSMC simulation and one backward adjoint DSMC simulation. Numerical results For all the methods we use the same initial condition, anisotropic Gaussian, Numerical results where T 0 x = 0.5, T 0 y = 1, T 0 z = 1, and the total density ρ = 1. In this case, the solution to the Boltzmann equation (13) will relax to an isotropic Gaussian with the temperature T M = (T 0 Numerical results x + T 0 y + T 0 z )/3 = 0.8333 (3) Forward DSMC simulation We solve the Boltzmann equation (13) with the Nanbu-Babovsky method as described in Algorithm 1. We represent the distribution function with N particles, ranging from 10 6 to 10 8 , and sample the initial condition from the distribution in (49). Collisions are performed according to the collision rules (2) and the collision angles are sampled uniformly over a unit sphere according to the collision kernel of Maxwellian particles, q(v − v 1 , σ) = 1/(4π). Based on Algorithm 1, the fraction of particles that collide at every time step is N c /N = ∆tµ and is equal to 10% for ∆t = 0.1, µ = 1. The total kinetic energy K(t) = T x (t) + T y (t) + T z (t) and the total momentum p(t) = (p x (t), p y (t), p z (t)), where p l (t) =´R 3 v l f (v, t)dv, are conserved by construction of the algorithm, since every pair-wise collision is elastic. Fig. 4 shows the relaxation of temperatures T x (t), T y (t), T z (t) towards the value T M as well as the relaxation of the fourth-order moments m4 x (t), m4 y (t), m4 z (t) towards the value 3T 2 M as functions of time. Running the standard DSMC simulations several times with randomly sampled initial conditions allows us to estimate the mean values and the standard deviations of quantities of interest at t = T = 2. Details are shown in Table 1, where the standard deviation σ X is computed using M s = 100 simulations with N = 10 6 , 10 8 particles in each. The standard deviations of the quantities of interest give us estimates of the random errors in DSMC algorithm with N particles. They scale with 1/ √ N which can be seen from the σ X values in Table 1. The actual standard deviations of the mean valuesX in Table 1 Table 1: Mean values of p x , p y , p z , T x , T y , T z and m4 x , m4 y , m4 z and their standard deviations at t = 2, which are computed using M s standard DSMC simulations with N particles in each. The temperatures in the initial condition (49) are set to be [T 0 Forward DSMC simulation valuesX by using 95% of the trust interval of radius 2σX, so e rand Forward DSMC simulation . Finally, we have an estimates of expectations: Forward DSMC simulation Based on this approach and the values of σ X from Table 1, we can see that when N = 10 8 and M s = 100, the random errors of T x (t = 2), T y (t = 2), T z (t = 2) are e rand T l = 2σ T l / √ M s ≈ 0.00002 (or relative error e rand T l /T l ≈ 0.002%). The random errors of m4 x (t = 2), m4 y (t = 2), m4 z (t = 2) are e rand m4 l = 2σ m4 l / √ M s ≈ 0.0001 (or relative error e rand m4 l /m4 l ≈ 0.005%), l ∈ {x, y, z}. Forward DSMC simulation To directly compute the gradients of the velocity moments with respect to the parameter α = [T 0 x , T 0 y , T 0 z ] by finite difference, we need to perturb the parameter by a small amount and then compute the corresponding target values at those different initial temperatures. For each component in [T 0 Forward DSMC simulation x T 0 y T 0 z ], we apply a perturbation of size ∆T 0 l = 0.1 or 0.05 away from the original values of [T 0 Forward DSMC simulation x T 0 y T 0 z ] = [0.5 1 1]. In Table 2, we gather the resulting mean values of the moments that are computed using M s = 100 simulations and N = 10 8 particles in each simulation. Forward DSMC simulation Using the values in Table 2, we can estimate the gradients ∂J 1 ∂α (α 0 ) via the central finite difference Forward DSMC simulation We can also estimate their errors e ∂J 1 ∂α (α 0 ) , as shown in Table 3. The error in ∂J 1 ∂α (α 0 ) consists of two parts: Table 2: Mean values of T x , T y , T z and m4 x , m4 y , m4 z at t = 2 which are computed using M s = 100 standard DSMC simulations with N = 10 8 particles in each. The initial condition (49) is set with the given initial temperatures [T 0 Forward DSMC simulation where the finite difference error can be estimated as Forward DSMC simulation where ∆α is a finite step used to estimate ∂ 3 J 1 ∂α 3 , and the random error can be estimated roughly as Forward DSMC simulation Notice that the finite difference error is proportional to (∆α) 2 while the random error is proportional to 1/∆α, meaning that there is an optimal value of Forward DSMC simulation for a given value of the random error e rand J 1 (α 0 ) in J(α 0 ) and the third-order derivative of J 1 at α 0 (unknown a priori) for which the total error is minimal. We compute the third-order derivatives according to (53) with ∆α = 0.05. Together with the previously computed e rand T l and e rand m4 l , we estimate the optimal step size ∆α * ∈ (0.06, 1.5), for various components of ∂T l ∂T 0 p and ∂m4 l ∂T 0 p . Eventually, we opt for ∆α = ∆T 0 p = 0.1 for the computation of the gradients and the estimations of the errors that are shown in Table 3. The random errors reflected in the last column of Table 3 are computed using the standard deviations σ T l and σ m4 l from the last column of Table 1 together with (50) and (54). Comparing the random errors in the last column with the finite-difference errors in the other columns of Table 3, we observe that our choice of ∆α = 0.1 is nearly optimal for p = x components and smaller than optimal for the p = y, z components, but the current value of ∆α is good enough for our purposes. Adjoint DSMC In the adjoint DSMC method for the gradient calculation, we first solve the Boltzmann equation (13) as in the previous examples, but at each time step t = t k the indices of the particles that collided, their collision angles σ k,i and the pre-collision relative unit velocities (v k,i −ṽ k,i )ˆare stored in memory for the later use in the backward solve. Adjoint DSMC Afterwards, we solve the adjoint DSMC equations derived in Section 4 backward in time. Similar to the definition of the forward particles (15), at the k-th time interval, we represent the adjoint particles as Γ k = {γ 1 , . . . , γ i , . . . , γ N }(t k ), and we denote the i-th adjoint particle in Γ k as γ k,i . We remark that γ k,i is a vector in R 3 . We initialize our backward solve with the "final conditions" (30), γ F,i = −∂ v r(v F,i ), i ∈ 1 . . . N, at the final time t = T = 2, and r(v) is set to Adjoint DSMC ∂T 0 p Table 3: Gradients δJ 1 δα that are computed using the finite difference formula (51), estimates of the corresponding finite-difference errors based on (53) and Table 2 values, and the corresponding random errors that are computed based on (54) and Table 1 values. The objective functions J 1 = {T l (t = 2), m4 l (t = 2)} and parameter α = T 0 p , l, p ∈ {x, y, z}. The random errors are the same for all α = T 0 p , p ∈ {x, y, z}. All quantities here are computed using ∆α = 0.1. Adjoint DSMC ∂T 0 y ∂J 1 ∂T 0 Table 4: Gradients δJ 1 δα computed by the adjoint DSMC approach and estimations of the corresponding random errors based on formula (50), where the objective function J 1 = {T l (t = 2), m4 l (t = 2)} and the parameter α = T 0 p , l, p ∈ {x, y, z}. Adjoint DSMC be v 2 l or v 4 l , l ∈ {x, y, z}, as discussed previously, where l is fixed for a given simulation. Thus, γ j F,i = −2v l F,i δ l, j and γ j F,i = −4(v l F,i ) 3 δ l, j , respectively, where l, j ∈ {x, y, z} and δ l, j = 1 if l = j and 0 otherwise. The adjoint DSMC equations (33a)-(33b) are then solved backward in time for each collision that happened during the forward solve using the collision angles and the relative unit velocities that have been stored during the forward solve. Once the backward time evolution reaches the initial time t = 0, we use (29), Adjoint DSMC , to calculate the gradient of the objective function with respect to the model parameter α. Here, ∂ α v 0,i (α) is a derivative of the initial sample of particles with respect to the parameter α. Hence, it is important to have not only an initial distribution function f 0 (v, α) that depends continuously on the parameter α but also a particular way of sampling such that the samples depend continuously on the parameter α. Since our initial distribution is an isotropic Gaussian (49), we can sample it by sampling 3N values from the standard normal distribution N(0, 1) and then rescaling the values with appropriate initial temperatures as N(0, 1). For α = T 0 p , we can easily compute Adjoint DSMC We perform M s = 100 forward DSMC and backward adjoint DSMC simulations with N = 10 8 particles for each simulation. Based on (50), we compute the mean values and random errors for quantities ∂T l Table 4, where the values of the gradients match those in Table 3 up to 4-5 significant digits. The random errors in Table 4 are approximately 10 −5 for ∂T l ∂T 0 p (t = 2) and 10 −4 for ∂m4 l ∂T 0 Adjoint DSMC , which is about one order of magnitude smaller than the ones in Table 3. It demonstrates another advantage of this method that it does not suffer from amplified random errors compared to the finite difference calculations. For the latter, the random error increases while computing the gradients due to the subtraction of two close values in (51). Table 5: Gradients δJ 1 δα computed by the DSMC-type scheme for the adjoint equation and estimations of the corresponding random errors based on formula (50), where the objective function J 1 = {T l (t = 2), m4 l (t = 2)} and the parameter α = T 0 p , l, p ∈ {x, y, z}. DSMC-type scheme for the adjoint equation For the DSMC-type scheme, we need to store the same information during the forward modeling as the adjoint DSMC method. We solve the continuous adjoint equation (19a) backward in time using a DSMC-type scheme that we have developed in Section 3.2. In this method, we evolve values of the function γ(v, t) evaluated at locations v k,i , i.e., the DSMC particles from the forward solve. At the k-th time step, the set DSMC-type scheme for the adjoint equation contains all those function values, whereγ i (t k ) = γ(v k,i , t k ) is i-th adjoint "particle" in Γ k . We remark thatγ i (t k ) here is a scalar value,γ i (t k ) ∈ R. We initialize our backward solve with the "final conditions" (19b). That is, DSMC-type scheme for the adjoint equation are the velocity particles from the forward DSMC at the final time t = T = 2. Then the continuous adjoint equation (19a) can be solved backward in time following Algorithm 2, whereγ i (t k ) are updated at k + 1 → k time step according to (26) only if v k,i particles participated in a collision during the forward solve at the step k → k + 1. To approximate the last terms in (26), we perform a linear interpolation using the scattered data Γ k+1 at locations v k+1,i ; see (27). Eventually, once the backward time evolution reaches the initial time t = 0, the gradient of the objective function (20) can be computed using the values ofγ i (t = 0), i.e., Γ 0 . In case of the initial condition (49) and the parameter α = T 0 p , p ∈ {x, y, z}, the derivative ∂ α f 0 (v; α) of the initial distribution function with respect to the parameter α in (20) becomes DSMC-type scheme for the adjoint equation By approximating the initial distribution function with the sample particles f 0 (v) ≈ 1 DSMC-type scheme for the adjoint equation We performed M s = 10 forward DSMC simulations and backward simulations of the adjoint equation using the DSMC-type scheme with N = 10 6 particles for each simulation. We choose smaller N and M s here because this scheme works much slower due to the interpolation procedure at every time step for every colliding particle. We compute the mean values of the gradients according to (57), and estimate their random errors based on (50). The results are presented in Table 5. We observe that the gradients in Table 4 and Table 5 match up to 2-4 significant digits. The random errors in Table 5 Table 4 as a result of using N = 10 6 instead of N = 10 8 and the additional error introduced by numerical interpolation. Direct discretization of the adjoint equation integrals Here we solve the continuous equation (19a) for γ(v, t) from t = T = 2 to t = 0 with the "final condition" (19b) using a direct numerical integration scheme to compute the integral term on the right-hand side. See details of the numerical scheme in Appendix A. Direct discretization of the adjoint equation integrals As previously, we consider the gradients of the second-order moments, T l (t = 2), and the fourth-order moments, m4 l (t = 2), with respect to α = T 0 p , l, p ∈ {x, y, z}. For each objective function, we perform one forward DSMC simulation with N = 10 8 particles and one backward simulation via the scheme described in (A.2). We did only one Direct discretization of the adjoint equation integrals 0.573407 0.214738 0.214742 J 1 = T y (t = 2) 0.214944 0.572962 0.214757 J 1 = T z (t = 2) 0.211709 0.211531 0.569767 J 1 = m4 x (t = 2) 2.343578 1.027094 1.026818 J 1 = m4 y (t = 2) 1.099767 3.193492 1.165838 J 1 = m4 z (t = 2) 1.072768 1.137018 3.153235 Table 6: Gradients δJ 1 δα computed by the direct discretization of the integrals in the continuous adjoint equation (19a), where J 1 = {T l (t = 2), m4 l (t = 2)}, α = T 0 p , l, p ∈ {x, y, z}. Direct discretization of the adjoint equation integrals memory requirements, bytes error scaling operation count simulation (M s = 1) for each objective function due to its extensively long computational time; see the next subsection for discussions on performance. The results are gathered in Table 6. Values of the gradients in Table 6 and Table 4 match up to 2-3 significant digits. We still have random errors that are contributed through the values of f (v, t) in the forward DSMC. The random errors in Table 6 can be roughly estimated using two standard deviations in the last column of Table 1, or e rand Table 6 and Table 4. Direct discretization of the adjoint equation integrals We have also numerically verified Equation (45) using the values of γ(v, t k ) at grid points v = v i x ,i y ,i z obtained during the direct integration simulations and using the finite difference to compute the derivative γ (v, t k ). We approximate E[γ k,i |v = v k,i ] using the histogram count of γ k,i obtained via the adjoint DSMC method around the same grid points v = v i x ,i y ,i z . Method comparison So far, we have described and demonstrated four different ways to compute the gradient of an objective function numerically after the forward DSMC simulations. The summary of their comparison in terms of memory requirements, error scaling and operation count is given in Table 7. See the details of the comparison in Appendix B. Table 8 shows the timings of our code we recorded per objective function using Intel Core i7-3770K processor (4 cores @4.5Ghz) and N = 10 6 , 10 7 , 10 8 , T = 2, ∆t = 0.1, n grid = 30, 40, n ϕ = n θ = 10 parameters. Method comparison The adjoint DSMC is slightly faster (up to 20-30%) than the forward DSMC for the same number of particles N (timings for computing the vector σ and the unit collision direction are included in the forward DSMC timings above and take about 20% of the overall timings, whereas they would add about 35% to the adjoint DSMC timings if we were to include them there). The adjoint DSMC is more than 1000 times faster than the DSMC-like scheme and much faster than the direct discretization of (19a). At the same time, the errors in the adjoint DSMC are at least one order of magnitude smaller than in other methods due to absence of finite-difference or interpolation errors; see Tables Table 4 as it is the most accurate value we have computed. For (i) the errors were estimated using formulas (52)-(55) and the fact that e rand m4 x (t=2) ∝ 1/ √ N to demonstrate that the error scaling and the actual errors (in comparison to the reference value from Table 4) were 2 − 10 times smaller. Note that the slope of the forward DSMC+FD line (blue) is less than the slopes for the adjoint DSMC (red) and DSMC-type scheme for adjoint equation (purple) since the total error in (52) for the optimal ∆α * (as in (55)) scales like ∝ 1/N 1/3 and CPU time ∝ N. Optimization examples We have previously discussed the accuracy and performance of several different numerical schemes to compute the gradient of optimization problems constrained by the Boltzmann equation. The adjoint DSMC method particularly stands out for its simplicity, computational efficiency, and the direct connections with the well-established forward DSMC method [38], as discussed in Section 5.2. Here, we use two optimization examples to illustrate the great potential of the adjoint DSMC method for efficiently solving optimization problems constrained by the Boltzmann equation with the nonlinear collision operator. Matching the velocity moments We have been using the velocity moments of the probability distribution at the final time T as the objective function to test the accuracy of the gradients. Here, we follow the earlier discussions and set the first objective function as Matching the velocity moments where d 1 = [T x , T y , T z ], the second velocity moments in each direction and d 2 = 1 2 [m4 x , m4 y , m4 z ], half of the fourthorder velocity moments in each direction at t = T = 2. As we have defined earlier, for l ∈ {x, y, z}. Here, f (v, T ) solves the Boltzmann equation (13) given the initial condition (49). We only treat the initial temperature of the y direction, T 0 y , as the unknown parameter α, while fixing T 0 x = 0.5 and T 0 z = 1. This is to avoid the trivial optimal solution T 0 Matching the velocity moments . One may notice that the objective function (58) in this example does not match the formulation (18). Nevertheless, it is easy to adapt a general objective function to either the continuous or the DSMC adjoint system based on the role of the adjoint equations: large systems of chain rule which propagate the Fréchet derivative δJ 1 δ f (v,T ) backward in time to δJ 1 δ f (v,0) as f (v, 0) directly depends on the model parameter α. Hence, in this example, the final condition for the continuous adjoint equation (19a) should be Matching the velocity moments The final condition for the DSMC adjoint system, γ F,i = [γ x F,i , γ y F,i , γ z F,i ], also the adjoint variable for the final particle Matching the velocity moments Starting with T 0 y = 1 as the initial guess for α, we use a gradient-based optimization algorithm to minimize the objective function (58). The steepest descent method with a backtracking line search following the Armijo-Goldstein condition is applied to find a proper stepsize along the descent direction [39]. We compute the gradient by solving one forward DSMC with the current α, and then one adjoint DSMC is solved in every iteration of the optimization process. The total number of particles in both DSMC simulations is N = 10 7 . The spacing in the time domain is ∆t = 0.1. The convergence history of this example is shown in Fig. 6. Both the objective function and the size of the gradient monotonically decrease in the first 30 iterations. The convergence slows down as the gradient is smaller than 0.1% of its initial size. We start to observe oscillations in the gradient that come from the random errors in the DSMC solutions. The iterates converge to 0.4344, the global minimum of the objective function if T 0 y is the only parameter. Inverse Problem Our second example is based the setup of an inverse problem. The fourth-order velocity moments at the final time T = 2 are statistical quantities of interest that can be observed in a realistic or experimental setting. The observable information is solely affected by the unknown initial temperature of the distribution that we aim to recover by minimizing the difference between the observed data and the predicted data simulated by our guess of the model parameter. The reconstruction is formulated as a nonlinear least-squares problem α * = arg min α J 1 (α) = arg min α d obs − d pred (α) 2 2 where the predicted data d pred (α) = [m4 x , m4 y , m4 z ] is a vector of the fourth-order velocity moments at T = 2. We set the true data d obs = [2,1,3]. All other notations and the choice of optimization algorithm follow the previous optimization example. Inverse Problem The initial guess of the parameters is [0.5, 1.5, 1.0]. The convergence history of the computational inverse problem is shown in Fig. 7. The three components of α converge to [0.8670, 0.0870, 1.3470] in the first 40 iterations. The same as in the previous example, the small variations in the objective function and the gradient norm for the remaining 60 iterations are introduced by the random errors of DSMC simulations, as seen in the plots. Increasing the number of particles can help mitigate the small perturbations. Inverse Problem Remark 3. We show two simple optimization experiments as examples, but one can apply the framework to more general and large-scale optimization problems constrained by the nonlinear Boltzmann equation. There are at least three directions to generalize the applications. First, the dimensionality of the unknown parameter could be increased with hardly any extra cost. Second, the model parameter is not limited to the initial condition. Such examples include shape optimization of the flow channel [42]. Third, following the same idea, we plan to generalize the adjoint DSMC systems for inhomogeneous Boltzmann equation with the nonlinear collision operator or even more complicated kinetic description. Conclusion In this paper, we present the OTD and DTO approaches of computing the gradient of optimization problems based on the nonlinear Boltzmann equation. The highlight of both frameworks is that one only needs to solve the Boltzmann equation and the adjoint system once to compute the gradient, independent of the size of the unknown in the optimization. The adjoint DSMC system, derived by the DTO approach, offers a deterministic numerical scheme that is remarkably efficient to implement with the forward DSMC method. On the other hand, the Monte Carlo type method designed for the continuous adjoint equation could potentially be used for the linear Boltzmann equation [11]. We plan to extend both frameworks to the general VHS kernel and to the inhomogeneous case. In particular, the adjoint DSMC approach applies to more general kinetic models for gases and plasmas whose behavior could be modeled by Monte Carlo binary collisions. One of such models is the Coulomb collision for charged particles [47]. As the next step, we will apply the adjoint DSMC methods to realistic optimization problems that occur naturally in a broader class of kinetic applications. several simulations with slightly different values of the parameter α. Since these simulations can be done sequentially, it does not increase the overall memory requirements. Conclusion (ii) The adjoint DSMC method requires 3N × 8 = 24N bytes for the storage of γ k,i in addition to the memory requirements from the forward DSMC propagation. During the forward DSMC simulation, we also need to store the following information about the collisions that happen at each time step. For each colliding pair, we store Conclusion • the indices of the two colliding particles, 4 bytes each if stored in the UInt32 format allowing for values in [0, 2 32 − 1]; since 2 32 ≈ 4.3 × 10 9 > 10 8 , it is good enough for our purposes; Conclusion • the σ vector in R 3 , 8 bytes for each component of the vector; Conclusion • the unit collision direction v−v 1 |v−v 1 | ∈ R 3 , 8 bytes for each component. In total, the memory requirements are 56 bytes per colliding pair or 28 bytes per colliding particle. Overall, we need 28N c new bytes stored per time step. If the number of time steps is M = T/∆t, the total amount of extra storage needed for the backward propagation is 28N c M = 28Nµ∆tT/∆t = 28NµT . It becomes comparable to the 24N bytes needed for the particle storage in the forward DSMC when 28NµT > 24N, or when roughly µT > 1. The total amount of extra memory required for the backward propagation is 24N + 28NµT bytes. In our simulations, we use µ = 1, T = 2, so the total amount of memory required for the adjoint DSMC was about four times the amount of memory required for the forward DSMC. Conclusion (iii) The DSMC-type scheme for the continuous adjoint equation (19a) requires 1N × 8 = 8N extra bytes for the storage of γ(v k,i , t k ). Like the forward DSMC, we do not consider temporary storage needed for the colliding particles at each time step since they constitute only a small fraction of the overall number of particles and the new data for γ(v i , t k ) overrides the old one. We also do not store v k,i at every time step during the forward solve since we can always recover the velocity particles when marching back from t = T to t = 0 based on equation (6) with the stored collision parameters σ. In this method, we also need to store all of the same information about colliding particles in the forward DSMC simulation as in the adjoint DSMC method, adding extra 28NµT bytes needed for storage total of 8N + 28NµT bytes. Conclusion (iv) For the direct discretization of the integrals in the adjoint equation (19a), we perform the forward simulation with the standard DSMC method. Afterwards, we need to convert velocity samples {v k,i } N i=1 to a distribution function f (v, t k ) via a histogram at every time step t k during the forward propagation. With n grid being the number of the grid points in each direction of the v-space, we have in total n 3 grid grid points, which requires 8n 3 grid M bytes of memory to store the distribution function f (v, t) at every time step. In our simulations, n grid = 40 considering the high computational complexity. With n 3 grid = 64000 ≈ N/1000 for N = 10 8 , we use ≈ 1000 particles per ∆v 3 box on average. During the backward solve, we need to store n 3 grid values of the function γ(v, t). For the right-hand side of (A.2), we can subtract one term of the right-hand side at a time to save memory. Therefore, in total, we need 8n 3 grid (M + 2) bytes of v . The total number of operations needed to compute γ(v, t k ) from γ(v, t k+1 ) in (A.2) per grid point in the vspace is about (21n ϕ n θ + 4)n 3 grid . Since there are n 3 grid grid points in the v-space grid and M time steps, the total operation count per simulation is about (21n ϕ n θ + 4)n 6 grid M. Assuming n 3 grid = N/1000 and n ϕ = n θ = 10, we get (21n ϕ n θ + 4)n 6 grid M = 0.0021N 2 M. There are drastically more operations in the direct discretization than the adjoint DSMC algorithm as a result of the O(N 2 ) scaling where typically N ≥ 10 6 .

섹션 본문 201문단 · 66,423자

(제목 없음)

1Applications for kinetic equations such as optimal design and inverse problems often involve finding unknown parameters through gradient-based optimization algorithms. Based on the adjoint-state method, we derive two different frameworks for approximating the gradient of an objective functional constrained by the nonlinear Boltzmann equation. While the forward problem can be solved by the DSMC method, it is difficult to efficiently solve the high-dimensional continuous adjoint equation obtained by the "optimize-then-discretize" approach. This challenge motivates us to propose an adjoint DSMC method following the "discretize-then-optimize" approach for Boltzmannconstrained optimization. We also analyze the properties of the two frameworks and their connections. Several numerical examples are presented to demonstrate their accuracy and efficiency. (Denis Silantyev), yunan.yang@nyu.edu (Yunan Yang) arXiv:2009.01363v3 [math.NA] 10 May 2021Derivation of the continuous adjoint equationFollowing the adjoint-state method, we aim to derive the adjoint equations for our optimization problem starting with the Lagrangianin which κ(v) in J 2 is a Lagrange multiplier that enforces the initial condition for any v ∈ R 3 , and γ(v, t) in J 3 is a Lagrange multiplier that enforces the Boltzmann equation for any v and t.We remark that f (v, t) is any function here, and its dependence on the Boltzmann equation and the initial condition is imposed through Lagrange multipliers.We rewrite J 3 to calculate its Fréchet derivative with respect to f .After integrating by parts, we haveand for 0 < t < T the Fréchet derivatives are0.572335 ± 0.0001 0.213839 ± 2.1e-06 0.213836 ± 8.6e-07 ± 0.0002 J 1 = T y (t = 2) 0.213831 ± 0.0003 0.572331 ± 2.1e-06 0.213842 ± 3.1e-07 ± 0.0002 J 1 = T z (t = 2) 0.213834 ± 0.0002 0.213830 ± 2.8e-08 0.572322 ± 5.6e-07 ± 0.0002 J 1 = m4 x (t = 2) 2.289942 ± 0.0011 0.996551 ± 7.5e-06 0.996538 ± 6.0e-06 ± 0.0009 J 1 = m4 y (t = 2) 1.071492 ± 0.0025 3.147580 ± 7.5e-06 1.139506 ± 5.5e-06 ± 0.0011 J 1 = m4 z (t = 2) 1.071524 ± 0.0006 1.139418 ± 1.1e-06 3.147446 ± 5.7e-07 ± 0.0014 J 1 = T x (t = 2) 0.572316 ± 1.1e-05 0.213836 ± 8.4e-06 0.213835 ± 7.7e-06 J 1 = T y (t = 2) 0.213846 ± 9.5e-06 0.572337 ± 1.1e-05 0.213839 ± 9.5e-06 J 1 = T z (t = 2) 0.213838 ± 8.9e-06 0.213828 ± 7.5e-06 0.572325 ± 1.2e-05 J 1 = m4 x (t = 2) 2.289879 ± 1.3e-04 0.996589 ± 8.6e-05 0.996541 ± 8.3e-05 J 1 = m4 y (t = 2) 1.071577 ± 9.1e-05 3.147648 ± 1.8e-04 1.139492 ± 9.0e-05 J 1 = m4 z (t = 2) 1.071486 ± 8.0e-05 1.139424 ± 8.0e-05 3.147454 ± 1.7e-04 ± e rand ∂J 1∂T 0 z J 1 = T x (t = 2) 0.572229 ± 3.6e-03 0.213398 ± 8.9e-04 0.213809 ± 1.1e-03 J 1 = T y (t = 2) 0.211871 ± 4.3e-03 0.573324 ± 2.6e-03 0.213879 ± 1.7e-03 J 1 = T z (t = 2) 0.216833 ± 3.2e-03 0.211929 ± 1.3e-03 0.572561 ± 2.3e-03 J 1 = m4 x (t = 2) 2.285860 ± 1.9e-02 0.992066 ± 8.6e-03 0.992431 ± 9.4e-03 J 1 = m4 y (t = 2) 1.066416 ± 2.7e-02 3.147584 ± 1.7e-02 1.133434 ± 1.4e-02 J 1 = m4 z (t = 2) 1.

Introduction

2The development of modern technology requires accuracy in modeling physical processes. One critical task is to model the kinetic behavior of rarefied gas, which is required for low-pressure gas flow and cannot be accurately described by the Navier-Stokes equations. The Boltzmann equation models the dynamics of a many-particle system through a velocity distribution function, with a nonlinear collision operator that describes binary particle interactions. The Boltzmann equation is a powerful tool from the kinetic theory describing molecular gas dynamics, radiative transfer, plasma physics, and grain and polymer flow [4].

3The Boltzmann equation can also be used for design, optimization, control, and inverse problems. A few of the many examples include the design of the semiconductor device, the topology optimization of the gas flow channel, and risk management in quantitative finance [22,23,21,42,31]. One may use a kinetic perspective to tackle optimal control problems for a large system of interacting agents. Common kinetic models involve the Boltzmann model and some mean-field models [44,17,3,24,25,2]. Many of these applications involve finding unknown or optimal parameters in Boltzmann-type equations such that an objective function formed by the computational or experimental data is optimized, i.e., optimization problems with PDE constraints. However, due to the challenges caused by the complex nonlinear collision term, the linear Boltzmann equation [22] or simplified collision operators such as the Bhatnagar-Gross-Krook (BGK) model [8,42], the Ellipsoidal Statistical model [30], or the Shakhov model [43] have been used as alternatives. Although these simplified models provide good approximations for many scenarios, the original nonlinear collision operator is still preferred for better accuracy [19].

4The main contribution of this work involves the derivation of two optimization frameworks based on the spatially homogeneous Boltzmann equation with the nonlinear collision operator and the design of an efficient adjoint DSMC method for the gradient calculation. In this paper, we focus on the collision kernel for Maxwell molecules, but we expect our method to be generalized to other collision kernels. The frameworks should be broadly applicable to optimal control, optimal design, and general computational inverse problems. We employ two different approaches to derive numerical algorithms: optimize-then-discretize (OTD) and discretize-then-optimize (DTO) [29]. Fig. 1 summarizes the Boltzmannconstrained optimization problem (18) the continuous optimality condition (20) and the adjoint equation (19a) a Lagrangian (28) based on the DSMC method for the state equation (13) solve state and adjoint equations (13) & (19a) numerically and compute (20) the discrete optimality (29) and the adjoint DSMC equation (34) the gradient of (18) optimize OTD discretize approximate discretize DTO optimize approximate Figure 1: A diagram summarizing the OTD approach (solid line) and the DTO approach (dash line) to compute the gradient with respect to the unknown parameter for the optimization problem (18) constrained by the Boltzmann equation (13).

5these two approaches. In the OTD approach, we obtain a continuous adjoint equation as an optimality condition, which we discretize by a grid-based method or a Monte Carlo type method. In the DTO approach, we discretize the Boltzmann equation and the objective function using the direct simulation Monte Carlo method (DSMC) [10,38,15], from which a discrete optimality condition and the adjoint DSMC system are derived. The adjoint DSMC from the DTO approach is radically more cost-effective than the continuous adjoint equation in the OTD approach. To our knowledge, this is the first efficient numerical scheme to compute the gradient for nonlinear Boltzmann equation constrained optimization. In addition to the derivations, we also analyze the properties of the two adjoint systems and investigate connections between them. The analysis provides a better understanding of the adjoint-state method for constrained optimization problems. The paper is arranged as follows. In Section 2, we briefly review the homogeneous Boltzmann equation with a nonlinear collision operator, the linearization of the collision operator, and the classical DSMC algorithm for the numerical solution. We derive the continuous adjoint equation for the continuous Boltzmann equation in Section 3 following the Lagrangian method. A particle method is then proposed to solve the continuous adjoint equation numerically. In Section 4, we regard the DSMC discretization of the Boltzmann equation as the forward problem and the particle velocities as the state variables. We then obtain equations for the adjoint particles following the adjointstate method. Since one can compute the gradient of the optimization problem by both the continuous and the discrete adjoint systems, we analyze their properties and prove the critical connections between the two adjoint systems in Section 5. Finally, we show several numerical examples in Section 6 to demonstrate the accuracy of the gradient formulae obtained by both the continuous and the DSMC adjoint systems. Detailed comparison in terms of memory, accuracy, and computational cost of different numerical schemes are presented. Conclusion and future research directions follow in Section 7. Two appendices provide additional details on the numerical methods and numerical analysis of the results.

Boltzmann equation and the direct simulation Monte Carlo (DSMC) method

6In this section, we first give a short introduction to the Boltzmann equation and some of its relevant properties. The later part of the section is devoted to the description of the classical DSMC method.

Boltzmann equation

7We consider the Boltzmann equation

8with the initial condition

9where f (x, v, t) is a nonnegative probability density function that describes the time evolution of the distribution of particles which move with velocity v ∈ R 3 at the position x ∈ R 3 at time t > 0. The bilinear (nonlinear) collision operator Q( f, f ) that describes the binary collisions among particles is defined as follows:

10in which (v , v 1 ) represent the post-collisional velocities associated with the pre-collisional velocities (v, v 1 ) and the σ integral is over the surface of unit sphere S 2 . By conserving the momentum v + v 1 and the energy v 2 + v 2 1 , we have

11where σ is a collision parameter representing a unit direction of the relative velocity of particles after collision (2). We will hereafter use the shorthand notation f, f 1 , f , f 1 to denote f (v), f (v 1 ), f (v ) and f (v 1 ). The collision operator Q has the following symmetries, which are related to the conservation of mass, momentum and energy: The transformations

12with v and v 1 defined by (2) are isometries for (σ, v, v 1 ) ∈ S 2 × R 3 × R 3 [18,46]. We define the unit vector along the

13whereq is related to q by a change of variable [46]. It follows that for any measurable function

14These symmetries are used repeatedly through the paper. The kernel q is a nonnegative function that characterizes the details of the binary interactions. For the Variable Hard Sphere (VHS) model, the collision kernel is

15In particular, when β = 0, the collision kernel corresponds to the Maxwellian gas, which (along with C β being constant) is the model that we focus on in this paper. For the Coulomb interaction, the collision kernel is given by the Rutherford formula

Operator formulation for collisions

16In this section, we rewrite the collision rules (2), in an operator formulation that clarifies some properties that will be useful for the analysis in later sections. First we denote α = (v − v 1 )ˆand σ = (v − v 1 )ˆusing the notation xˆ= x/|x|, in which the equation for σ and the relation |v − v 1 | = |v − v 1 | follow from (2). As described in [46, P.53], the change of variables

17is an involution with unit Jacobian.

18We can rewrite (2), in terms of operators, as

19where A(σ, α) = 1 2

20where I is the identity matrix in R 3 and B = A T = A −1 . Now consider small perturbations δv and δv 1 in the pre-collision velocities v and v 1 . Since the collision parameter vector σ is chosen independently of v and v 1 for a Maxwellian gas, there is no need to perturb σ; i.e., δσ = 0. Also

21The resulting first-order variations δv and δv 1 in the post-collision velocities are δv

The linearized collision operator

22The linearized collision operator is defined through perturbation theory [18], most frequently by linearization around a Maxwellian equilibrium. In this subsection, we define the linearized operator, due to multiplicative perturbation [5,14] around a non-equilibrium distribution and its adjoint operator under a weighted L 2 inner product.

23For a general velocity distribution f , consider the multiplicative perturbationf = f (1 + ψ). Since the collision operator Q(f,f ) defined in (1) is bilinear,

24in which ≈ means that quadratic terms in ψ are neglected. We define the linearized operator L[ f ] based on f and applied to ψ as

25In an original paper of Maxwell in 1866 [35], the Boltzmann equation was written in the weak formulation [46]. Following this approach for a test function γ(v, t) and using the symmetries (3), one gets the identitŷ

26where γ 1 , γ and γ 1 are shorthand notations for γ(v 1 , t), γ(v , t) and γ(v 1 , t). We will use (10) to find the adjoint of L[ f ].

27We replace f by f (1 + ψ) in (10) and calculate the first-order terms with respect to ψ. As in the derivation of (9), the first-order terms in the left-hand side of (10) are derived aŝ

28Similarly, the first-order terms in the right-hand side of (10) are derived as

29Combining both sides, we obtain the first-order variation equation

30which is equivalent to the following

31and (h 1 , h 2 ) L 2 (µ) =´h 1 h 2 f dv is the inner product for the weighted Hilbert space L 2 (µ) in which f dv = dµ. This shows that operator

32In the special case that f = M is a Maxwellian equilibrium distribution, using the symmetries (3) and the equilibrium property MM 1 = M M 1 ,

33Comparison of (12) and (11) shows that L * [M] = L[M]; i.e., that L[M] is self adjoint. The linearized collision operator around a Maxwellian has been extensively studied in the literature [18,46,11].

The direct simulation Monte Carlo (DSMC) method

34In this section, we describe the classical DSMC method [10] for the spatially homogeneous Boltzmann equation following the presentation of [40]:

35As stated above, our focus is also on a Maxwellian gas for which the collision kernel does not depend on the relative velocity |v − v 1 |, i.e., q(v − v 1 , σ) = q(σ), but the algorithm below can be modified to apply to a general set of collision kernels [10,40]. Under this assumption, (13) can be rewritten in the form of

36where ρ =´R 3 f dv, µ = ρ´S 2 q(σ)dσ, and

37We remark that f ρ = 1 ρ f is a probability density in the velocity space for any given t. It also follows the Boltzmann equation (13) with a scaled collision kernel. Without loss of generality, we regard f = f ρ as a probability density function hereafter.

38In the DSMC method, we consider a set of N velocities evolving in time due to collisions whose distribution can be described by the probability distribution function f in (13). We divide time interval [0, T ] into M number of sub-intervals of size ∆t. At the k-th time interval, the particle velocities are represented as

39and we denote the i-th velocity particle in V k as v i (t k ) or v k,i . The forward Euler scheme applied to (14) gives

40where f k = f (v, k∆t). If additionally we discretize the velocity distribution at time t k = k∆t by the velocity particles V k defined in (15), which is to say

41we can interpret (16) in terms of probability, which is the core idea of the method. At time t k , a particle with velocity v k,i will not collide with probability (1 − µ∆t), and it will collide with another velocity particle with probability µ∆t, according to the collision law described by P( f k , f k )(v). Nanbu proposed an algorithm based on this probabilistic interpretation [38], and later its convergence was proved by Babovsky and Illner [6]. One can view Algorithm 1 as the realization of DSMC with the forward Euler scheme (16). (14) is convenient to illustrate the core idea of DSMC but does not apply to all collision models. The acceptance-rejection method using "virtual collisions" is required to sample from a more general cross section [15]. Given the velocity of particles from the previous time step, V k−1 .

4:

42Select N c /2 collision pairs (i, j) uniformly among all possible pairs without replacement. 5: For those selected pairs, perform the collision between v k,i and v k, j based on (2); obtain the post-collision velocity v k,i and v k, j . 6: Set v k+1,i = v k,i and v k+1, j = v k, j . 7: Set v k+1,i = v k,i for all particles that have not collided. 8: end for

Continuous adjoint Boltzmann equations

43We consider an idealized optimization problem for the spatially homogeneous Boltzmann equation (13). The initial condition is

44in which f 0 is the prescribed initial data depending on a parameter α. We aim to find α which optimizes the objective function at time t = T ,

45When the number of unknowns is large, which is the dimensionality of α in our case, the adjoint-state method is necessary as an efficient numerical method for computing the gradient of a function or operator in a numerical optimization problem [9,16]. It has applications in geophysics [20], seismic imaging [41] and general inverse problems [36]. It is also the theoretical foundation that gave rise to the back-propagation method in the 1990s for neural networks and machine learning [32]. One outstanding advantage of the adjoint-state method is that the number of PDE solves is independent of the dimension of the parameter for which the gradient needs to be calculated.

46The calculation of δJ 32 δ f follows the derivation of collisional invariants for the Boltzmann equation [19]. It follows, using the symmetries (3), that

47where γ, γ 1 , γ and γ 1 are shorthand notations for γ(v, t), γ(v 1 , t), γ(v , t) and γ(v 1 , t). Now we perturb f by an amount δ f and investigate the resulting change in J 32 . We obtain the first-order variation:

48Thus, the Fréchet derivative of J 32 with respect to f is

49where the second equality follows (11). Together with all the other functional derivatives, we obtain the following equations:

50Based on the first-order necessary condition for optimality, we set these variations to zero to obtain the adjoint equation for the adjoint variable γ:

51The adjoint equation evolves backward in time from T to 0, thus the final condition (19b) is given instead of the initial condition. After time evolution, we can use γ(v, 0) to eliminate κ(v) and obtain the gradient of the objective function with respect to parameter α:

52The continuous adjoint equation (19a) is an integro-differential equation which shares significant similarities with the linearized Boltzmann Equation [18]. We will further analyze and discuss the adjoint system in Section 5.

53Given an initial guess α 0 for the model parameter, the first step is to solve the forward equations (13) numerically with initial condition (17) for f . A common choice is the DSMC method because of the nonlinear collision operator. The second step is to solve the adjoint equation (19a) numerically with the final condition (19b) for the adjoint variable γ. One can solve the adjoint equation using a finite difference method in t and grid-based quadrature in v, but this is computationally difficult because v is three dimensional, and the integral at each value of v is five-dimensional. In Section 3.2, we propose Algorithm 2 as an efficient Monte Carlo type method for solving (19a). In the third step, we compute the gradient ∂ α J based on (20) using the numerical solutions from the first two steps. Numerical examples and comparisons are presented in Section 6. One can then update α iteratively using a gradient-based optimization algorithm to find the optimal parameter. This is the "optimize-then-discretize" (OTD) approach to solve the PDEconstrained optimization numerically.

54We remark that the entire derivation above is unrelated to the dimensionality of the model parameter α. In practice, α can be, for example, a function of the velocity domain. Hence, an accurate numerical discretization of the parameter can contain thousands of variables. It is then infeasible to obtain the gradient by numerical differentiation. On the other hand, using the adjoint-state method, the cost of evaluating the gradient once is equivalent to only one forward solve of the Boltzmann equation (13) and one (backward) solve of the adjoint equation (19a), independent of the number of variables in α. The adjoint-state method is an extremely efficient tool for large-scale optimization problems.

A particle method for the continuous adjoint Boltzmann equation

55The adjoint DSMC method presented in Section 4 is the main result of this work and the most efficient and accurate that we have found for solving the adjoint problem. Nevertheless, the particle method described in this section may be of independent interest. It is based on a formal derivation with several steps that are not fully justified, but are validated by the numerical results in Section 6.

56The continuous adjoint equation (19a) is based on the solution to the forward equation f (v, t), t ∈ [0, T ]. Therefore, we assume that the state (forward) equation (13) has been solved numerically by the DSMC method, where the choice of collision times, collision partners, and collision angles during the simulation are all stored in memory. Based on the solution from the forward DSMC simulation, we will (approximately) solve the equation (19a) for γ(v, t) backward in time t with the "final data" (19b).

57According to (13) and (19a), we have

58We then multiply both sides by a time-independent test function ψ(v) and integrate over the velocity domain. The left-hand side becomesˆR

59Using the symmetries (3), the right-hand side becomes

60Combining both (21) and (22), we discretize the time domain of the equation using the Euler scheme in t. Consider a time interval [t k , t k+1 ] during which there is a collision of v and v 1 at t = t k to produce v and v 1 at t = t k+1 .

61As in the (forward) DSMC Algorithm 1, (22) should be evaluated at t k since v and v 1 are independent before the collision so that the product f f 1 is the joint density function for v and v 1 .

62On the other hand, the choice of time t at which to evaluate γ(v, t) is a new issue and not so clearcut. We choose to evaluate γ(v, t) at t k+1 based on the following considerations: First, the data for the adjoint variable comes at the final time (19b), so that (19a) should be solved backward in time, and it is most natural for the right-hand side (22) to be evaluated at the final time t k+1 of the time interval. Second, since γ is solved backward in time, we expect that γ(v, t k+1 ) is independent of f (v, t k ), so that it is reasonable to sample using these values. Third, our numerical computations in Section 6 verifies that this choice leads to a correct result.

63Based on these choices, we take

64Without loss of generality, we assume ρ =´f dv = 1 and µ = ρ´q

65We apply Monte Carlo quadrature to approximate the integrals on both sides of (23), using the velocities from V k and V k+1 (defined as in (15)) and values of σ that were selected in the forward DSMC calculation. Similar to (15), we represent the adjoint variables as

66Both sides of the resulting Monte Carlo sums for (23) are nonzero only for velocities that undergo collisions. For the Monte Carlo quadrature we have N c /2 = µ∆tN /2 collision pairs.

67The j-th collision between velocities

68On the left-hand side of (23), the term γ k+1 is represented byγ ,γ 1 in Γ k+1 and the term γ k is represented bŷ

69On the right-hand side of (23), the terms γ k+1 , γ k+1,1 are represented byγ ,γ 1 ∈ Γ k+1 , but the terms γ k+1 , γ k+1,1 are at t = t k+1 and correspond to velocities v, v 1 V k+1 , so that the correspondingγ values are not in Γ k+1 . We will instead use the values of the continuous function γ(v, t k+1 ) and γ(v 1 , t k+1 ).

70The resulting quadrature approximation for (23) by Monte Carlo sampling is

71The values of the continuous adjoint function in (24) can be expressed in terms of a conditional expectation:

72Since ψ is an arbitrary test function, and (24) holds for any ψ, we can match the coefficients and obtain a Monte Carlo type numerical scheme for solving γ(v, t). If velocity particle v j did not collide at time t k ,

73If v j and v j 1 are a collision pair at time t k ,

74(26b)

75Following [34,45], one may approximate the expectation E[γ i (t k+1 )|v i = v j ] by numerical interpolation as the following:γ

76for appropriately chosen interpolation coefficients ω(v). Given the final condition (19b), the continuous adjoint equation (19a) can be solved numerically following Algorithm 2.

77Algorithm 2 Algorithm for solving the continuous adjoint equation (19) 1: Given the final-time velocity particles V M in the forward DSMC and the final condition (19b), setγ

78Given Γ k+1 from the previous iteration and V k from the forward DSMC. 4: if v j ∈ V k did not collide at t k then 5: (27). 8: Setγ j (t k ) andγ j 1 (t k ) following (26). 9: end if 10:

Adjoint DSMC for Boltzmann equation

79In this section, we derive the adjoint system based on the DTO approach. We first rewrite the objective functions and the constraints based on the DSMC method, to which the Lagrange multiplier method will be applied.

80Following Algorithm 1, we discretize the time [0, T ] into M equal intervals [t k , t k+1 ] and denote v k,i to be the velocity of the i-th particle at time t k , for 1 ≤ i ≤ N and 0 ≤ k ≤ M. We also denote v I,i to be the velocity of the i-th particle at the initial time t = 0, and v F,i to be the velocity of the i-th particle at the final time t = T . The DSMC method applied to the spatially homogeneous Boltzmann equation consists of a sequence of particle collisions in sequential order, and the time step ∆t plays no role. So we will choose ∆t in whatever way is most convenient for the exposition. In this section, ∆t will be chosen small enough that there is at most a single collision in each time step.

81Consider the new objective function J defined as

82Here, J 1 is the Monte Carlo quadrature of the objective function (18) by particle velocities {v F,i } N i=1 , J 2 is the constraint on the DSMC initial condition v = v 0 (α) using the Lagrange multiplier {γ I,i } N i=1 , and J 3 is the constraint that enforces the binary collision law (2) using the Lagrange multiplier γ k,i for each particle i at the k-th time interval. In particular, v k,i represents the post-collision velocity of particle i if it participates in the collision at the k-th time interval. Otherwise, v k,i = v k,i , which means the particle velocity remains the same at the (k + 1)-th time interval. Again, we regard that {v k,i } is a general set of velocities, and its dependence on the collision rules (2) is imposed through the Lagrange multipliers. The following variation is easily calculated:

83We proceed to derive the equations in the backward time direction from the final time t = T to the initial time t = 0. First, we consider the equations that come from the derivative of J with respect to v F,i , which are derived in Section 4.1. Second, we consider collisions that occur at a time t where 0 < t < T . The derivatives of J with respect to the velocities in these collisions are derived in Section 4.2.

Velocities at the final time for DSMC

84We denote a particular particle velocity at the final time as w F = v F,i for some i, and the corresponding value of its dual variable is γ F = γ F,i , as shown in Fig. 2(a). The velocity w F occurs in the objective function J at two places. First, it directly appears in the term r(v F,i ) in J 1 . Second, it occurs in the last collision that involves v F,i , through the term γ F,i · (v F,i − v k,i ) in J 3 . In this term, v k,i is a velocity produced by the collision, and is a function of the two velocities before the collision, but v k,i does not depend on v F,i here. Therefore,

85The resulting equation comes from the first-order optimality ∂ w F J = 0:

86Equation (30) provides the starting values for solving the adjoint variable γ backward in time.

Collisions away from the final time for DSMC

87According to the DSMC method, with V k denoting the set of velocities in the k-th time interval as in (15), the collision operator C takes V k to V k+1 = C[V k ] as follows: We first choose indices i and j, and denote the corresponding velocities as (w k ,w k ) = (v k,i , v k, j ) from V k and also choose a unit vector σ k . Here, we assume the i-th and the j-th particles collide at the k-th time interval. Then C takes (w k ,w k ) to

88On the other hand, we denote w k−1 andw k−1 to be the particle velocities whose collision produces w k . Similarly, w k is produced by particle velocities w k−1 and w k−1 . Particle velocities

89correspond to the dual (adjoint) variables

90respectively, as shown in Fig. 3, which schematically depicts the three collisions that involve particles w k andw k .

91Next, we recall the variational quantity J 3 for collisions, with dual quantities γ, as

92We use J 3k to denote the terms in J 3 that involve w k orw k :

93Note that w k−1 is a function only of w k−1 andw k−1 , and that w k−1 is a function only of w k−1 and w k−1 . Consequently, w k−1 and w k−1 , as well as w k+1 andw k+1 , do not depend on w k andw k . It follows that

94These derivatives can be calculated from (31) to get

95where xˆ= x/|x| denotes the unit vector along the direction of x. Therefore,

96Setting these two partial derivatives to 0, gives the equations

97Moreover, (33) can be rewritten using the operator notation (7) from Section 2.2 as

98in which α k = (w k −w k )ˆ. Note that (33) for γ k andγ k does not involve any variables at time interval k − 1. It follows that (33) is valid for values of γ I = γ k andγ k corresponding to a collision in which one (or both) of the velocities w I = w k started at t = 0, as depicted in Fig. 2(b).

99The adjoint DSMC equations (33a)-(33b), which we derive following the DTO approach, are the DSMC analog of the dual equation (19a), and they are one of the main results of this paper. The evolution equations for the dual variable γ are solved backward in time, from (k + 1)-th time interval to the k-th time interval, for each k. For each collision, these equations are solved for the dual variables corresponding to the particle velocity variables involved in that collision.

Summary for discrete adjoint system

100In summary, we solve the direct equations in DSMC forward in time for the velocity particles V = {v 1 , . . . , v N } with the initial particle velocity sampled from (17) given the current value of α. Collisions are performed according to (2). Then the adjoint equations (33a)-(33b) for the adjoint particle γ are solved backward in time following Algorithm 3. At the initial time t = 0, we use (29) to calculate the gradient of the objective function with respect to the model parameter α, which can be used by optimization algorithms to update the α iteratively.

101Algorithm 3 Algorithm for solving the discrete adjoint DSMC system (33). 1

: Given the final-time velocity particles

102Given {γ k+1,1 , . . . , γ k+1,N } from the previous iteration and collision parameters in the forward DSMC. 4: if v j ∈ V k did not collide at t k then 5: Set γ k, j = γ k+1, j . 6: else if v j , v j 1 ∈ V k collided at t k then 7:

103Perform backward collision between γ k+1, j and γ k+1, j 1 and obtain γ k, j and γ k, j 1 following (33a) and (33b). Obtain {γ k,1 , γ k,2 , . . . , γ k,N }. 10: end for Like the continuous adjoint system (Section 3), by solving the direct equations and the adjoint equations only once, we obtain all components of the gradient ∂ α J, for any value of the dimensionality of α. We remark that the choice of collision times, collision partners, and collision angles is not included in the variational principle. These parts of the DSMC method are determined externally.

104The restriction to Maxwell molecules significantly simplifies the adjoint DSMC method presented in this section. Since the collision kernel q is a constant, the collision rate for a pair of velocities v and v 1 and the choice of the collision parameter σ do not depend on the values of the velocities. This implies that variations δv and δv 1 in the velocities do not cause variations in the choice of collision pairs nor in the collision parameter, which simplifies the adjoint DSMC equation (33). This is the main reason that we restricted our attention to Maxwell molecules in this work. We believe it is possible to extend the adjoint DSMC method to non-Maxwell interactions. Extension to collision kernels q = q(θ) with angular dependence should be straightforward since, in that case, the only thing that changes is the sampling of the collision parameter σ, while it is still independent of pre-collision velocities v and v 1 . Extensions to the VHS model with q = q(|v − v 1 |) collision kernel and other non-Maxwell interactions are more intricate since either the collision rates or the collision parameter σ will depend on pre-collision velocities. The former could be mitigated by using a different DSMC method with a constant collision rate such as [12], while the latter would produce additional terms in ∂ w k w k , ∂w k w k , ∂ w kw k , ∂w kw k in (32). We leave such generalizations for future work and they are beyond the scope of this paper.

Relationship between the continuous adjoint and the adjoint DSMC formulation

105In this section, we discuss the similarities and differences between the continuous adjoint formulation (Section 3) and the adjoint DSMC formulation (Section 4). The former is derived under the "optimize-then-discretize" (OTD) approach, while the latter is based on the "discretize-then-optimize" (DTO) approach. For a given discretization scheme, OTD and DTO may not be equivalent, as demonstrated by many examples in the literature [28,13,1,29,33]. The DTO approach is particularly preferred for problems that are otherwise unsolvable under the OTD approach, such as the heat-transfer optimization problem [7,26].

106Since DTO and OTD are generally not the same, we investigate the analytical properties of the two adjoint systems. The analysis in Section 5.1 illustrates the essential role of the continuous adjoint variable γ(v, t), as a Fréchet derivative of the objective function. We find a similar result for the discrete adjoint variable γ k,i for DSMC in Section 5.2. Based on these results, we find a direct relationship between γ(v, t) and γ k,i in Section 5.3 that connects the two adjoint systems.

107We remark that the derivatives in this section have slightly different meanings from the ones used before. In Section 3 and Section 4, the constraints for the state variables are not directly applied, but instead are imposed by the adjoint variables in the Lagrangian formulation. Here in Section 5, the derivatives with respect to f (v) or v k are computed with the assumption that they are directly constrained to satisfy the Boltzmann equation (13) or the DSMC equations, respectively.

Continuous adjoint variable as a Fréchet derivative

108If f (v, t) is a solution of the Boltzmann equation (13), then the linearized equation for a perturbed distribution

109using the linearized collision operator (9). For objective function J 1 (α) =´v r(v) f (v, T )dv, the perturbation δ f causes a perturbation δJ 1 , which satisfies

110for any t because the perturbation δ f (t, ·) determines δ f (t , ·) for any t > t. Since J 1 is time-independent, ∀t ∈ [0, T ], we have

111Here, we have used the chain rule, the duality between L[ f ] and L * [ f ], and (35).

112Since the perturbation δ f is arbitrary, the following holds for any t

113Note that equation (36) for − δJ 1 δ f is the same as equation (19a) for the continuous adjoint function γ(v, t). Additionally, as seen directly from the objective function, the "final" condition for (36) is − δJ 1 δ f (v,T ) = −r(v), the same as the "final" condition (19b) for γ(v, T ). Based on these two facts, we obtain the main result of this subsection:

114Therefore, the continuous adjoint variable γ(v, t) is the negative Fréchet derivative of the objective function with respect to the state variable f (v, t).

DSMC adjoint variable as a derivative

115The analysis of the DSMC adjoint variable γ is a discrete version of the analysis in the previous section for the continuous adjoint variable γ. Consider small perturbations δw k and δw k in the pre-collision velocities w k andw k . The resulting first-order variations in the post-collision velocities are δw k+1 and δw k+1 . Since no other velocities are changed at times t k and t k+1 and because J 1 is time independent, then

116which can be rewritten in operator form, and then by using (8), as

117Since this is true for any values of δw k and δw k , it follows that

118By taking the transpose and using A T = B, then

119Equation (38) shows that (∂ w k J 1 , ∂w k J 1 ) satisfies the same back-propagation rule as (34) for (γ k ,γ k ).

120Recall (30) for the final condition for the adjoint DSMC particles,

121in which the second equation comes from the definition of J 1 in (28). With the same final condition (39) (up to a constant scaling −N), and the same back-propagating rule (34) and (38) from t k+1 to t k , we conclude that

Connections between the continuous and DSMC adjoint variables

122Given an empirical distribution and its limit, we know by the strong law of large numbers that

123for every measurable set Ω ⊆ R 3 , where I Ω is the indicator function. Also,

124Next, we derive the connections between the two derivatives at any time step t k ,

125and ∂J 1 ∂v k,i , which will directly uncover the relationship between the continuous and DSMC adjoint variables based on (37) and (40).

126We consider two empirical density functions,

127as the approximations to the density functions f (v, t k ) and f (v, t k ) + δ f (v, t k ), respectively. We remark that v k,i are random variables following the distribution function f (v, t k ), while we choose δv k,i to be deterministic, as follows:

128Here, Ω is an arbitrary measurable set and η is a small constant vector. The first-order variation of the continuous and the discrete objective functions can be stated as below. For any time step t k ,

129Consider v i = v k,i as one of the N random variables following the distribution f (v, t k ), and denote φ(v) = δJ 1 δ f (v,t k ) . Based on (41), we have

130On the other hand, (41) is related to (42) as the following

131We assume that all v i = v k,i , for i = 1, . . . , N, are (approximately) i.i.d. random variables following the same velocity distribution f (v, t k ). Therefore, by combining (43) and (44), we have

132Since η is an arbitrarily small vector in R 3 , then

133where we change the variable from v i to v for the first term and apply the law of total expectation to the second term.

134Since the set Ω is arbitrary, φ (v) = ( δJ 1 δ f (v,t k ) ) = −γ (v, t k ) and N ∂J 1 ∂v k,i = −γ k,i , which have been shown previously in (37) and (40), we obtain the following equation

135Equation (45) serves as a bridge connecting the two adjoint systems that we have derived in Section 3 and Section 4.

The unbiasedness of the adjoint DSMC gradient estimator

136In (20) and (29), we derive two gradient formulae, ∂ α J and ∂ α J, through the continuous and the discrete adjoint systems, respectively. Next, we show the unbiasedness of the gradient estimator ∂ α J computed through the adjoint DSMC approach:

137There are a direct way and an indirect way to draw samples from continuous distributions f (v, 0) = f 0 (v; α), which is also our initial distribution for the Boltzmann equation:

138The second and indirect approach is to first sample from a simpler base distribution φ( ), which is independent of the parameter α, and then transform this variate through a deterministic path g( , α). This is often referred to as the sampling path or the sampling process [27,37]. For an invertible path, we have the mass-preserving equation:

139Recall in Section 3 where we derive the OTD framework,

140Based on the Law of the Unconscious Statistician (LOTUS),

141Therefore, we have

142The last equality is based on the change of variable v = g( , α). Together with Equation (45), we have

143In conclusion, ∂ α J is an unbiased pathwise Monte Carlo gradient estimator for the objective function J.

144If we solve the continuous adjoint equation (19a) numerically and then compute the gradient for α following (20), the result should match the gradient computed by the DSMC adjoint approach in Section 4 within numerical error. For example, (19a) can be solved numerically by the DSMC-type scheme which we propose in Section 3.2. The continuous and the DSMC adjoint systems are equivalent in optimizing the model parameter α. We will present several numerical examples that verify the gradient accuracy and demonstrate the optimization process in Section 6.

Numerical results

145In this section we discuss the results of numerical simulations computing the gradients of the objective function (28),

146at the final time t = T with respect to the parameter α in the initial conditions f 0 (v; α). Four different methods of the gradient computation are used here: (i) finite difference method using several forward DSMC simulations with different parameter values, (ii) the adjoint DSMC method, (iii) the DSMC-type scheme for the adjoint equation, (iv) the direct discretization of the continuous adjoint equation (19a). All four methods lead to the same gradient values, but the adjoint DSMC method is the best in terms of performance given we do not need many digits of accuracy.

147Here we consider Maxwellian gas, so the distribution function f (v, t) obeys the Boltzmann equation (13) with a collision operator kernel q(v − v 1 , σ) = q(σ). We further assume that q(σ) = 1/(4π) and ρ(t) =´R 3 f (v, t)dv = 1 (conserved throughout the evolution of the distribution function), and thus µ = ρ´S 2 q(σ)dσ = 1 in (14).

148For the function r(v) in Section 6.1-6.4, we use v 2 l and v 4 l , l ∈ {x, y, z}, so the objective functions are

149They are the second-order and the fourth-order velocity moments of the distribution function in the l-direction at the time t = t k . We have six objective functions in total. For the parameter α we use temperature values in the initial distribution function α = [T 0 x , T 0 y , T 0 z ]. We further refer to these gradients as ∂T l ∂T 0 p and ∂m4 l ∂T 0 p respectively, l, p ∈ {x, y, z}. Here the dimension of α is only 3. Still, a real advantage of these methods is, of course, when the vector α is highly multi-dimensional since the described methods allow one to compute all the components of the gradient δJ 1 δα by doing the only one forward DSMC simulation and one backward adjoint DSMC simulation.

150For all the methods we use the same initial condition, anisotropic Gaussian,

151where T 0 x = 0.5, T 0 y = 1, T 0 z = 1, and the total density ρ = 1. In this case, the solution to the Boltzmann equation (13) will relax to an isotropic Gaussian with the temperature T M = (T 0

152x + T 0 y + T 0 z )/3 = 0.8333 (3)

Forward DSMC simulation

153We solve the Boltzmann equation (13) with the Nanbu-Babovsky method as described in Algorithm 1. We represent the distribution function with N particles, ranging from 10 6 to 10 8 , and sample the initial condition from the distribution in (49). Collisions are performed according to the collision rules (2) and the collision angles are sampled uniformly over a unit sphere according to the collision kernel of Maxwellian particles, q(v − v 1 , σ) = 1/(4π). Based on Algorithm 1, the fraction of particles that collide at every time step is N c /N = ∆tµ and is equal to 10% for ∆t = 0.1, µ = 1. The total kinetic energy K(t) = T x (t) + T y (t) + T z (t) and the total momentum p(t) = (p x (t), p y (t), p z (t)), where p l (t) =´R 3 v l f (v, t)dv, are conserved by construction of the algorithm, since every pair-wise collision is elastic. Fig. 4 shows the relaxation of temperatures T x (t), T y (t), T z (t) towards the value T M as well as the relaxation of the fourth-order moments m4 x (t), m4 y (t), m4 z (t) towards the value 3T 2 M as functions of time. Running the standard DSMC simulations several times with randomly sampled initial conditions allows us to estimate the mean values and the standard deviations of quantities of interest at t = T = 2. Details are shown in Table 1, where the standard deviation σ X is computed using M s = 100 simulations with N = 10 6 , 10 8 particles in each. The standard deviations of the quantities of interest give us estimates of the random errors in DSMC algorithm with N particles. They scale with 1/ √ N which can be seen from the σ X values in Table 1. The actual standard deviations of the mean valuesX in Table 1 Table 1: Mean values of p x , p y , p z , T x , T y , T z and m4 x , m4 y , m4 z and their standard deviations at t = 2, which are computed using M s standard DSMC simulations with N particles in each. The temperatures in the initial condition (49) are set to be [T 0

154valuesX by using 95% of the trust interval of radius 2σX, so e rand

155. Finally, we have an estimates of expectations:

156Based on this approach and the values of σ X from Table 1, we can see that when N = 10 8 and M s = 100, the random errors of T x (t = 2), T y (t = 2), T z (t = 2) are e rand T l = 2σ T l / √ M s ≈ 0.00002 (or relative error e rand T l /T l ≈ 0.002%). The random errors of m4 x (t = 2), m4 y (t = 2), m4 z (t = 2) are e rand m4 l = 2σ m4 l / √ M s ≈ 0.0001 (or relative error e rand m4 l /m4 l ≈ 0.005%), l ∈ {x, y, z}.

157To directly compute the gradients of the velocity moments with respect to the parameter α = [T 0 x , T 0 y , T 0 z ] by finite difference, we need to perturb the parameter by a small amount and then compute the corresponding target values at those different initial temperatures. For each component in [T 0

158x T 0 y T 0 z ], we apply a perturbation of size ∆T 0 l = 0.1 or 0.05 away from the original values of [T 0

159x T 0 y T 0 z ] = [0.5 1 1]. In Table 2, we gather the resulting mean values of the moments that are computed using M s = 100 simulations and N = 10 8 particles in each simulation.

160Using the values in Table 2, we can estimate the gradients ∂J 1 ∂α (α 0 ) via the central finite difference

161We can also estimate their errors e ∂J 1 ∂α (α 0 ) , as shown in Table 3. The error in ∂J 1 ∂α (α 0 ) consists of two parts: Table 2: Mean values of T x , T y , T z and m4 x , m4 y , m4 z at t = 2 which are computed using M s = 100 standard DSMC simulations with N = 10 8 particles in each. The initial condition (49) is set with the given initial temperatures [T 0

162where the finite difference error can be estimated as

163where ∆α is a finite step used to estimate ∂ 3 J 1 ∂α 3 , and the random error can be estimated roughly as

164Notice that the finite difference error is proportional to (∆α) 2 while the random error is proportional to 1/∆α, meaning that there is an optimal value of

165for a given value of the random error e rand J 1 (α 0 ) in J(α 0 ) and the third-order derivative of J 1 at α 0 (unknown a priori) for which the total error is minimal. We compute the third-order derivatives according to (53) with ∆α = 0.05. Together with the previously computed e rand T l and e rand m4 l , we estimate the optimal step size ∆α * ∈ (0.06, 1.5), for various components of ∂T l ∂T 0 p and ∂m4 l ∂T 0 p . Eventually, we opt for ∆α = ∆T 0 p = 0.1 for the computation of the gradients and the estimations of the errors that are shown in Table 3. The random errors reflected in the last column of Table 3 are computed using the standard deviations σ T l and σ m4 l from the last column of Table 1 together with (50) and (54). Comparing the random errors in the last column with the finite-difference errors in the other columns of Table 3, we observe that our choice of ∆α = 0.1 is nearly optimal for p = x components and smaller than optimal for the p = y, z components, but the current value of ∆α is good enough for our purposes.

Adjoint DSMC

166In the adjoint DSMC method for the gradient calculation, we first solve the Boltzmann equation (13) as in the previous examples, but at each time step t = t k the indices of the particles that collided, their collision angles σ k,i and the pre-collision relative unit velocities (v k,i −ṽ k,i )ˆare stored in memory for the later use in the backward solve.

167Afterwards, we solve the adjoint DSMC equations derived in Section 4 backward in time. Similar to the definition of the forward particles (15), at the k-th time interval, we represent the adjoint particles as Γ k = {γ 1 , . . . , γ i , . . . , γ N }(t k ), and we denote the i-th adjoint particle in Γ k as γ k,i . We remark that γ k,i is a vector in R 3 . We initialize our backward solve with the "final conditions" (30), γ F,i = −∂ v r(v F,i ), i ∈ 1 . . . N, at the final time t = T = 2, and r(v) is set to

168∂T 0 p Table 3: Gradients δJ 1 δα that are computed using the finite difference formula (51), estimates of the corresponding finite-difference errors based on (53) and Table 2 values, and the corresponding random errors that are computed based on (54) and Table 1 values. The objective functions J 1 = {T l (t = 2), m4 l (t = 2)} and parameter α = T 0 p , l, p ∈ {x, y, z}. The random errors are the same for all α = T 0 p , p ∈ {x, y, z}. All quantities here are computed using ∆α = 0.1.

169∂T 0 y ∂J 1 ∂T 0 Table 4: Gradients δJ 1 δα computed by the adjoint DSMC approach and estimations of the corresponding random errors based on formula (50), where the objective function J 1 = {T l (t = 2), m4 l (t = 2)} and the parameter α = T 0 p , l, p ∈ {x, y, z}.

170be v 2 l or v 4 l , l ∈ {x, y, z}, as discussed previously, where l is fixed for a given simulation. Thus, γ j F,i = −2v l F,i δ l, j and γ j F,i = −4(v l F,i ) 3 δ l, j , respectively, where l, j ∈ {x, y, z} and δ l, j = 1 if l = j and 0 otherwise. The adjoint DSMC equations (33a)-(33b) are then solved backward in time for each collision that happened during the forward solve using the collision angles and the relative unit velocities that have been stored during the forward solve. Once the backward time evolution reaches the initial time t = 0, we use (29),

171, to calculate the gradient of the objective function with respect to the model parameter α. Here, ∂ α v 0,i (α) is a derivative of the initial sample of particles with respect to the parameter α. Hence, it is important to have not only an initial distribution function f 0 (v, α) that depends continuously on the parameter α but also a particular way of sampling such that the samples depend continuously on the parameter α. Since our initial distribution is an isotropic Gaussian (49), we can sample it by sampling 3N values from the standard normal distribution N(0, 1) and then rescaling the values with appropriate initial temperatures as N(0, 1). For α = T 0 p , we can easily compute

172We perform M s = 100 forward DSMC and backward adjoint DSMC simulations with N = 10 8 particles for each simulation. Based on (50), we compute the mean values and random errors for quantities ∂T l Table 4, where the values of the gradients match those in Table 3 up to 4-5 significant digits. The random errors in Table 4 are approximately 10 −5 for ∂T l ∂T 0 p (t = 2) and 10 −4 for ∂m4 l ∂T 0

173, which is about one order of magnitude smaller than the ones in Table 3. It demonstrates another advantage of this method that it does not suffer from amplified random errors compared to the finite difference calculations. For the latter, the random error increases while computing the gradients due to the subtraction of two close values in (51). Table 5: Gradients δJ 1 δα computed by the DSMC-type scheme for the adjoint equation and estimations of the corresponding random errors based on formula (50), where the objective function J 1 = {T l (t = 2), m4 l (t = 2)} and the parameter α = T 0 p , l, p ∈ {x, y, z}.

DSMC-type scheme for the adjoint equation

174For the DSMC-type scheme, we need to store the same information during the forward modeling as the adjoint DSMC method. We solve the continuous adjoint equation (19a) backward in time using a DSMC-type scheme that we have developed in Section 3.2. In this method, we evolve values of the function γ(v, t) evaluated at locations v k,i , i.e., the DSMC particles from the forward solve. At the k-th time step, the set

175contains all those function values, whereγ i (t k ) = γ(v k,i , t k ) is i-th adjoint "particle" in Γ k . We remark thatγ i (t k ) here is a scalar value,γ i (t k ) ∈ R. We initialize our backward solve with the "final conditions" (19b). That is,

176are the velocity particles from the forward DSMC at the final time t = T = 2. Then the continuous adjoint equation (19a) can be solved backward in time following Algorithm 2, whereγ i (t k ) are updated at k + 1 → k time step according to (26) only if v k,i particles participated in a collision during the forward solve at the step k → k + 1. To approximate the last terms in (26), we perform a linear interpolation using the scattered data Γ k+1 at locations v k+1,i ; see (27). Eventually, once the backward time evolution reaches the initial time t = 0, the gradient of the objective function (20) can be computed using the values ofγ i (t = 0), i.e., Γ 0 . In case of the initial condition (49) and the parameter α = T 0 p , p ∈ {x, y, z}, the derivative ∂ α f 0 (v; α) of the initial distribution function with respect to the parameter α in (20) becomes

177By approximating the initial distribution function with the sample particles f 0 (v) ≈ 1

178We performed M s = 10 forward DSMC simulations and backward simulations of the adjoint equation using the DSMC-type scheme with N = 10 6 particles for each simulation. We choose smaller N and M s here because this scheme works much slower due to the interpolation procedure at every time step for every colliding particle. We compute the mean values of the gradients according to (57), and estimate their random errors based on (50). The results are presented in Table 5. We observe that the gradients in Table 4 and Table 5 match up to 2-4 significant digits. The random errors in Table 5 Table 4 as a result of using N = 10 6 instead of N = 10 8 and the additional error introduced by numerical interpolation.

Direct discretization of the adjoint equation integrals

179Here we solve the continuous equation (19a) for γ(v, t) from t = T = 2 to t = 0 with the "final condition" (19b) using a direct numerical integration scheme to compute the integral term on the right-hand side. See details of the numerical scheme in Appendix A.

180As previously, we consider the gradients of the second-order moments, T l (t = 2), and the fourth-order moments, m4 l (t = 2), with respect to α = T 0 p , l, p ∈ {x, y, z}. For each objective function, we perform one forward DSMC simulation with N = 10 8 particles and one backward simulation via the scheme described in (A.2). We did only one

1810.573407 0.214738 0.214742 J 1 = T y (t = 2) 0.214944 0.572962 0.214757 J 1 = T z (t = 2) 0.211709 0.211531 0.569767 J 1 = m4 x (t = 2) 2.343578 1.027094 1.026818 J 1 = m4 y (t = 2) 1.099767 3.193492 1.165838 J 1 = m4 z (t = 2) 1.072768 1.137018 3.153235 Table 6: Gradients δJ 1 δα computed by the direct discretization of the integrals in the continuous adjoint equation (19a), where J 1 = {T l (t = 2), m4 l (t = 2)}, α = T 0 p , l, p ∈ {x, y, z}.

182memory requirements, bytes error scaling operation count simulation (M s = 1) for each objective function due to its extensively long computational time; see the next subsection for discussions on performance. The results are gathered in Table 6. Values of the gradients in Table 6 and Table 4 match up to 2-3 significant digits. We still have random errors that are contributed through the values of f (v, t) in the forward DSMC. The random errors in Table 6 can be roughly estimated using two standard deviations in the last column of Table 1, or e rand Table 6 and Table 4.

183We have also numerically verified Equation (45) using the values of γ(v, t k ) at grid points v = v i x ,i y ,i z obtained during the direct integration simulations and using the finite difference to compute the derivative γ (v, t k ). We approximate E[γ k,i |v = v k,i ] using the histogram count of γ k,i obtained via the adjoint DSMC method around the same grid points v = v i x ,i y ,i z .

Method comparison

184So far, we have described and demonstrated four different ways to compute the gradient of an objective function numerically after the forward DSMC simulations. The summary of their comparison in terms of memory requirements, error scaling and operation count is given in Table 7. See the details of the comparison in Appendix B. Table 8 shows the timings of our code we recorded per objective function using Intel Core i7-3770K processor (4 cores @4.5Ghz) and N = 10 6 , 10 7 , 10 8 , T = 2, ∆t = 0.1, n grid = 30, 40, n ϕ = n θ = 10 parameters.

185The adjoint DSMC is slightly faster (up to 20-30%) than the forward DSMC for the same number of particles N (timings for computing the vector σ and the unit collision direction are included in the forward DSMC timings above and take about 20% of the overall timings, whereas they would add about 35% to the adjoint DSMC timings if we were to include them there). The adjoint DSMC is more than 1000 times faster than the DSMC-like scheme and much faster than the direct discretization of (19a). At the same time, the errors in the adjoint DSMC are at least one order of magnitude smaller than in other methods due to absence of finite-difference or interpolation errors; see Tables Table 4 as it is the most accurate value we have computed. For (i) the errors were estimated using formulas (52)-(55) and the fact that e rand m4 x (t=2) ∝ 1/ √ N to demonstrate that the error scaling and the actual errors (in comparison to the reference value from Table 4) were 2 − 10 times smaller. Note that the slope of the forward DSMC+FD line (blue) is less than the slopes for the adjoint DSMC (red) and DSMC-type scheme for adjoint equation (purple) since the total error in (52) for the optimal ∆α * (as in (55)) scales like ∝ 1/N 1/3 and CPU time ∝ N.

Optimization examples

186We have previously discussed the accuracy and performance of several different numerical schemes to compute the gradient of optimization problems constrained by the Boltzmann equation. The adjoint DSMC method particularly stands out for its simplicity, computational efficiency, and the direct connections with the well-established forward DSMC method [38], as discussed in Section 5.2. Here, we use two optimization examples to illustrate the great potential of the adjoint DSMC method for efficiently solving optimization problems constrained by the Boltzmann equation with the nonlinear collision operator.

Matching the velocity moments

187We have been using the velocity moments of the probability distribution at the final time T as the objective function to test the accuracy of the gradients. Here, we follow the earlier discussions and set the first objective function as

188where d 1 = [T x , T y , T z ], the second velocity moments in each direction and d 2 = 1 2 [m4 x , m4 y , m4 z ], half of the fourthorder velocity moments in each direction at t = T = 2. As we have defined earlier, for l ∈ {x, y, z}. Here, f (v, T ) solves the Boltzmann equation (13) given the initial condition (49). We only treat the initial temperature of the y direction, T 0 y , as the unknown parameter α, while fixing T 0 x = 0.5 and T 0 z = 1. This is to avoid the trivial optimal solution T 0

189. One may notice that the objective function (58) in this example does not match the formulation (18). Nevertheless, it is easy to adapt a general objective function to either the continuous or the DSMC adjoint system based on the role of the adjoint equations: large systems of chain rule which propagate the Fréchet derivative δJ 1 δ f (v,T ) backward in time to δJ 1 δ f (v,0) as f (v, 0) directly depends on the model parameter α. Hence, in this example, the final condition for the continuous adjoint equation (19a) should be

190The final condition for the DSMC adjoint system, γ F,i = [γ x F,i , γ y F,i , γ z F,i ], also the adjoint variable for the final particle

191Starting with T 0 y = 1 as the initial guess for α, we use a gradient-based optimization algorithm to minimize the objective function (58). The steepest descent method with a backtracking line search following the Armijo-Goldstein condition is applied to find a proper stepsize along the descent direction [39]. We compute the gradient by solving one forward DSMC with the current α, and then one adjoint DSMC is solved in every iteration of the optimization process. The total number of particles in both DSMC simulations is N = 10 7 . The spacing in the time domain is ∆t = 0.1. The convergence history of this example is shown in Fig. 6. Both the objective function and the size of the gradient monotonically decrease in the first 30 iterations. The convergence slows down as the gradient is smaller than 0.1% of its initial size. We start to observe oscillations in the gradient that come from the random errors in the DSMC solutions. The iterates converge to 0.4344, the global minimum of the objective function if T 0 y is the only parameter.

Inverse Problem

192Our second example is based the setup of an inverse problem. The fourth-order velocity moments at the final time T = 2 are statistical quantities of interest that can be observed in a realistic or experimental setting. The observable information is solely affected by the unknown initial temperature of the distribution that we aim to recover by minimizing the difference between the observed data and the predicted data simulated by our guess of the model parameter. The reconstruction is formulated as a nonlinear least-squares problem α * = arg min α J 1 (α) = arg min α d obs − d pred (α) 2 2 where the predicted data d pred (α) = [m4 x , m4 y , m4 z ] is a vector of the fourth-order velocity moments at T = 2. We set the true data d obs = [2,1,3]. All other notations and the choice of optimization algorithm follow the previous optimization example.

193The initial guess of the parameters is [0.5, 1.5, 1.0]. The convergence history of the computational inverse problem is shown in Fig. 7. The three components of α converge to [0.8670, 0.0870, 1.3470] in the first 40 iterations. The same as in the previous example, the small variations in the objective function and the gradient norm for the remaining 60 iterations are introduced by the random errors of DSMC simulations, as seen in the plots. Increasing the number of particles can help mitigate the small perturbations.

194Remark 3. We show two simple optimization experiments as examples, but one can apply the framework to more general and large-scale optimization problems constrained by the nonlinear Boltzmann equation. There are at least three directions to generalize the applications. First, the dimensionality of the unknown parameter could be increased with hardly any extra cost. Second, the model parameter is not limited to the initial condition. Such examples include shape optimization of the flow channel [42]. Third, following the same idea, we plan to generalize the adjoint DSMC systems for inhomogeneous Boltzmann equation with the nonlinear collision operator or even more complicated kinetic description.

Conclusion

195In this paper, we present the OTD and DTO approaches of computing the gradient of optimization problems based on the nonlinear Boltzmann equation. The highlight of both frameworks is that one only needs to solve the Boltzmann equation and the adjoint system once to compute the gradient, independent of the size of the unknown in the optimization. The adjoint DSMC system, derived by the DTO approach, offers a deterministic numerical scheme that is remarkably efficient to implement with the forward DSMC method. On the other hand, the Monte Carlo type method designed for the continuous adjoint equation could potentially be used for the linear Boltzmann equation [11]. We plan to extend both frameworks to the general VHS kernel and to the inhomogeneous case. In particular, the adjoint DSMC approach applies to more general kinetic models for gases and plasmas whose behavior could be modeled by Monte Carlo binary collisions. One of such models is the Coulomb collision for charged particles [47]. As the next step, we will apply the adjoint DSMC methods to realistic optimization problems that occur naturally in a broader class of kinetic applications. several simulations with slightly different values of the parameter α. Since these simulations can be done sequentially, it does not increase the overall memory requirements.

196(ii) The adjoint DSMC method requires 3N × 8 = 24N bytes for the storage of γ k,i in addition to the memory requirements from the forward DSMC propagation. During the forward DSMC simulation, we also need to store the following information about the collisions that happen at each time step. For each colliding pair, we store

197• the indices of the two colliding particles, 4 bytes each if stored in the UInt32 format allowing for values in [0, 2 32 − 1]; since 2 32 ≈ 4.3 × 10 9 > 10 8 , it is good enough for our purposes;

198• the σ vector in R 3 , 8 bytes for each component of the vector;

199• the unit collision direction v−v 1 |v−v 1 | ∈ R 3 , 8 bytes for each component. In total, the memory requirements are 56 bytes per colliding pair or 28 bytes per colliding particle. Overall, we need 28N c new bytes stored per time step. If the number of time steps is M = T/∆t, the total amount of extra storage needed for the backward propagation is 28N c M = 28Nµ∆tT/∆t = 28NµT . It becomes comparable to the 24N bytes needed for the particle storage in the forward DSMC when 28NµT > 24N, or when roughly µT > 1. The total amount of extra memory required for the backward propagation is 24N + 28NµT bytes. In our simulations, we use µ = 1, T = 2, so the total amount of memory required for the adjoint DSMC was about four times the amount of memory required for the forward DSMC.

200(iii) The DSMC-type scheme for the continuous adjoint equation (19a) requires 1N × 8 = 8N extra bytes for the storage of γ(v k,i , t k ). Like the forward DSMC, we do not consider temporary storage needed for the colliding particles at each time step since they constitute only a small fraction of the overall number of particles and the new data for γ(v i , t k ) overrides the old one. We also do not store v k,i at every time step during the forward solve since we can always recover the velocity particles when marching back from t = T to t = 0 based on equation (6) with the stored collision parameters σ. In this method, we also need to store all of the same information about colliding particles in the forward DSMC simulation as in the adjoint DSMC method, adding extra 28NµT bytes needed for storage total of 8N + 28NµT bytes.

201(iv) For the direct discretization of the integrals in the adjoint equation (19a), we perform the forward simulation with the standard DSMC method. Afterwards, we need to convert velocity samples {v k,i } N i=1 to a distribution function f (v, t k ) via a histogram at every time step t k during the forward propagation. With n grid being the number of the grid points in each direction of the v-space, we have in total n 3 grid grid points, which requires 8n 3 grid M bytes of memory to store the distribution function f (v, t) at every time step. In our simulations, n grid = 40 considering the high computational complexity. With n 3 grid = 64000 ≈ N/1000 for N = 10 8 , we use ≈ 1000 particles per ∆v 3 box on average. During the backward solve, we need to store n 3 grid values of the function γ(v, t). For the right-hand side of (A.2), we can subtract one term of the right-hand side at a time to save memory. Therefore, in total, we need 8n 3 grid (M + 2) bytes of v . The total number of operations needed to compute γ(v, t k ) from γ(v, t k+1 ) in (A.2) per grid point in the vspace is about (21n ϕ n θ + 4)n 3 grid . Since there are n 3 grid grid points in the v-space grid and M time steps, the total operation count per simulation is about (21n ϕ n θ + 4)n 6 grid M. Assuming n 3 grid = N/1000 and n ϕ = n θ = 10, we get (21n ϕ n θ + 4)n 6 grid M = 0.0021N 2 M. There are drastically more operations in the direct discretization than the adjoint DSMC algorithm as a result of the O(N 2 ) scaling where typically N ≥ 10 6 .

참고문헌 48건

  1. Applications of physics to economics and finance: Money, income, wealth, and the stock market arXiv (Cornell University) · Cornell University · 2003
  2. The Boltzmann Equation and Its Applications Applied mathematical sciences · Springer Nature · 1988 10.1007/978-1-4612-1039-9
  3. A theoretical framework for back-propagation 1988
  4. Sparse stabilization and optimal control of the Cucker-Smale model Mathematical Control and Related Fields · American Institute of Mathematical Sciences · 2013 10.3934/mcrf.2013.3.447
  5. Direct Simulation Scheme Derived from the Boltzmann Equation. I. Monocomponent Gases Journal of the Physical Society of Japan · Physical Society of Japan · 1980 10.1143/jpsj.49.2042
  6. Particle simulation of Coulomb collisions: Comparing the methods of Takizuka &amp; Abe and Nanbu Journal of Computational Physics · Elsevier BV · 2008 10.1016/j.jcp.2007.12.027
  7. An introduction to Monte Carlo method for the Boltzmann equation ESAIM Proceedings · EDP Sciences · 2001 10.1051/proc:2001004
  8. Recovering doping profiles in semiconductor devices with the Boltzmann–Poisson model Journal of Computational Physics · Elsevier BV · 2011 10.1016/j.jcp.2011.01.034
  9. A Convergence Proof for Nanbu’s Simulation Method for the Full Boltzmann Equation SIAM Journal on Numerical Analysis · Society for Industrial and Applied Mathematics · 1989 10.1137/0726004
  10. Direct Simulation and the Boltzmann Equation The Physics of Fluids · AIP Publishing · 1970 10.1063/1.1692849
  11. Stability in L1 for the spatially homogenous Boltzmann equation Archive for Rational Mechanics and Analysis · Springer Science+Business Media · 1988 10.1007/bf00251506
  12. Kinetic models of opinion formation Communications in Mathematical Sciences · International Press of Boston · 2006 10.4310/cms.2006.v4.n3.a1
  13. Runge-Kutta methods in optimal control and the transformed adjoint system Numerische Mathematik · Springer Science+Business Media · 2000 10.1007/s002110000178
  14. History Matching by Use of Optimal Theory Society of Petroleum Engineers Journal · Society of Petroleum Engineers · 1975 10.2118/4627-pa
  15. The Boltzmann equation with a soft potential Communications in Mathematical Physics · Springer Science+Business Media · 1980 10.1007/bf01197579
  16. Theory of collision algorithms for gases and plasmas based on the Boltzmann equation and the Landau-Fokker-Planck equation Physical review. E, Statistical physics, plasmas, fluids, and related interdisciplinary topics · American Physical Society · 2000 10.1103/physreve.61.4576
  17. Adjoint Sensitivity Analysis for Differential-Algebraic Equations: The Adjoint DAE System and Its Numerical Solution SIAM Journal on Scientific Computing · Society for Industrial and Applied Mathematics · 2003 10.1137/s1064827501380630
  18. Insensitive Functionals, Inconsistent Gradients, Spurious Minima, and Regularized Functionals in Flow Optimization Problems International journal of computational fluid dynamics · Taylor & Francis · 2002 10.1080/10618560290034663
  19. On some properties of linear and linearized Boltzmann collision operators for hard spheres Kinetic and Related Models · American Institute of Mathematical Sciences · 2008 10.3934/krm.2008.1.521
  20. A Model for Collision Processes in Gases. I. Small Amplitude Processes in Charged and Neutral One-Component Systems Physical Review · American Institute of Physics · 1954 10.1103/physrev.94.511
  21. The effect of stabilization in finite element methods for the optimal boundary control of the Oseen equations Finite Elements in Analysis and Design · Elsevier BV · 2004 10.1016/j.finel.2004.06.001
  22. Generalization of the Krook kinetic relaxation equation Fluid Dynamics · Pleiades Publishing · 1968 10.1007/bf01029546
  23. 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
  24. Valuing American Options by Simulation: A Simple Least-Squares Approach Review of Financial Studies · Oxford University Press · 2001 10.1093/rfs/14.1.113
  25. Mean-field sparse optimal control Philosophical Transactions of the Royal Society A Mathematical Physical and Engineering Sciences · Royal Society · 2014 10.1098/rsta.2013.0400
  26. METHODS FOR CALCULATING FRÉCHET DERIVATIVES AND SENSITIVITIES FOR THE NON‐LINEAR INVERSE PROBLEM: A COMPARATIVE STUDY<sup>1</sup> Geophysical Prospecting · Wiley · 1990 10.1111/j.1365-2478.1990.tb01859.x
  27. Inverse scattering and inverse boundary value problems for the linear boltzmann equation Communications in Partial Differential Equations · Taylor & Francis · 1996 10.1080/03605309608821207
  28. Monte Carlo and quasi-Monte Carlo methods Acta Numerica · Cambridge University Press · 1998 10.1017/s0962492900002804
  29. Optimal stopping of Markov processes: Hilbert space theory, approximation algorithms, and an application to pricing high-dimensional financial derivatives IEEE Transactions on Automatic Control · Institute of Electrical and Electronics Engineers · 1999 10.1109/9.793723
  30. IV. On the dynamical theory of gases Philosophical Transactions of the Royal Society of London · Royal Society · 1867 10.1098/rstl.1867.0004
  31. Large-Scale PDE-Constrained Optimization: An Introduction Lecture notes in computational science and engineering · Springer Nature · 2003 10.1007/978-3-642-55508-4_1
  32. Discretization of Optimal Control Problems International series of numerical mathematics · Springer Nature · 2011 10.1007/978-3-0348-0133-1_21
  33. <i>Mathematical Methods In Kinetic Theory</i> Physics Today · AIP Publishing · 1970 10.1063/1.3021788
  34. Large-Scale PDE-Constrained Optimization Lecture notes in computational science and engineering · Springer Nature · 2003 10.1007/978-3-642-55508-4
  35. A Review of Mathematical Topics in Collisional Kinetic Theory Handbook of mathematical fluid dynamics · Elsevier BV · 2002 10.1016/s1874-5792(02)80004-0
  36. A topology optimization method in rarefied gas flow problems using the Boltzmann equation Journal of Computational Physics · Elsevier BV · 2019 10.1016/j.jcp.2019.06.022
  37. Mean-Field Optimal Control ESAIM Control Optimisation and Calculus of Variations · EDP Sciences · 2014 10.1051/cocv/2014009
  38. Monte Carlo Gradient Estimation in Machine Learning arXiv (Cornell University) · Cornell University · 2019
  39. Non-commutative discretize-then-optimize algorithms for elliptic PDE-constrained optimal control problems Journal of Computational and Applied Mathematics · Elsevier BV · 2018 10.1016/j.cam.2018.07.028
  40. Kinetic description of optimal control problems and applications to opinion consensus Communications in Mathematical Sciences · International Press of Boston · 2015 10.4310/cms.2015.v13.n6.a3
  41. Kinetic Theory of Shock Structure Using an Ellipsoidal Distribution Function 1965
  42. Reconstruction of the Collision Kernel in the Nonlinear Boltzmann Equation SIAM Journal on Mathematical Analysis · Society for Industrial and Applied Mathematics · 2021 10.1137/20m1329366
  43. Numerical optimization Cambridge University Press eBooks · Cambridge University Press · 2021 10.1017/9781108993456.011
  44. Boltzmann-type control of opinion consensus through leaders Philosophical Transactions of the Royal Society A Mathematical Physical and Engineering Sciences · Royal Society · 2014 10.1098/rsta.2014.0138
  45. Constrained Optimization and Optimal Control for Partial Differential Equations International series of numerical mathematics · Springer Nature · 2011 10.1007/978-3-0348-0133-1
  46. Mathematical Methods in Kinetic Theory Springer eBooks · Springer Nature · 1969 10.1007/978-1-4899-5409-1
  47. Numerical Optimization 2006 10.1007/978-0-387-40065-5
  48. Proceedings of the 1988 Connectionist Models Summer School M. Kaufmann eBooks · M. Kaufmann · 1989