SPEC 3.20
Stepped Pressure Equilibrium Code
|
Polynomials evaluation. More...
Functions/Subroutines | |
subroutine | get_cheby (lss, lrad, cheby) |
Get the Chebyshev polynomials with zeroth, first derivatives. More... | |
subroutine | get_cheby_d2 (lss, lrad, cheby) |
Get the Chebyshev polynomials with zeroth, first and second derivatives The Chebyshev polynomial has been recombined and rescaled. See get_cheby for more detail. More... | |
subroutine | get_zernike (r, lrad, mpol, zernike) |
Get the Zernike polynomials \(\hat{R}^{m}_{l}\) with zeroth, first derivatives. More... | |
subroutine | get_zernike_d2 (r, lrad, mpol, zernike) |
Get the Zernike polynomials \(\hat{R}^{m}_{l}\) with zeroth, first, second derivatives. More... | |
subroutine | get_zernike_rm (r, lrad, mpol, zernike) |
Get the Zernike polynomials \(\hat{R}^{m}_{l}/r^m\). More... | |
Polynomials evaluation.
subroutine get_cheby | ( | real, intent(in) | lss, |
integer, intent(in) | lrad, | ||
real, dimension(0:lrad,0:1), intent(inout) | cheby | ||
) |
Get the Chebyshev polynomials with zeroth, first derivatives.
The Chebyshev polynomial has been recombined and rescaled. By doing so, the Chebyshev polynomial satisfy the zero Dirichlet boundary condition on the inner surface of the annulus with reduced ill-conditioning problem.
Let \(T_{l}\) be the Chebyshev polynomial of the first kind with degree \(l\). This subroutine computes
\[\bar{T}_0 = 1, \]
and
\[\bar{T}_l = \frac{T_l - (-1)^{l}}{l+1} . \]
\( T_l \) are computed iteratively.
\[ T_0(s) = 1, \]
\[ T_1(s) = s, \]
\[ T_{l+1}(s) = 2 s T_l(s) - T_{l-1}(s). \]
[in] | lss | coordinate input lss |
[in] | lrad | radial resolution |
[out] | cheby | the value, first derivative of Chebyshev polynomial |
References constants::one, constants::two, and constants::zero.
Referenced by bfield(), intghs(), ma00aa(), preset(), and spsint().
subroutine get_cheby_d2 | ( | real, intent(in) | lss, |
integer, intent(in) | lrad, | ||
real, dimension(0:lrad,0:2), intent(inout) | cheby | ||
) |
Get the Chebyshev polynomials with zeroth, first and second derivatives The Chebyshev polynomial has been recombined and rescaled. See get_cheby for more detail.
[in] | lss | coordinate input lss |
[in] | lrad | radial resolution |
[out] | cheby | the value, first and second derivative of Chebyshev polynomial |
References constants::one, constants::two, and constants::zero.
Referenced by bfield_tangent(), and jo00aa().
subroutine get_zernike | ( | real, intent(in) | r, |
integer, intent(in) | lrad, | ||
integer, intent(in) | mpol, | ||
real, dimension(0:lrad,0:mpol,0:1), intent(inout) | zernike | ||
) |
Get the Zernike polynomials \(\hat{R}^{m}_{l}\) with zeroth, first derivatives.
The original Zernike polynomial is defined by The Zernike polynomials take the form
\begin{eqnarray*} Z^{-m}_{l}(s,\theta) &= R^{m}_{l}(s) \sin m\theta,\\ Z^{m}_{l}(s,\theta) &= R^{m}_{l}(s) \cos m\theta, \end{eqnarray*}
where \(R^{m}_{l}(s)\) is a \(l\)-th order polynomial given by
\begin{eqnarray*} R_l^m(s) = \sum^{\frac{l-m}{2}}_{k=0} \frac{(-1)^k (l-k)!} {k!\left[\frac{1}{2}(l+m) - k \right]! \left[\frac{1}{2}(l-m) - k \right]!} s^{l-2k}, \end{eqnarray*}
and is only non-zero for \(l \ge m\) and even \(l-m\).
In this subroutine, \(R^{m}_{l}(s) \) is computed using the iterative relationship
\begin{eqnarray*} R_l^m(s) = \frac{2(l-1)(2l(l-2)s^2 -m^2 -l(l-2))R_{l-2}^m(s) - l (l+m-2) (l-m-2)R_{l-4}^m(s) }{(l+m)(l-m)(l-2)} \end{eqnarray*}
For \( m=0 \) and \( m=1 \), a basis recombination method is used by defining new radial basis functions as
\begin{eqnarray*} \hat{R}_{0}^{0} &= 1, \hat{R}^{0}_{l} &= \frac{1}{l+1}R^{0}_{l} - \frac{(-1)^{l/2}}{l+1}, \\ \hat{R}_{1}^{1} &= s, \hat{R}^{1}_{l} &= \frac{1}{l+1}R^{1}_{l} - \frac{(-1)^{(l-1)/2}}{2} s. \end{eqnarray*}
so that the basis scales as \(s^{m+2}\) except for \(\hat{R}_{0}^{0}\) and \(\hat{R}_{1}^{1}\), which are excluded from the representation of \({A}_{\theta,m,n}\). For \(m\ge2\), the radial basis functions are only rescaled as
\[ \hat{R}^{m}_{l} = \frac{1}{l+1}R^{m}_{l}. \]
[in] | r | coordinate input, note that this is normalized to \([0, 1]\) |
[in] | lrad | radial resolution |
[in] | mpol | poloidal resolution |
[out] | zernike | the value, first derivative of Zernike polynomial |
References constants::one, constants::two, and constants::zero.
Referenced by bfield(), intghs(), ma00aa(), preset(), and spsint().
subroutine get_zernike_d2 | ( | real, intent(in) | r, |
integer, intent(in) | lrad, | ||
integer, intent(in) | mpol, | ||
real, dimension(0:lrad,0:mpol,0:2), intent(inout) | zernike | ||
) |
Get the Zernike polynomials \(\hat{R}^{m}_{l}\) with zeroth, first, second derivatives.
See get_zernike for more detail.
[in] | r | coordinate input, note that this is normalized to \([0, 1]\) |
[in] | lrad | radial resolution |
[in] | mpol | poloidal resolution |
[out] | zernike | the value, first/second derivative of Zernike polynomial |
References constants::one, constants::two, and constants::zero.
Referenced by bfield_tangent(), and jo00aa().
subroutine get_zernike_rm | ( | real, intent(in) | r, |
integer, intent(in) | lrad, | ||
integer, intent(in) | mpol, | ||
real, dimension(0:lrad,0:mpol), intent(inout) | zernike | ||
) |
Get the Zernike polynomials \(\hat{R}^{m}_{l}/r^m\).
See get_zernike for more detail.
[in] | r | coordinate input, note that this is normalized to \([0, 1]\) |
[in] | lrad | radial resolution |
[in] | mpol | poloidal resolution |
[out] | zernike | the value |
References constants::one, constants::two, and constants::zero.
Referenced by preset().