# Thermal Accelerometer Simulation by the R-Functions Method
## 4 Generalized Numerical Procedure  
First of all, before applying common variational techniques considered in [38; 39], we should pass from inhomogeneous boundary conditions (2) to homogeneous ones by introducing the new function:  
\[\widetilde{\theta}=\theta-\Phi, \tag{3}\]  
where \(\Phi\) is a continuous function which is equal to unity on the part \(\partial\Omega_{H}\) and vanishes on \(\partial\Omega_{C}\). Function \(\Phi\) can be constructed in the way similar to that for the traditional Lagrange interpolation polynomial but here instead of interpolation points we take corresponding segments of the boundary. This technique also is called the transfinite interpolation [40]. Hereinafter, to avoid cumbersome designations, we shall denote:  
\[\theta\equiv\widetilde{\theta}.\]  
Thus, we get:  
\[ \begin{array}{c}\frac{1}{\mathrm{Pr}}\
abla^{2}\theta-\left(U\frac{ \partial\theta}{\partial X}+V\frac{\partial\theta}{\partial Y}\right)=-\frac{ 1}{\mathrm{Pr}}\
abla^{2}\Phi+U\frac{\partial\Phi}{\partial X}+V\frac{ \partial\Phi}{\partial Y};\\ \
abla^{2}\zeta-\left(U\frac{\partial\phi}{\partial X}+V\frac{\partial\phi}{ \partial Y}\right)=-\mathrm{Gr}\cdot\left(\frac{\partial\theta}{\partial Y}+ \frac{\partial\Phi}{\partial Y}\right);\\ \
abla^{2}\psi=-\zeta;\ U=\frac{\partial\psi}{\partial Y},\ V=-\frac{\partial \psi}{\partial X};\end{array}  \tag{4}\]  
\[\partial\Omega:\ \theta=\psi=\frac{\partial\psi}{\partial\mathbf{n}}=U=V=0. \tag{5}\]  
Equations of System (4) can be solved iteratively:  
\[ \begin{array}{c}\frac{1}{\mathrm{Pr}}\
abla^{2}\theta^{(k)}-\left(U^{(k-1)} \frac{\partial\theta^{(k)}}{\partial X}+V^{(k-1)}\frac{\partial\theta^{(k)}} {\partial Y}\right)=-\frac{1}{\mathrm{Pr}}\
abla^{2}\Phi+U^{(k-1)}\frac{ \partial\Phi}{\partial X}+V^{(k-1)}\frac{\partial\Phi}{\partial Y};\\ \
abla^{2}\zeta^{(k)}-\left(U^{(k-1)}\frac{\partial\zeta^{(k)}}{\partial X}+V ^{(k-1)}\frac{\partial\zeta^{(k)}}{\partial Y}\right)=-\mathrm{Gr}\left( \frac{\partial\theta^{(k)}}{\partial Y}+\frac{\partial\Phi}{\partial Y}\right) ;\\ \
abla^{2}\psi^{(k)}=-\zeta^{(k)};\ U^{(k)}=\frac{\partial\psi^{(k)}}{\partial Y },\ V^{(k)}=-\frac{\partial\psi^{(k)}}{\partial X};\ (k=1,2,\ldots).\end{array}  \tag{6}\]  
Initial approximations \(\zeta^{(0)},\ \ \psi^{(0)},\ \ U^{(0)},\ \ V^{(0)}\) must be given. If \(\zeta^{(0)}=\psi^{(0)}=\ U^{(0)}=\ V^{(0)}=0\), then after the first step (\(k=1\)) we obtain the solution to the stationary heat diffusion problem without convection. The iterative process (6) stops when some convergence conditions are fulfilled, for example,  
\[\frac{\left\|\theta^{(k+1)}-\theta^{(k)}\right\|_{\mathbf{L}_{2}(\Omega)}}{ \left\|\theta^{(k+1)}\right\|_{\mathbf{L}_{2}(\Omega)}}\leq\varepsilon<<1. \tag{7}\]  
In a number of variational and projection techniques [6; 38; 39], approximations to \(\theta^{(k)}\) at each iterative step are found in the form of truncated generalized Fourier series with respect to functions of some basis \([f_{n}]_{n=0}^{N}\):  
\[\theta^{(k)}\approx\sum_{n=0}^{N}c_{n}^{(k)}f_{n}, \tag{8}\]  
where \(\mathbf{c}^{(k)}=(c_{0}^{(k)},c_{1}^{(k)},\ldots,c_{N}^{(k)})\) are undefined coefficients. In addition to their differentiability, all functions \(f_{n}\) must vanish on the boundary, i.e.,  
\[\partial\Omega:\ f_{n}=0,\ n=0,\ldots,N. \tag{9}\]  
From Equation (9) it follows that approximation (8) at any iterative step will also satisfy the homogeneous boundary condition (5) for \(\theta\) exactly. [PERSON] (1963) proposed the following technique for constructing a functional basis satisfying Equation (9). First we should take an arbitrary basis system of functions \(\{\chi_{n}\}_{n=0}^{N}\). There may be algebraic or trigonometric polynomials, splines, etc. Then a function \(\omega(X,Y)\) is constructed such that \(\omega>0\) inside \(\Omega\); \(\omega<0\) outside \(\Omega\cup\partial\Omega\); \(\omega=0\) and \(|\
abla\omega|_{2}\
eq 0\) on \(\partial\Omega\).