SearcharxivSearch

arXiv subjects

Michal Habera

Publications and source records attributed to Michal Habera.

3 recordsLinked to original sources

Automated dimensional analysis for PDEs

Physical units are fundamental to scientific computing. However, many finite element frameworks lack built-in support for dimensional analysis. In this work, we present a systematic framework for integrating physical units into the Unified Form Language (UFL). We implement a symbolic \texttt{Quantity} class to track units within variational forms. The implementation exploits the abelian group structure of physical dimensions. We represent them as vectors in $\mathbb{Q}^n$ to simplify operations and improve performance. A graph-based visitor pattern traverses the expression tree to automate consistency checks and factorization. We demonstrate that this automated nondimensionalization functions as the simplest form of Full Operator Preconditioning. It acts as a physics-aware diagonal preconditioner that equilibrates linear systems prior to assembly. Numerical experiments with the Navier--Stokes equations show that this improves the condition number of the saddle-point matrix. Analysis of Neo-Hooke hyperelasticity highlights the detection of floating-point cancellation errors in small deformation regimes. Finally, the Poisson--Nernst--Planck system example illustrates the handling of coupled multiphysics problems with derived scaling parameters. Although the implementation targets the FEniCSx framework, the concepts are general and easily adaptable to other finite element libraries using UFL, such as Firedrake or DUNE.

cs.MS

Numerically stable evaluation of closed-form expressions for eigenvalues of $3 \times 3$ matrices

Trigonometric formulas for eigenvalues of $3 \times 3$ matrices that build on Cardano's and Vi\`ete's work on algebraic solutions of the cubic are numerically unstable for matrices with repeated eigenvalues. This work presents numerically stable, closed-form evaluation of eigenvalues of real, diagonalizable $3 \times 3$ matrices via four invariants: the trace $I_1$, the deviatoric invariants $J_2$ and $J_3$, and the discriminant $\Delta$. We analyze the conditioning of these invariants and derive tight forward error bounds. For $J_2$ we propose an algorithm and prove its accuracy. We benchmark all invariants and the resulting eigenvalue formulas, relating observed forward errors to the derived bounds. In particular, we show that, for the special case of matrices with a well-conditioned eigenbasis, the newly proposed algorithms have errors within the forward stability bounds. Performance benchmarks show that the proposed algorithm is approximately ten times faster than the highly optimized LAPACK library for a challenging test case, while maintaining comparable accuracy.

math.NA

Symbolic spectral decomposition of 3x3 matrices

Spectral decomposition of matrices is a recurring and important task in applied mathematics, physics and engineering. Many application problems require the consideration of matrices of size three with spectral decomposition over the real numbers. If the functional dependence of the spectral decomposition on the matrix elements has to be preserved, then closed-form solution approaches must be considered. Existing closed-form expressions are based on the use of principal matrix invariants which suffer from a number of deficiencies when evaluated in the framework of finite precision arithmetic. This paper introduces an alternative form for the computation of the involved matrix invariants (in particular the discriminant) in terms of sum-of-products expressions as function of the matrix elements. We prove and demonstrate by numerical examples that this alternative approach leads to increased floating point accuracy, especially in all important limit cases (e.g. eigenvalue multiplicity). It is believed that the combination of symbolic algorithms with the accuracy improvements presented in this paper can serve as a powerful building block for many engineering tasks.

math.NA