\begin{algorithm}[H]
\scriptsize
\caption{The Newton's Optimization Method Modified with Adding a Multiple of the Identity}\label{Newton method}
\begin{algorithmic}
\Function{NewtonOptimization}{$\bold{M}$, $\boldsymbol{\beta}$, $\boldsymbol{\phi}$}\Comment{$\bold{M}$ represents moments; $\boldsymbol{\beta}$ is the initial value of parameters; $\boldsymbol{\phi}$ represents sufficient statistics. }
\State $converged \gets $False$;\ n \gets 0;\ tol \gets 1\times 10^{-8};\  maxI \gets 400$; \ $\Delta\boldsymbol{\beta}\gets \bold{0}$;
\While{$converged$ is $False$ and $n\le maxI$ }
\State $\alpha \gets \Call{BackTrackingLineSearch}{\boldsymbol{\beta}, \Delta\boldsymbol{\beta}, \bold{M}, \boldsymbol{\phi}}$ \Comment{$\alpha$ is the step size}
\State $\boldsymbol{\beta} \gets \boldsymbol{\beta} + \alpha \Delta\boldsymbol{\beta}$ \Comment{Update the parameters}
\State $H \gets \nabla^2_{\boldsymbol{\beta}} L(\boldsymbol{\beta}; \bold{M}, \boldsymbol{\phi}$);\ $G \gets \nabla_{\boldsymbol{\beta}} L(\boldsymbol{\beta}; \bold{M}, \boldsymbol{\phi})$ \Comment{Compute the Hessian and gradient of the objective $L$ \eqref{MLE optimization goal}}
\State $\lambda \gets 1\times 10^{-3}$
\State $L_H,fail \gets \Call{CholeskyDecomposition}{H}$ \Comment{Standard Cholesky Decomposition Algorithm}
\While{$fail$} \Comment{$fail$ is $True$ if Cholesky decomposition failed}
    \State $L_H,fail \gets \Call{CholeskyDecomposition}{H + \lambda I}$ \Comment{Adding a multiple of the identity}
    \State $\lambda \gets 10\times\lambda$
\EndWhile
\State $\bold{w} =  \Call{TriangularSolve}{L_H, -G}$ \Comment{Solve $L_H \bold{w} = -G$ in which $L_H$ is lower triangular matrix}
\State $\Delta\boldsymbol{\beta} =  \Call{TriangularSolve}{L_H^T, \bold{w} }$ \Comment{Compute the update direction of the Newton's method}
\State $res \gets  0.5 \times \Delta\boldsymbol{\beta} \cdot \nabla L(\boldsymbol{\beta}) $
\State $converged \gets res \le tol$ or $\alpha \le 1\times10^{-6}$ \Comment{Check Convergence}
\State $n\gets n +1$
\EndWhile
\State \textbf{return} $\boldsymbol{\beta}$
\EndFunction
\Function{BackTrackingLineSearch}{$\boldsymbol{\beta}$, $\Delta\boldsymbol{\beta}, \bold{M}, \boldsymbol{\phi}$} \Comment{Backtracking line search to determine the step size}
\State $\alpha \gets 2$; $s \gets 0$;\ $maxT \gets 25$;\ $satisfied \gets False$
   \While{$satisfied$ is $False$ and $s \le maxT$}
   \If{not $satisfied$}
   \State $\alpha \gets 0.5 \alpha$
    \EndIf

   \State $satisfied \gets \Call{ArmijoCondition}{\boldsymbol{\beta},\alpha \Delta\boldsymbol{\beta}, \bold{M}, \boldsymbol{\phi}}$
   \State $s\gets s + 1$
   \EndWhile
\State \textbf{return} $\alpha$
\EndFunction

\Function{ArmijoCondition} {$\boldsymbol{\beta}$, $\Delta\boldsymbol{\beta}, \bold{M}, \boldsymbol{\phi}$} \Comment{The Armijo's condition as stopping criterion of line search}
\State $c\gets 5\times 10^{-4}$;\ $atol \gets 5\times 10^{-6}$;\ $rtol \gets 5\times 10^{-5}$
\State $gradD = -c \nabla_{\boldsymbol{\beta}} L(\boldsymbol{\beta}; \bold{M}, \boldsymbol{\phi})\cdot\Delta\boldsymbol{\beta}$
\State $LD = L(\boldsymbol{\beta}; \bold{M}, \boldsymbol{\phi} ) - L(\boldsymbol{\beta} + \Delta\boldsymbol{\beta};\bold{M}, \boldsymbol{\phi})$

\State \textbf{return} $(LD - gradD) \ge -( atol + rtol\times |LD| ) $ \Comment{The RHS is $0$ with floating-point error tolerance}
\EndFunction

\end{algorithmic}
\end{algorithm}

\begin{algorithm}
[H]
\scriptsize
\caption{The Newton's Optimization Method Modified with Adding a Multiple of the Identity}\begin{algorithmic}
\Function{NewtonOptimization}{$\bold{M}$, $\boldsymbol{\beta}$, $\boldsymbol{\phi}$}\Comment{$\bold{M}$ represents moments; $\boldsymbol{\beta}$ is the initial value of parameters; $\boldsymbol{\phi}$ represents sufficient statistics. }
\State $converged \gets $False$;\ n \gets 0;\ tol \gets 1\times 10^{-8};\ maxI \gets 400$; \ $\Delta\boldsymbol{\beta}\gets \bold{0}$;
\While{$converged$ is $False$ and $n\le maxI$ }
\State $\alpha \gets \Call{BackTrackingLineSearch}{\boldsymbol{\beta}, \Delta\boldsymbol{\beta}, \bold{M}, \boldsymbol{\phi}}$ \Comment{$\alpha$ is the step size}
\State $\boldsymbol{\beta} \gets \boldsymbol{\beta} + \alpha \Delta\boldsymbol{\beta}$ \Comment{Update the parameters}
\State $H \gets \nabla^2_{\boldsymbol{\beta}} L(\boldsymbol{\beta}; \bold{M}, \boldsymbol{\phi}$);\ $G \gets \nabla_{\boldsymbol{\beta}} L(\boldsymbol{\beta}; \bold{M}, \boldsymbol{\phi})$ \Comment{Compute the Hessian and gradient of the objective $L$ \eqref{MLE optimization goal}}
\State $\lambda \gets 1\times 10^{-3}$
\State $L_H,fail \gets \Call{CholeskyDecomposition}{H}$ \Comment{Standard Cholesky Decomposition Algorithm}
\While{$fail$} \Comment{$fail$ is $True$ if Cholesky decomposition failed}
\State $L_H,fail \gets \Call{CholeskyDecomposition}{H + \lambda I}$ \Comment{Adding a multiple of the identity}
\State $\lambda \gets 10\times\lambda$
\EndWhile
\State $\bold{w} = \Call{TriangularSolve}{L_H, -G}$ \Comment{Solve $L_H \bold{w} = -G$ in which $L_H$ is lower triangular matrix}
\State $\Delta\boldsymbol{\beta} = \Call{TriangularSolve}{L_H^T, \bold{w} }$ \Comment{Compute the update direction of the Newton's method}
\State $res \gets 0.5 \times \Delta\boldsymbol{\beta} \cdot \nabla L(\boldsymbol{\beta}) $
\State $converged \gets res \le tol$ or $\alpha \le 1\times10^{-6}$ \Comment{Check Convergence}
\State $n\gets n +1$
\EndWhile
\State \textbf{return} $\boldsymbol{\beta}$
\EndFunction
\Function{BackTrackingLineSearch}{$\boldsymbol{\beta}$, $\Delta\boldsymbol{\beta}, \bold{M}, \boldsymbol{\phi}$} \Comment{Backtracking line search to determine the step size}
\State $\alpha \gets 2$; $s \gets 0$;\ $maxT \gets 25$;\ $satisfied \gets False$
\While{$satisfied$ is $False$ and $s \le maxT$}
\If{not $satisfied$}
\State $\alpha \gets 0.5 \alpha$
\EndIf
\State $satisfied \gets \Call{ArmijoCondition}{\boldsymbol{\beta},\alpha \Delta\boldsymbol{\beta}, \bold{M}, \boldsymbol{\phi}}$
\State $s\gets s + 1$
\EndWhile
\State \textbf{return} $\alpha$
\EndFunction
\Function{ArmijoCondition} {$\boldsymbol{\beta}$, $\Delta\boldsymbol{\beta}, \bold{M}, \boldsymbol{\phi}$} \Comment{The Armijo's condition as stopping criterion of line search}
\State $c\gets 5\times 10^{-4}$;\ $atol \gets 5\times 10^{-6}$;\ $rtol \gets 5\times 10^{-5}$
\State $gradD = -c \nabla_{\boldsymbol{\beta}} L(\boldsymbol{\beta}; \bold{M}, \boldsymbol{\phi})\cdot\Delta\boldsymbol{\beta}$
\State $LD = L(\boldsymbol{\beta}; \bold{M}, \boldsymbol{\phi} ) - L(\boldsymbol{\beta} + \Delta\boldsymbol{\beta};\bold{M}, \boldsymbol{\phi})$
\State \textbf{return} $(LD - gradD) \ge -( atol + rtol\times |LD| ) $ \Comment{The RHS is $0$ with floating-point error tolerance}
\EndFunction
\end{algorithmic}
\end{algorithm}
{
    "title": "stabilizing the maximal entropy moment method for rarefied gas dynamics   at single-precision",
    "id": "2303.02898",
    "abstract": "the maximal entropy moment method (mem) is systematic solution of the challenging problem: generating extended hydrodynamic equations valid for both dense and rarefied gases. however, simulating mem suffers from a computational expensive and ill-conditioned maximal entropy problem. it causes numerical overflow and breakdown when the numerical precision is insufficient, especially for flows like high-speed shock waves. it also prevents modern gpus from accelerating mem with their enormous single floating-point precision computation power. this paper aims to stabilize mem, making it possible to simulating very strong normal shock waves on modern gpus at single precision. we improve the condition number of the maximal entropy problem by proposing gauge transformations, which moves not only flow fields but also hydrodynamic equations into a more optimal coordinate system. we addressed numerical overflow and breakdown in the maximal entropy problem by employing the canonical form of distribution and a modified newton optimization method. moreover, we discovered a counter-intuitive phenomenon that over-refined spatial mesh beyond mean free path degrades the stability of mem. with these techniques, we accomplished single-precision gpu simulations of high speed shock wave up to mach 10 utilizing 35 moments mem, while previous methods only achieved mach 4 on double-precision.",
    "categories": "physics.flu-dyn cs.lg",
    "doi": "",
    "created": "2023-03-06",
    "updated": "2024-02-19",
    "authors": [
        "candi zheng",
        "wang yang",
        "shiyi chen"
    ],
    "affiliation": [],
    "url": "https://arxiv.org/abs/2303.02898"
}
{
    "ToxicityFilter": {
        "text_to_toxicity_attributes": {
            "main.tex": {
                "toxicity_score": 0.0070369947,
                "severe_toxicity_score": 0.00088214874,
                "identity_attack_score": 0.0019053896,
                "insult_score": 0.0065628705,
                "profanity_score": 0.013951761,
                "threat_score": 0.0061814263,
                "sexually_explicit_score": 0.009554301,
                "flirtation_score": 0.39370233
            },
            "elsarticle-num.bst": {
                "toxicity_score": 0.016712861,
                "severe_toxicity_score": 0.0012302399,
                "identity_attack_score": 0.0036627878,
                "insult_score": 0.008937885,
                "profanity_score": 0.017504321,
                "threat_score": 0.0074306927,
                "sexually_explicit_score": 0.012857023,
                "flirtation_score": 0.44020516
            },
            "cas-refs.bib": {
                "toxicity_score": 0.004712273,
                "severe_toxicity_score": 0.0003862381,
                "identity_attack_score": 0.0008047034,
                "insult_score": 0.0062303683,
                "profanity_score": 0.010774951,
                "threat_score": 0.0056506502,
                "sexually_explicit_score": 0.0047181738,
                "flirtation_score": 0.23901649
            },
            "refer.bib": {
                "toxicity_score": 0.008984734,
                "severe_toxicity_score": 0.0011539459,
                "identity_attack_score": 0.0020441315,
                "insult_score": 0.0070758737,
                "profanity_score": 0.014498309,
                "threat_score": 0.006647474,
                "sexually_explicit_score": 0.011205662,
                "flirtation_score": 0.2895855
            },
            "elsarticle-harv.bst": {
                "toxicity_score": 0.016838523,
                "severe_toxicity_score": 0.0013065338,
                "identity_attack_score": 0.004439743,
                "insult_score": 0.0088618845,
                "profanity_score": 0.016889455,
                "threat_score": 0.0077284453,
                "sexually_explicit_score": 0.0136827035,
                "flirtation_score": 0.44743943
            },
            "elsarticle.cls": {
                "toxicity_score": 0.011560776,
                "severe_toxicity_score": 0.0010490417,
                "identity_attack_score": 0.0031263188,
                "insult_score": 0.007493876,
                "profanity_score": 0.0138151245,
                "threat_score": 0.007068211,
                "sexually_explicit_score": 0.009613278,
                "flirtation_score": 0.44272235
            },
            "elsarticle-num-names.bst": {
                "toxicity_score": 0.010681152,
                "severe_toxicity_score": 0.00093460083,
                "identity_attack_score": 0.0035332954,
                "insult_score": 0.0073798755,
                "profanity_score": 0.013405213,
                "threat_score": 0.0071847234,
                "sexually_explicit_score": 0.009141461,
                "flirtation_score": 0.39693123
            },
            "main.bbl": {
                "toxicity_score": 0.011874928,
                "severe_toxicity_score": 0.0011348724,
                "identity_attack_score": 0.003866276,
                "insult_score": 0.0075508766,
                "profanity_score": 0.014532468,
                "threat_score": 0.007521313,
                "sexually_explicit_score": 0.010969753,
                "flirtation_score": 0.27629572
            }
        },
        "reason": null
    }
}
{
    "num_done": {
        "figure": 0,
        "algorithm": 3,
        "plot": 0
    }
}
{
    "NonTrivialRenderingFilter": {
        "white_pixels_ratio": 90.78463929199559,
        "hash": "008eb89f3fbf3f0f",
        "most_frequent_color_ratio": 90.78463929199559
    }
}