MomentGauge.Statistic.PolyGaugedStatistics
Contents
MomentGauge.Statistic.PolyGaugedStatistics
#
Module Contents#
Classes#
The base class for store pre-defined gauged polynomial statistics. |
|
The 1D version of polynomial statistics for 35 moments with gauge transformation. |
|
The base class for store pre-defined gauged polynomial statistics with gauge parameter \(s_r\), \(s_x\), and \(w_x\) |
|
The 1D version of polynomial statistics for ESBGK moments with gauge transformation. |
|
The 1D version of polynomial statistics for 35 moments with gauge transformation. |
|
The 1D version of polynomial statistics for 35 moments with gauge transformation. |
- class MomentGauge.Statistic.PolyGaugedStatistics.PolyGaugedStatistics(base_statistics: MomentGauge.Statistic.PolyStatistics.PolyStatistics)#
Bases:
MomentGauge.Statistic.PolyStatistics.PolyStatistics
The base class for store pre-defined gauged polynomial statistics.
The gauged statistics are transformation of ordinary polynomial statistics by a gauge transformation \(A_{ij}(\mathbf{g})\).
Specifically, given a set of polynomial statistics \(\phi_i(\mathbf{u})\), their gauged version is a set of statistics \(\phi_i(\mathbf{u}, \mathbf{g})\) admits extra gauge parameters \(\mathbf{g}\) such that
\begin{equation} \phi_i(\mathbf{u}, \mathbf{g}) = A_{ij}(\mathbf{g})\phi_j(\mathbf{u}) \end{equation}Moreover we have gauge transformation between different gauge parameters
\begin{equation} \phi_i(\mathbf{u}, \mathbf{g}') = T_{ij}(\mathbf{g}',\mathbf{g})\phi_j(\mathbf{u}, \mathbf{g}) \end{equation}- suff_stats#
a list of moment functions [\(\phi_i\), i=0,cdots,N-1] in which each \(\phi_i\) is a polynomial function \(\phi_i\) ( u, \(*\) gauge_paras ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector (\(u_x\), \(u_y\), \(u_z\))
\(*\) gauge_paras : - Arbitrary many extra parameters. The \(*\) refers to the unpacking operator in python.
Returns:
float – the moment value
- Type:
list
- abstract gauge(func)#
Convert the functions of \(\mathbf{u}\) into function of \(\mathbf{u}\) and gauge parameters
- Parameters:
func (function) –
a polynomial function \(\phi\) ( u ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector
Returns:
float – the moment value
- Returns:
a polynomial function \(\phi\) ( u, \(*\) gauge_paras ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector
\(*\) gauge_paras : - Arbitrary many extra parameters. The \(*\) refers to the unpacking operator in python.
Returns:
float – the moment value
- Return type:
function
- abstract gauge_transformation_matrix(gauge_para2=(), gauge_para1=())#
Compute the gauge transformation matrix \(T_{ij}(\mathbf{g}',\mathbf{g})\) between different gauge parameters
\begin{equation} \phi_i(\mathbf{u}, \mathbf{g}') = T_{ij}(\mathbf{g}',\mathbf{g})\phi_j(\mathbf{u}, \mathbf{g}) \end{equation}- Parameters:
gauge_para2 (tuple) – Tuple containing arbitrary many extra gauge parameters such as \(\mathbf{g}'\)
gauge_para1 (tuple) – Tuple containing arbitrary many extra gauge parameters such as \(\mathbf{g}\)
- Returns:
the matrix \(T_{ij}(\mathbf{g}',\mathbf{g})\)
- Return type:
float array of shape (N,N)
- standard_gauge_paras(moments, gauge_para=())#
the standard gauge parameters \(\mathbf{g}\) prefered among all possible gauges.
- Parameters:
moments (float array of shape (N)) – The array containing moments of sufficient statistics given the gauge parameters \(\mathbf{g}\)
gauge_para (tuple) – Tuple containing arbitrary many extra gauge parameters such as \(\mathbf{g}\)
- Returns:
the standard gauge parameters \(\mathbf{g}\) prefered among all possible gauges.
- Return type:
float array
- class MomentGauge.Statistic.PolyGaugedStatistics.Maxwellian_1D_gauged_stats#
Bases:
PolyGaugedStatistics
The 1D version of polynomial statistics for 35 moments with gauge transformation.
- suff_stats#
a list of moment functions [\(\phi_i,i=0,\cdots,2\)] in which each \(\phi_i\) is a polynomial function \(\phi_i\) ( u, gauge_paras ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector (\(u_x\), \(u_y\), \(u_z\))
gauge_paras : float array of shape (3) - The array (\(s\),:math:w_x).
Returns:
float – the moment value
Specifically,
\(\phi_0\) (u ) = 1.
\(\phi_1\) (u ) = \(\bar{u}_x\)
\(\phi_2\) (u ) = \(\bar{u}_x^2 + \bar{u}_y^2 + \bar{u}_z^2\).
in which \(\bar{u}_x = \frac{u_x - w_x}{s}\), \(\bar{u}_y = \frac{u_y}{s}\), \(\bar{u}_z = \frac{u_z}{s}\)
- Type:
list of length (9)
- gauge(func)#
Convert the functions of \(\mathbf{u}\) into function of \(\mathbf{u}\) and gauge parameters (\(s\), \(w_x\)).
- Parameters:
func (function) –
a polynomial function \(\phi\) ( u ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector
Returns:
float – the moment value
- Returns:
a polynomial function \(\phi\) ( u, gauge_paras ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector
gauge_paras : float array of shape (3) - The array (\(s\), \(w_x\)).
Returns:
float – the moment value
- Return type:
function
- gauge_transformation_matrix(gauge_para2=(), gauge_para1=())#
Compute the gauge transformation matrix between different gauge parameters
\begin{equation} \phi_i(\mathbf{u}, (s', w_x') )= T_{ij}(s', w_x',s, w_x) \phi_j(\mathbf{u}, (s, w_x)); \quad i,j = 0, \cdots, 2 \end{equation}- Parameters:
gauge_para2 (tuple) – A tuple containing the array (\(s'\), \(w_x'\)) which is a float array of shape (2).
gauge_para1 – A tuple containing the array (\(s\), \(w_x\)) which is a float array of shape (2).
- Returns:
the matrix \(T_{ij}(s', w_x',s, w_x)\)
- Return type:
float array of shape (3,3)
- standard_gauge_paras(moments, gauge_para=())#
Compute the Hermite gauge parameters
- Parameters:
moments (float array of shape (3)) – The array containing moments of sufficient statistics \((M_0(s, w_x), M_1(s, w_x), M_2(s, w_x))\)
gauge_para (tuple) – A tuple containing the array (\(s\), \(w_x\)) which is a float array of shape (2).
- Returns:
the Hermite gauge parameters (\(s\), \(w_x\))
- Return type:
float array of shape (2)
- class MomentGauge.Statistic.PolyGaugedStatistics.PolyGaugedStatistics_sr_sx_wx(base_statistics: MomentGauge.Statistic.PolyStatistics.PolyStatistics)#
Bases:
PolyGaugedStatistics
The base class for store pre-defined gauged polynomial statistics with gauge parameter \(s_r\), \(s_x\), and \(w_x\)
The gauged statistics are transformation of ordinary polynomial statistics by a gauge transformation \(A_{ij}(\mathbf{g})\).
Specifically, given a set of polynomial statistics \(\phi_i(\mathbf{u})\), their gauged version is a set of statistics \(\phi_i(\mathbf{u}, \mathbf{g})\) admits extra gauge parameters \(\mathbf{g}\) such that
\begin{equation} \phi_i(\mathbf{u}, \mathbf{g}) = A_{ij}(\mathbf{g})\phi_j(\mathbf{u}) = \phi_i(\bar{\mathbf{u}}) \end{equation}such that \(\bar{\mathbf{u}}={ \bar{u}_x, \bar{u}_y, \bar{u}_z }\), \(\bar{u}_x = \frac{u_x - w_x}{s_x}\), \(\bar{u}_y = \frac{u_y}{s_r}\), \(\bar{u}_z = \frac{u_z}{s_r}\).
- suff_stats#
a list of moment functions [\(\phi_i\), i=0,cdots,N-1] in which each \(\phi_i\) is a polynomial function \(\phi_i\) ( u, \(*\) gauge_paras ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector (\(u_x\), \(u_y\), \(u_z\))
\(*\) gauge_paras : - Arbitrary many extra parameters. The \(*\) refers to the unpacking operator in python.
Returns:
float – the moment value
- Type:
list
- gauge(func)#
Convert the functions of \(\mathbf{u}\) into function of \(\mathbf{u}\) and gauge parameters (\(s_r\), \(s_x\), \(w_x\)).
- Parameters:
func (function) –
a polynomial function \(\phi\) ( u ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector
Returns:
float – the moment value
- Returns:
a polynomial function \(\phi\) ( u, gauge_paras ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector
gauge_paras : float array of shape (3) - The array (\(s_r\), \(s_x\), \(w_x\)).
Returns:
float – the moment value
- Return type:
function
- gauge_transformation_matrix(gauge_para2=(), gauge_para1=())#
Compute the gauge transformation matrix between different gauge parameters
\begin{equation} \phi_i(\mathbf{u}, (s_r', s_x', w_x') )= T_{ij}(s_r', s_x', w_x',s_r, s_x, w_x) \phi_j(\mathbf{u}, (s_r, s_x, w_x)); \quad i,j = 0, \cdots, M \end{equation}in which M is the number of sufficient statistics
- Parameters:
gauge_para2 (tuple) – A tuple containing the array (\(s_r'\), \(s_x'\), \(w_x'\)) which is a float array of shape (3).
gauge_para1 – A tuple containing the array (\(s_r\), \(s_x\), \(w_x\)) which is a float array of shape (3).
- Returns:
the matrix \(T_{ij}(s_r', s_x', w_x',s_r, s_x, w_x)\)
- Return type:
float array of shape (M,M)
- standard_gauge_paras(moments, gauge_para=())#
Compute the Hermite gauge parameters
- Parameters:
moments (float array of shape (9)) – The array containing moments of sufficient statistics \((M_0(s_r, s_x, w_x), \cdots, M_8(s_r, s_x, w_x))\)
gauge_para (tuple) – A tuple containing the array (\(s_r\), \(s_x\), \(w_x\)) which is a float array of shape (2).
- Returns:
the Hermite gauge parameters (\(s_r\), \(s_x\), \(w_x\))
- Return type:
float array of shape (3)
- class MomentGauge.Statistic.PolyGaugedStatistics.ESBGK_1D_gauged_stats#
Bases:
PolyGaugedStatistics_sr_sx_wx
The 1D version of polynomial statistics for ESBGK moments with gauge transformation.
- suff_stats#
a list of moment functions [\(\phi_i,i=0,\cdots,3\)] in which each \(\phi_i\) is a polynomial function \(\phi_i\) ( u, gauge_paras ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector (\(u_x\), \(u_y\), \(u_z\))
gauge_paras : float array of shape (3) - The array (\(s_r\), \(s_x\), \(w_x\)).
Returns:
float – the moment value
Specifically,
\begin{equation} \{\phi_i(\mathbf{u}, (s_r, s_x, w_x) ),i=0,\cdots,3\} = \left\{1,\bar{u}_x,\bar{u}_x^2,\bar{u}_r^2,\right\} \end{equation}in which \(\bar{u}_x = \frac{u_x - w_x}{s_x}\), \(\bar{u}_r = \frac{u_r}{s_r}\), \(u_r = \sqrt{u_y^2+u_z^2}\)
- Type:
list of length (4)
- gauge(func)#
Convert the functions of \(\mathbf{u}\) into function of \(\mathbf{u}\) and gauge parameters (\(s_r\), \(s_x\), \(w_x\)).
- Parameters:
func (function) –
a polynomial function \(\phi\) ( u ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector
Returns:
float – the moment value
- Returns:
a polynomial function \(\phi\) ( u, gauge_paras ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector
gauge_paras : float array of shape (3) - The array (\(s_r\), \(s_x\), \(w_x\)).
Returns:
float – the moment value
- Return type:
function
- gauge_transformation_matrix(gauge_para2=(), gauge_para1=())#
Compute the gauge transformation matrix between different gauge parameters
\begin{equation} \phi_i(\mathbf{u}, (s_r', s_x', w_x') )= T_{ij}(s_r', s_x', w_x',s_r, s_x, w_x) \phi_j(\mathbf{u}, (s_r, s_x, w_x)); \quad i,j = 0, \cdots, M \end{equation}in which M is the number of sufficient statistics
- Parameters:
gauge_para2 (tuple) – A tuple containing the array (\(s_r'\), \(s_x'\), \(w_x'\)) which is a float array of shape (3).
gauge_para1 – A tuple containing the array (\(s_r\), \(s_x\), \(w_x\)) which is a float array of shape (3).
- Returns:
the matrix \(T_{ij}(s_r', s_x', w_x',s_r, s_x, w_x)\)
- Return type:
float array of shape (M,M)
- standard_gauge_paras(moments, gauge_para=())#
Compute the Hermite gauge parameters
- Parameters:
moments (float array of shape (9)) – The array containing moments of sufficient statistics \((M_0(s_r, s_x, w_x), \cdots, M_8(s_r, s_x, w_x))\)
gauge_para (tuple) – A tuple containing the array (\(s_r\), \(s_x\), \(w_x\)) which is a float array of shape (2).
- Returns:
the Hermite gauge parameters (\(s_r\), \(s_x\), \(w_x\))
- Return type:
float array of shape (3)
- class MomentGauge.Statistic.PolyGaugedStatistics.M35_1D_gauged_stats#
Bases:
PolyGaugedStatistics_sr_sx_wx
The 1D version of polynomial statistics for 35 moments with gauge transformation.
- suff_stats#
a list of moment functions [\(\phi_i,i=0,\cdots,8\)] in which each \(\phi_i\) is a polynomial function \(\phi_i\) ( u, gauge_paras ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector (\(u_x\), \(u_y\), \(u_z\))
gauge_paras : float array of shape (3) - The array (\(s_r\), \(s_x\), \(w_x\)).
Returns:
float – the moment value
Specifically,
\begin{equation} \{\phi_i(\mathbf{u}, (s_r, s_x, w_x) ),i=0,\cdots,8\} = \left\{1,\bar{u}_x,\frac{\bar{u}_x^2-1}{\sqrt{2}},\frac{\bar{u}_r^2}{2} -1,\frac{\bar{u}_x^3-3\bar{u}_x}{\sqrt{6}},\frac{\bar{u}_x^4-6\bar{u}_x^2+3}{2 \sqrt{6}},\frac{1}{8} \bar{u}_r^4-\bar{u}_r^2+1,\frac{1}{2} \bar{u}_x (\bar{u}_r^2-1),\frac{( \bar{u}_x^2 -1)( \bar{u}_r^2-2)}{2 \sqrt{2}}\right\} \end{equation}in which \(\bar{u}_x = \frac{u_x - w_x}{s_x}\), \(\bar{u}_r = \frac{u_r}{s_r}\), \(u_r = \sqrt{u_y^2+u_z^2}\)
- Type:
list of length (9)
- conservative_decomposition(moments, gauge_para=())#
Decompose the moments as the summation of the conserved part and the non-conserved part
- Parameters:
moments (float array of shape (9)) – The array containing moments of sufficient statistics \((M_0(s_r, s_x, w_x), \cdots, M_8(s_r, s_x, w_x))\)
gauge_para (tuple) – A tuple containing the array (\(s_r\), \(s_x\), \(w_x\)) which is a float array of shape (2).
- Returns:
the conservative part of the moments. The non conservative part is moments - conservative part.
- Return type:
float array of shape (9)
- gauge(func)#
Convert the functions of \(\mathbf{u}\) into function of \(\mathbf{u}\) and gauge parameters (\(s_r\), \(s_x\), \(w_x\)).
- Parameters:
func (function) –
a polynomial function \(\phi\) ( u ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector
Returns:
float – the moment value
- Returns:
a polynomial function \(\phi\) ( u, gauge_paras ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector
gauge_paras : float array of shape (3) - The array (\(s_r\), \(s_x\), \(w_x\)).
Returns:
float – the moment value
- Return type:
function
- gauge_transformation_matrix(gauge_para2=(), gauge_para1=())#
Compute the gauge transformation matrix between different gauge parameters
\begin{equation} \phi_i(\mathbf{u}, (s_r', s_x', w_x') )= T_{ij}(s_r', s_x', w_x',s_r, s_x, w_x) \phi_j(\mathbf{u}, (s_r, s_x, w_x)); \quad i,j = 0, \cdots, M \end{equation}in which M is the number of sufficient statistics
- Parameters:
gauge_para2 (tuple) – A tuple containing the array (\(s_r'\), \(s_x'\), \(w_x'\)) which is a float array of shape (3).
gauge_para1 – A tuple containing the array (\(s_r\), \(s_x\), \(w_x\)) which is a float array of shape (3).
- Returns:
the matrix \(T_{ij}(s_r', s_x', w_x',s_r, s_x, w_x)\)
- Return type:
float array of shape (M,M)
- standard_gauge_paras(moments, gauge_para=())#
Compute the Hermite gauge parameters
- Parameters:
moments (float array of shape (9)) – The array containing moments of sufficient statistics \((M_0(s_r, s_x, w_x), \cdots, M_8(s_r, s_x, w_x))\)
gauge_para (tuple) – A tuple containing the array (\(s_r\), \(s_x\), \(w_x\)) which is a float array of shape (2).
- Returns:
the Hermite gauge parameters (\(s_r\), \(s_x\), \(w_x\))
- Return type:
float array of shape (3)
- class MomentGauge.Statistic.PolyGaugedStatistics.M35_P2_1D_gauged_stats#
Bases:
PolyGaugedStatistics_sr_sx_wx
The 1D version of polynomial statistics for 35 moments with gauge transformation.
- suff_stats#
a list of moment functions [\(\phi_i,i=0,\cdots,8\)] in which each \(\phi_i\) is a polynomial function \(\phi_i\) ( u, gauge_paras ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector (\(u_x\), \(u_y\), \(u_z\))
gauge_paras : float array of shape (3) - The array (\(s_r\), \(s_x\), \(w_x\)).
Returns:
float – the moment value
Specifically,
\begin{equation} \{\phi_i(\mathbf{u}, (s_r, s_x, w_x) ),i=0,\cdots,10\} = \left\{1,\bar{u}_x,\frac{\bar{u}_x^2-1}{\sqrt{2}},\frac{\bar{u}_r^2}{2} -1,\frac{\bar{u}_x^3-3\bar{u}_x}{\sqrt{6}},\frac{\bar{u}_x^4-6\bar{u}_x^2+3}{2 \sqrt{6}},\frac{1}{8} \bar{u}_r^4-\bar{u}_r^2+1,\frac{1}{2} \bar{u}_x (\bar{u}_r^2-1),\frac{( \bar{u}_x^2 -1)( \bar{u}_r^2-2)}{2 \sqrt{2}} , \frac{\bar{u}_x^5}{2 \sqrt{30}}-\sqrt{\frac{5}{6}} \bar{u}_x^3+\frac{1}{2} \sqrt{\frac{15}{2}} \bar{u}_x, \frac{\bar{u}_x^6}{12 \sqrt{5}}-\frac{\sqrt{5} \bar{u}_x^4}{4}+\frac{3 \sqrt{5} \bar{u}_x^2}{4}-\frac{\sqrt{5}}{4} \right\} \end{equation}in which \(\bar{u}_x = \frac{u_x - w_x}{s_x}\), \(\bar{u}_r = \frac{u_r}{s_r}\), \(u_r = \sqrt{u_y^2+u_z^2}\)
- Type:
list of length (11)
- gauge(func)#
Convert the functions of \(\mathbf{u}\) into function of \(\mathbf{u}\) and gauge parameters (\(s_r\), \(s_x\), \(w_x\)).
- Parameters:
func (function) –
a polynomial function \(\phi\) ( u ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector
Returns:
float – the moment value
- Returns:
a polynomial function \(\phi\) ( u, gauge_paras ) whose
Parameters:
u : float array of shape (3) - The 3D sample vector
gauge_paras : float array of shape (3) - The array (\(s_r\), \(s_x\), \(w_x\)).
Returns:
float – the moment value
- Return type:
function
- gauge_transformation_matrix(gauge_para2=(), gauge_para1=())#
Compute the gauge transformation matrix between different gauge parameters
\begin{equation} \phi_i(\mathbf{u}, (s_r', s_x', w_x') )= T_{ij}(s_r', s_x', w_x',s_r, s_x, w_x) \phi_j(\mathbf{u}, (s_r, s_x, w_x)); \quad i,j = 0, \cdots, M \end{equation}in which M is the number of sufficient statistics
- Parameters:
gauge_para2 (tuple) – A tuple containing the array (\(s_r'\), \(s_x'\), \(w_x'\)) which is a float array of shape (3).
gauge_para1 – A tuple containing the array (\(s_r\), \(s_x\), \(w_x\)) which is a float array of shape (3).
- Returns:
the matrix \(T_{ij}(s_r', s_x', w_x',s_r, s_x, w_x)\)
- Return type:
float array of shape (M,M)
- standard_gauge_paras(moments, gauge_para=())#
Compute the Hermite gauge parameters
- Parameters:
moments (float array of shape (9)) – The array containing moments of sufficient statistics \((M_0(s_r, s_x, w_x), \cdots, M_8(s_r, s_x, w_x))\)
gauge_para (tuple) – A tuple containing the array (\(s_r\), \(s_x\), \(w_x\)) which is a float array of shape (2).
- Returns:
the Hermite gauge parameters (\(s_r\), \(s_x\), \(w_x\))
- Return type:
float array of shape (3)