Next Article in Journal
The Chen–Perks Distribution: Properties and Reliability Applications
Next Article in Special Issue
A Hybrid Chebyshev Pseudo-Spectral Finite-Difference Time-Domain Method for Numerical Simulation of 2D Acoustic Wave Propagation
Previous Article in Journal
Difference Game of Closed-Loop Supply Chain of Innovative Products with Discrete-Time Conditions
Previous Article in Special Issue
Synchrosqueezing Transform Based on Frequency-Domain Gaussian-Modulated Linear Chirp Model for Seismic Time–Frequency Analysis
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Computational Technology for the Basis and Coefficients of Geodynamo Spectral Models in the Maple System

Institute of Cosmophysical Research and Radio Wave Propagation FEB RAS, 7, Mirnaya Str., Paratunka, Kamchatka 684034, Russia
*
Author to whom correspondence should be addressed.
Mathematics 2023, 11(13), 3000; https://doi.org/10.3390/math11133000
Submission received: 8 June 2023 / Revised: 27 June 2023 / Accepted: 3 July 2023 / Published: 5 July 2023
(This article belongs to the Special Issue Mathematics in Geophysical Research)

Abstract

:
Spectral models are often used in the study of geodynamo problems. Physical fields in these models are presented as stationary basic modes combinations with time-dependent amplitudes. To construct a model it is necessary to calculate the modes parameters, and to calculate the model coefficients (the Galerkin coefficients). These coefficients are integrals of complex multiplicative combinations of modes and differential operators. The paper proposes computing technology for the calculation of parameters, the derivation of integrands and the calculation of the integrals themselves. The technology is based on computer algebra methods. The main elements for implementation of technology in the Maple system are described. The proposed computational technology makes it possible to quickly and accurately construct fairly wide classes of new geodynamo spectral models.

1. Introduction

Tackling mathematical problems for geophysical magnetohydrodynamics (MHD) consists in solving MHD equations in a rotating coordinate system in an area that is usually a ball or a spherical shell [1,2,3,4]. Only the equation for magnetic field generation is solved for the kinematic dynamo problem [5]. This problem is linear. If feedback is taken into account in the form of the influence of the Lorentz force on the motions of a fluid, then a nonlinear system arises that describes a self-consistent process of interaction between hydrodynamic and magnetic fields. Accounting for the thermal source of the motion of the medium leads to the equations of magneto-convection [6,7,8]. The exact solutions are unknown for such nonlinear systems, and one has to use simplifications and apply numerical methods [9,10,11,12,13,14,15,16,17]. The spectral methods and models based on them are very popular [2,6,11,18,19,20,21,22,23,24,25,26,27,28]. Solutions to non-stationary problems in these methods are sought in the form of linear combinations of a finite number of stationary basis fields (modes). The coefficients (amplitudes) in these combinations depend on time. The modes themselves are usually orthogonal in the area of solution calculation and, preferably, are selected from the complete system. For such a system, one chooses the eigenmodes of a suitable spectral problem. The dynamic system is compiled for non-stationary amplitudes using the Galerkin method. This system, together with the chosen finite set of basic modes, forms the spectral model of the MHD system.
If the basis mode systems are complete in the respective function spaces, this guarantees convergence to the exact solution. The rate of this convergence needs to be studied separately. However, completeness is not required if only large-scale spatial structures are modelled. Then, the model may have a relatively small (10–20) number of modes. In this case it is sufficient that the system of basic modes has good approximating properties. In general, from a formal point of view, any orthogonal system can be suitable for building models. However, it is desirable that the modes have an obvious physical meaning. Then, the modes should form spatial structures that are most natural for the physical system under study. According to the authors, the most appropriate from this point of view are the eigenmodes of the free oscillations or the free dissipation of the fields of linearized problems. The corresponding spectral problems are usually Hermitian. This ensures the orthogonality of such modes. For the Navier–Stokes equation, the application of the Galerkin method with similar modes was studied in detail in [29].
To apply spectral models, two problems must be solved. Firstly, it is necessary to compose a dynamical system for the amplitudes. Secondly, this system must be solved, often with many variants of the initial conditions. The dynamical system itself is quadratically nonlinear with constant coefficients, which are determined by the control parameters of the model and the set of selected modes. Its numerical solution does not cause any particular difficulties. It is much more difficult to compose the dynamic system itself for mode amplitudes, i.e., to calculate all the Galerkin coefficients. Calculation of the coefficients consists in the calculation of volume integrals over a spherical area from various multiplicative combinations of basic modes and their spatial derivatives. These combinations form very complex algebraic expressions. Of course, various methods of numerical integration can be used to calculate the coefficients, but even the error-free writing of integrands is problematic. Most likely, this represents the main difficulty in using spectral methods. The absolute value of each coefficient is a measure of the modes’ interaction in the physical process, which is described by the corresponding term of the original equation. For this reason, the exact equality of some coefficients to zero can carry significant physical information, making it possible to reveal chains of interacting modes. Therefore, it is important to be able to tell whether the coefficient approximates to zero or is exactly zero. Therefore, for the construction of low-mode models, a computational technology is very useful, with the help of which one can quickly calculate the Galerkin coefficients for various sets of basis modes and determine the zero coefficients. This was the main motivation for this research.
According to the authors, the basis of such technology can be computer algebra methods (symbolic computations) [30,31]. Using these methods, one can obtain error-free expressions for integrands and calculate the integrals themselves, partly analytically and partly numerically. Obviously, for a spherical region, all calculations should be carried out with spherical coordinates and the modes should be expressed using spherical functions. Then, when calculating the Galerkin coefficients, integration over the sphere can be carried out analytically, while numerical integration will occur in the radial direction. Computer algebra systems (CAS) software provides a floating-point computation environment. This allows flexibly control of the accuracy of computations and identification of zero coefficients even with numerical integration. CAS are intensively used in research in various fields of mathematics [32,33,34,35,36,37], physics [31,38,39,40,41,42], engineering [43], education [44], and other areas.
The authors have previously used some of the algorithms described in this article to calculate dynamo spectral models as reported in [23,25,45,46,47]. However, the details for calculating the model coefficients were not discussed in these works. The axis-symmetric case for a kinematic dynamo is described in [48]. A complete description of the developed algorithms for the three-dimensional self-consistent problem of magneto-convection is presented in this paper for the first time.
So, this paper describes the new computational technology for compiling spectral geodynamo models. The technology is based on computer algebra methods. It is clear that the last two items can be performed by standard means using any CAS, since any such system allows performance of both analytical and numerical integration. To implement the first two items, it is necessary to calculate vector analysis operations in an analytical form in spherical coordinates. Therefore, it is convenient to use CAS containing packages of vector analysis operators. The Maple system includes the VectorCalculus package, which implements all standard differential and integral operations of vector analysis in various orthogonal coordinate systems. Therefore, the Maple system was used in the work.
The process consists of the following main stages:
  • derivation of explicit analytical expressions for each basic mode;
  • derivation of explicit analytical expressions for integrands that are multiplicative combinations of modes and their spatial derivatives;
  • analytical integration over the sphere (this integration gives a zero value or some expression depending on the radial variable);
  • if the integral over a sphere is non-zero, then analytical or numerical integration are executed over a radial variable.

2. Magnetoconvection Equations

Let us consider a spherical shell of an incompressible electrically conducting fluid (liquid core), which rotates uniformly about the z-axis. In a spherical coordinate system ( r , θ , φ ) , the inner core boundary (ICB) is r = r i , and the core-mantle boundary (CMB) is r = r o . The temperature at the ICB and CMB is constant and equal to T i and T o , respectively.
The fluid velocity v , the magnetic field B , and the temperature T, are governed by the dimensionless equations of magnetoconvection:
v t + v v = p + Δ v 2 E 1 e z × v + RaP r 1 T r + rot B × B , T t + v · T + T s = Pr 1 Δ T , B t = rot v × B + R α rot α ( r ) B + Pm 1 Δ B , v = 0 , B = 0 .
The fluid dynamic equations have to be understood as Boussinesq approximations. The governing dimensionless parameters of the model are the Ekman number E , the Rayleigh number Ra , the Prandtl number Pr , the magnitude of the α -effect R α , and the magnetic Prandtl number Pm . The liquid core outer radius r o and δ T = T i T o > 0 serve as the length scale and the temperature scale, respectively. To maintain the correct ratio at this length scale, the radius of the inner core r i = 0.35 .
On the right side of the Navier–Stokes equation (the first Equation (1)), there are three force sources: the Coriolis force 2 E 1 e z × v , the buoyancy force RaP r 1 T r , and the Lorentz force rot B × B . On the right side of the induction equation (third Equation (1)), the term rot v × B describes the field generation by large-scale motions of the fluid, and the term R α rot α ( r ) B describes a small-scale turbulent generator ( α -effect).
In Equation (1), the variable T denotes the temperature deviation from the equilibrium profile
T s = r i 1 r i 1 r 1 + T i 1 .
The temperature deviation T is zero at the ICB and CMB. For the velocity, no-slip boundary conditions at the ICB and CMB are applied.
Moreover, it is assumed that the magnetic permeabilities of the outer and inner cores are equal, and that the surrounding of the core is electrically non-conducting. Therefore, the magnetic field must be the potential for r > 1 . Then, B r > 1 = B out r , t , where B out = u r , t and Δ u = 0 . The magnetic field must disappear at infinity, so
u = n = 1 r n 1 m = n n g n m ( t ) Y n m ( θ , φ ) ,
where Y n m ( θ , φ ) —spherical harmonics, and g n m ( t ) —multipole amplitudes.
Turbulence is considered to be isotropic. Therefore, the α -effect is used for scalar parametrization in the form α ( r ) = A r cos θ , where max | A ( r ) | = 1 and A r = 0 for r < r i and r > 1 .
It is important to note that convection and magnetic field generation occur only in the liquid core, but that the magnetic field dissipates throughout the entire volume of the core. Therefore, the magnetic field modes must be determined for 0 r 1 , and the velocity and temperature modes only for r i r 1 . Thus, Equation (1) is closed by the boundary conditions:
v r = r i = v r = 1 = 0 , T r = r i = T r = 1 = 0 , B r = 0 < , B ( r = 1 ) = B o u t ( r = 1 ) .

3. General Form of Spectral Model Equations

To obtain the general form of the spectral model equations, assume that the field components are approximately represented by linear decompositions of a finite number of modes:
v r , t = l = 1 L max β l ( t ) v l r , T r , t = s = 1 S max α s ( t ) T s r , B r , t = p = 1 P max γ p ( t ) B p r .
All these modes are free decay eigenmodes of the corresponding fields, i.e., solutions of spectral problems
μ v p + Δ v = 0 , v = 0 , λ T + Δ T = 0 , η B + Δ B = 0 , B = 0
with boundary conditions (4).
Each of these spectral problems describes the free decay of the corresponding field when there are no sources. This decay for the velocity field is related to the viscosity of the medium, for the magnetic field, it is related to the finite conductivity, and, for the temperature, it is related to the transfer of heat due to heat conduction. The eigenvalues determine the characteristic decay times of the modes—the larger the eigenvalue, the faster the mode decays.
Explicit expressions for these modes and how their parameters and eigenvalues can be determined using CAS will be considered below.
For now, only note that all these problems are Hermitian with respect to inner products:
v 1 , v 2 v = r i r 1 v 1 v 2 d V = r i 1 r 2 d r 0 π sin θ d θ π π v 1 v 2 d φ , T 1 , T 2 T = r i r 1 T 1 T 2 d V = r i 1 r 2 d r 0 π sin θ d θ π π T 1 T 2 d φ , B 1 , B 2 B = 0 r 1 B 1 B 2 d V = 0 1 r 2 d r 0 π sin θ d θ π π B 1 B 2 d φ ,
and their eigenmodes systems are full [29]. Therefore, the modes are orthogonal with respect to these inner products. Moreover, they are assumed to be normalized.
The decompositions (5) are substituted into the Equation (1) and the Galerkin procedure is applied. The result is a dynamic system for amplitudes:
d β l d t = i , j = 1 L max B l i j β i β j μ l β l + E 1 i = 1 L max E l i β i + RaP r 1 i = 1 S max C l i α i + i , j = 1 P max Q l i j γ i γ j , l = 1 , , L max , d α s d t = i , j = 1 L max , S max F s i j β i α j + i = 1 L max H s i β i Pr 1 λ s α s , s = 1 , , S max , d γ p d t = i , j = 1 L max , P max W p i j β i γ j + R α i = 1 P max W p i j α γ i Pm 1 η p γ p , p = 1 , , P max .
In this system, μ l > 0 , λ s > 0 and η p > 0 are the eigenvalues of the corresponding modes, and the remaining coefficients (Galerkin coefficients) are determined by the inner products, which are calculated by the Formula (7):
B l i j = v i v j , v l v , E l i = 2 e z × v i , v l v , C l i = T i r , v l v , Q l i j = rot B i × B j , v l v , F s i j = v i T j , T s T , H s i = r i 1 r i r 2 v i e r , T s T , W p i j = rot v i × B j , B s v , W p i α = rot A ( r ) cos θ B i , B s v .
It is necessary to provide an explanation for the coefficients W p i j and W p i α . All Galerkin coefficients for the third equation of the system (1) are calculated using the inner product · , · B where integration over the radial variable goes over the segment [ 0 ; 1 ] . But the first factor in W p i j contains the v i velocity modes, which are zero for r < r i . Therefore, in fact, integration will only be for r i r 1 , i.e., as in the inner product · , · v . The situation is similar with W p i α because A r < r i = 0 .
The system (8) does not have a term corresponding to the pressure field. The reason is that the Galerkin coefficients for terms with pressure are zero. This is a well-known result [29], but the derivation is described in Appendix A.1.
From the well-known triple scalar product property e z × v i v l = e z × v l v i , it follows that E l i = E i l . In particular, E l l = 0 .
It is necessary to note the following well-known equality [29]
B l i j + B l j i + B i l j + B i j l + B j i l + B j l i = 0 .
It is usually obtained from physical considerations as a consequence of the law of conservation of kinetic energy for an ideal fluid. The mathematical derivation of these relations, using only the boundary conditions for the velocity components and their divergence-freeness, is given in Appendix A.2. Note that, from (10), it follows that B l l l = 0 .
The coefficients B l i j and B l j i enter the equations of the spectral model (8) symmetrically, although they are defined as Galerkin coefficients by expressions asymmetric in i and j. However, based on the formula (A8) from Appendix A.2, they can be redefined in the following symmetrical way:
B l i j = B l j i = v i × rot v j + v j × rot v i , v l v 2 .
The equality (10) will be preserved after such a redefinition.
The coefficients Q l i j and Q l j i also enter the equations of the spectral model (8) in a symmetrical way, although they are defined by expressions that are asymmetric in i and j. For their symmetrical redefinition, the relationship (A15) between the coefficients can be used from Appendix A.3:
Q l i j + Q l j i + W i l j + W j l i = 0 .
Then, the Lorenz terms coefficients can be redefined in a way that is symmetric in i and j:
Q l i j = Q l j i = W i l j + W j l i 2 .
Another advantage of this definition is that there is no need to separately calculate the integrals for the coefficients of the Lorentz terms. Note that, for spectral models of the type (8), the equality (12) expresses the total energy conservation law in ideal magnetohydrodynamics.
So, in what follows, it is assumed that the coefficients B l i j and Q l i j are defined by the formulas (11) and (13), respectively.
There is another important relationship between the coefficients (Appendix A.4)
F s i j = F j i s and F s i s = 0 .

4. Calculation of Basis Modes

Let us consider the calculation of the basis modes, i.e., the solutions of spectral problems (6) with boundary conditions (4). The general form of these solutions is well known, but it is necessary to obtain the numerical values of the parameters, normalization coefficients, and eigenvalues. Following the general idea of the work, these problems are solved using the CAS.
The dependence of the modes on θ and φ is expressed in terms of the spherical harmonics Y n m ( θ , φ ) . The harmonics are assumed to be normalized on the sphere surface:
0 π sin θ d θ π π Y n m ( θ , φ ) 2 d φ = 1 .
Then, it follows from the properties of the spherical functions that
0 π sin θ d θ π π Y n m θ 2 + 1 sin 2 θ Y n m φ 2 d φ = n n + 1 .
These relations lead to normalization conditions for radial functions, which are presented below.

4.1. Velocity Modes

The problem (4,6) for velocity is solved separately in the class of toroidal and poloidal fields.
Toroidal eigenmodes have the form:
v k n m T = rot R k n T ( r ) Y n m ( θ , φ ) r = R k n T ( r ) 1 sin θ e θ φ e φ θ Y n m ( θ , φ ) , k = 0 , 1 , 2 , , n = 1 , 2 , 3 , , m = n , , n .
The radial functions
R k n T ( r ) = A k n T j n μ k n T r + B k n T y n μ k n T r ,
where j n ( · ) and y n ( · ) are the spherical Bessel functions of the 1st and 2nd kind, and μ k n T are the eigenvalues. The coefficients A k n T and B k n T must provide the normalization condition
n ( n + 1 ) r i 1 r 2 R k n T ( r ) 2 d r = 1 ,
and the boundary conditions
R k n T ( r i ) = R k n T ( 1 ) = 0 .
The equalities (19) and (20) ensure that the v k n m T modes are normalized with respect to the inner product · , · v and they satisfy the boundary conditions (4).
It can be seen from the expressions (18) that the boundary conditions (20) are a system of two homogeneous linear equations with respect to the coefficients A k n T and B k n T . For the existence of a non-zero solution of this system, it is necessary that the determinant of its matrix be zero. The need for a zero determinant provides equations for the eigenvalues:
j n μ r i y n μ j n μ y n μ r i = 0 .
For each n = 1 , 2 , , this equation has a countable set of solutions μ k n T , numbered by index k = 0 , 1 , 2 , .
Each such eigenvalue makes the equations of the system (20) linearly dependent. Therefore, the coefficients A k n T and B k n T can only be determined from the second equation. It is clear from (18) that one of the solutions to this equation is A k n T = y n μ k n T and B k n T = j n μ k n T . Such values of the coefficients will ensure the fulfillment of the boundary condition. However, they will still need to be renormalized to ensure that the conditions (19) are met.
So, to calculate the modes, it is necessary to find the eigenvalues μ k n T and the coefficients A k n T and B k n T . Let us consider how this problem is solved by means of Maple. To do this, the maximum values N and K for the indices n and k are chosen. Then the following calculations are organized in Maple:
  • Arrays of explicit expressions for j n ( z ) and y n ( z ) are formed, based on the general recurrence relations for spherical Bessel functions w n ( z ) and explicit expressions for functions of the 1st and 2nd kind [49]:
    w n + 1 ( z ) + w n 1 ( z ) = 2 n + 1 z w n ( z ) , j 0 ( z ) = sin z z , j 1 ( z ) = sin z z 2 cos z z , y 0 ( z ) = cos z z , y 1 ( z ) = sin z z cos z z 2 .
    Here is the corresponding Maple code:
    j:=array(0..N,[]): y:=array(0..N,[]):
    j[0]:=sin(z)/z: j[1]:=sin(z)/z^2-cos(z)/z:
    y[0]:=-cos(z)/z: y[1]:=-sin(z)/z-cos(z)/z^2:
    for n from 1 to N-1 do
      j[n+1]:=simplify((2∗n+1)/z∗j[n]-j[n-1]):
      y[n+1]:=simplify((2∗n+1)/z∗y[n]-y[n-1]):
    end do:
  • The normalization expression (19) is calculated and written to the variable U symbol in symbolic form with undefined values of the coefficients, eigenvalues, and the integration limit r i :
    assume(r_i>0):
    RT_:=AT_∗eval(j[n],z=sqrt(mu_)∗r)+BT_∗eval(y[n],z=sqrt(mu_)∗r):
    Usymbol:=n∗(n+1)∗int(r^2∗RT ^2,r=r_i..1):
  • The left side of the Equation (21) is formed and its first K + 1 roots μ k n T are numerically determined. The roots are first separated with a step of 1 and then refined with the required degree of accuracy. Note that, Maple allows you to control the precision of floating point calculations. The precision of calculations is determined by the Digits system variable. The Maple code:
    LPEq:=eval(j[n],z=sqrt(mu_)∗.35)∗eval(y[n],z=sqrt(mu_))-
                eval(j[n],z=sqrt(mu_))∗eval(y[n],z=sqrt(mu_)∗.35):
    mu_left:=1.e-03:
    mu_right:=mu_left+1.:
    LPEq_left:=eval(LPEq,mu_=mu_left):
    k:=0:
    while (k<=K) do
      LPEq_right:=eval(LPEq,mu_=mu_right):
      if ((LPEq_left∗LPEq_right)<=0) then
        muT[k,n]:=fsolve(LPEq=0,mu_=mu_left..mu_right):
        k:=k+1:
      end if:
      mu_left=mu_right:
      mu_right:=mu_left+1.:
      LPEq_left:=LPEq_right:
    end do:
  • Assignments are made:
    A k n T : = y n μ k n T , B k n T : = j n μ k n T .
    Such values of the coefficients will ensure the fulfillment of the boundary conditions.
    for k from 0 to K do
      AT[k,n]:=eval(y[n],z=sqrt(muT[k,n])):
      BT[k,n]:=-eval(j[n],z=sqrt(muT[k,n])):
    end do:
  • The numeric value U number is calculated by substituting the numeric values A k n T , B k n T , μ k n T and r i into U symbol . Then renormalization is performed using assignments:
    A k n T : = A k n T / U number , B k n T : = B k n T / U number .
    for k from 0 to K do
      Unumber:=eval(Usymbol,
                    [AT_=AT[k,n],BT_=BT[k,n],mu_=muT[k,n],r_i=.35]):
      AT[k,n]:=AT[k,n]/sqrt(Unumber):
      BT[k,n]:=BT[k,n]/sqrt(Unumber):
    end do:
The calculations from points (2)–(5) must be performed in a loop for n = 1 , , N .
For readers unfamiliar with the Maple language, let us explain that the procedure simplify(expr) performs a simplification of the expression expr; the procedure eval(expr,[x1=expr1,x2=expr2,...]) performs a substitution into the expression expr instead of the variables x1, x2,... of the expressions expr1, expr2,...; the procedure fsolve(F(x)=0, x=a..b) numerically finds the root of the equation F ( x ) = 0 localized on the interval ( a ; b ) ; and the procedure int(expr,x=a..b) performs analytical integration of the expression expr over the variable x in the range from a to b.
The found values A k n T , B k n T , μ k n T , together with the expressions (17,18), determine the basic toroidal velocity modes.
In Figure 1, graphs of R k n T functions for n = 2 , 5 and k = 0 , , 4 are given. It can be seen that the functions are zero at r i = 0.35 and r o = 1 in accordance with the conditions (20). Also note that the functions R k n T have k zero values on the interval ( r i ; r o ) . This indirectly confirms the correctness of the calculation of μ k n T .
Now, let us find the poloidal velocity eigenmodes. They have a general form
v k n m P = rot rot R k n P ( r ) Y n m ( θ , φ ) r = n ( n + 1 ) R k n P ( r ) r Y n m ( θ , φ ) e r + + d R k n P ( r ) d r + R k n P ( r ) r e θ θ + 1 sin θ e φ φ Y n m ( θ , φ ) , k = 0 , 1 , 2 , ,       n = 1 , 2 , 3 , ,       m = n , , n ,
where radial functions
R k n P ( r ) = C k n 1 j n μ k n P r + C k n 2 y n μ k n P r + C k n 3 r n + C k n 4 r n 1 .
Comparing the expression (25) with the expressions (15) and (16) shows that the coefficients C k n i must provide the normalization condition
n 2 ( n + 1 ) 2 r i 1 R k n P ( r ) 2 d r + n ( n + 1 ) r i 1 r 2 d R k n P ( r ) d r + R k n P ( r ) r 2 d r = 1 .
This ensures that the v k n m P eigenmodes are normalized with respect to the inner product · , · v .
It is also necessary that such conditions be satisfied for the radial functions R k n P ( r ) :
R k n P ( r i ) = R k n P ( 1 ) = d R k n P d r | r = r i = d R k n P d r | r = 1 = 0 .
This will enforce the boundary conditions (4).
The conditions (28) lead to a homogeneous linear system of equations with respect to the coefficients C k n i . The condition for the existence of non-zero solutions of this system gives equations for the eigenvalues in the form of the determinant being equal to zero:
j n ( μ r i ) y n ( μ r i ) r i n r i n 1 j n ( μ ) y n ( μ ) 1 1 μ j n ( μ r i ) μ y n ( μ r i ) n r i n 1 ( n 1 ) r i n 2 μ j n ( μ ) μ y n ( μ ) n n 1 = 0 .
For each n = 1 , 2 , , this equation has a countable set of solutions μ k n P , numbered by index k = 0 , 1 , 2 , .
Using Maple, let us find the eigenvalues μ k n P and the coefficients C k n i .
  • The package of linear algebra operations is connected.
    with(LinearAlgebra):
  • The normalization expression (27) is calculated and written to the variable U symbol in symbolic form with undefined values of the coefficients, eigenvalues, and the integration limit r i .
    RP_:=C1_∗eval(j[n],z=sqrt(mu_)∗r)+C2_∗eval(y[n],z=sqrt(mu_)∗r)+
        C3_∗r^n+C4_∗r^(-n-1):
    Usymbol:=n^2∗(n+1)^2∗int(RP_^2,r=r_i..1)+
             n∗(n+1)∗int((diff(RP_,r)+RP_/r)^2∗r^2,r=r_i..1):
  • The matrix G is formed for the determinant from the Equation (29).
    G:=Matrix(4,4):
    G[1,1]:=eval(j[n],z=sqrt(mu_)∗.35): G[1,2]:=eval(y[n],z=sqrt(mu_)∗.35):
    G[1,3]:=.35^n: G[1,4]:=.35^(-n-1):
    G[2,1]:=eval(j[n],z=sqrt(mu_)): G[2,2]:=eval(y[n],z=sqrt(mu_)):
    G[2,3]:=1: G[2,4]:=1:
    G[3,1]:=sqrt(mu_)∗eval(diff(j[n],z),z=sqrt(mu_)∗.35):
    G[3,2]:=sqrt(mu_)∗eval(diff(y[n],z),z=sqrt(mu_)∗.35):
    G[3,3]:=n∗.35^(n-1): G[3,4]:=(-n-1)∗.35^(-n-2):
    G[4,1]:=sqrt(mu_)∗eval(diff(j[n],z),z=sqrt(mu_)):
    G[4,2]:=sqrt(mu_)∗eval(diff(y[n],z),z=sqrt(mu_)):
    G[4,3]:=n: G[4,4]:=-n-1:
  • The left part of the Equation (29) is formed and its first K + 1 roots μ k n P are numerically determined. The roots are first separated with a step of 1 and then refined with the required degree of accuracy.
    LPEq:=Determinant(G):
    k:=0:
    mu_left:=1e-06:
    mu_right:=mu_left+.01:
    while (k<=K) do
      if (eval(LPEq,mu_=left_mu)∗eval(LPEq,mu_=right_mu)<=0) then
        muP[k,n]:=fsolve(LPEq=0,mu_=left_mu..right_mu):
        k:=k+1:
      end if:
      left_mu=right_mu:
      right_mu:=left_mu+.01:
    end do:
  • C k n 4 : = 1 is assigned, and the remaining coefficients are determined as solutions of the linear system:
    j n μ k n P r i y n μ k n P r i r i n j n μ k n P y n μ k n P 1 μ j n ( μ ) μ y n ( μ ) n · C k n 1 C k n 2 C k n 3 = r i n 1 1 n + 1
    Such values of the coefficients will ensure the fulfillment of the boundary conditions (28).
    for k from 0 to K do
      C4_[k,n]:=1.:
      L:=SubMatrix(eval(G,[mu_=muP[k,n]]),[1..2,4],[1..3]):
      Q:=SubMatrix(eval(G,[mu_=muP[k,n]]),[1..2,4],[4]):
      S:=LinearSolve(L,-Q):
      C1[k,n]:=S[1,1]: C2[k,n]:=S[2,1]:
      C3[k,n]:=S[3,1]: C4[k,n]:=S[4,1]:
    end do:
  • The numeric value U number is calculated by substituting into U symbol the numeric values C k n i and μ k n P and r i . Then renormalization is performed using assignments:
    C k n i : = C k n i / U number .
    for k from 0 to K do
      Unumber:=eval(Usymbol,
               [C1_=C1[k,n],C2_=C2[k,n],C3_=C3[k,n],C4_=C4[k,n],
                mu_=muP[k,n],r_i=.35]):
      C1[k,n]:=C1[k,n]/sqrt(Unumber): C2[k,n]:=C2[k,n]/sqrt(Unumber):
      C3[k,n]:=C3[k,n]/sqrt(Unumber): C4[k,n]:=C4[k,n]/sqrt(Unumber):
    end do:
The calculations from points (2)–(6) must be performed in a loop for n = 1 , , N .
The found values of C k n i and μ k n P , together with the expressions (25,26), determine the basis poloidal velocity modes.
In Figure 2, graphs of R k n P functions for n = 1 , 4 and k = 0 , , 4 are given. It can be seen that both the functions themselves and their derivatives are zero at r i = 0.35 and r o = 1 in accordance with the conditions (28). Also note that, as in the toroidal case, these functions are zero on the interval ( r i ; r o ) at k distinct points. This indirectly confirms the correctness of the calculation of μ k n P .

4.2. Magnetic Modes

The problems (4) and (6) for the magnetic field are also solved separately in the class of toroidal and poloidal fields.
Toroidal solutions of the spectral problem (6) for a magnetic field have the form
B k n m T = rot X k n T ( r ) Y n m ( θ , φ ) r = X k n T 1 sin θ e θ φ e φ θ Y n m ( θ , φ ) , X k n T ( r ) = a k n T j n η k n T r + b k n T y n η k n T r , k = 0 , 1 , 2 , , n = 1 , 2 , 3 , , m = n , , n ,
where eigenvalues η k n T > 0 .
The boundary condition B ( r = 0 ) < from (4) leads to b k n T = 0 because y n ( 0 ) = . Consider now the boundary condition for r = 1 . First of all, it must be noted that the field B out = u can be represented as
B out = n = 1 m = n n g n m ( t ) B n m out ( r ) , where B n m out ( r ) = rot rot r n 1 n Y n m ( θ , φ ) r ,
so it is a poloidal field. Therefore, the toroidal modes must be zero at r = 1 , i.e., X k n T ( 1 ) = 0 . Then the eigenvalue equation
j n η = 0 .
The normalization condition has the form
n ( n + 1 ) 0 1 r 2 X k n T ( r ) 2 d r = n ( n + 1 ) 0 1 r 2 a k n T j n η k n T r 2 d r = 1 .
From these conditions appear explicit expressions for the coefficients:
a k n T = n ( n + 1 ) 0 1 r 2 j n 2 η k n T r d r 1 / 2 .
Let us now describe the calculation scheme for η k n T and a k n T in Maple. The following calculations are carried out in the loop for n = 1 , , N .
  • The expression (36) for the coefficient a k n T is calculated and written to the variable U symbol in symbolic form with an undefined eigenvalue.
    Usymbol:=(n∗(n+1)∗int(r^2∗eval(j[n],z=sqrt(eta_)∗r)^2,r=0..1))^(-1/2):
  • The left side of the Equation (34) is formed and its first K + 1 roots η k n T are determined numerically. The roots are first separated with a step of 1 and then refined with the required degree of accuracy.
    LPEq:=eval(j[n],z=sqrt(eta_)):
    eta_left:=1e-03:
    eta_right:=eta_left+1.:
    LPEq_left:=eval(LPEq,eta_=eta_left):
    k:=0:
    while (k<=K) do
      LPEq_right:=eval(LPEq,eta_=eta_right):
      if ((LPEq_left∗LPEq_right)<=0) then
        etaT[k,n]:=fsolve(LPEq=0,eta_=eta_left..eta_right):
        k:=k+1:
      end if:
      eta_left=eta_right:
      eta_right:=eta_left+1.:
      LPEq_left:=LPEq_right:
    end do:
  • The numeric value a k n T is calculated by substituting the numeric value η k n T found above into U symbol .
    for k from 0 to K do
      aT[k,n]:=eval(Usymbol,[eta_=eta_T[k,n]]):
    end do:
The found values of a k n T and η k n T , together with the expressions (32), determine the toroidal modes of the magnetic field.
In Figure 3, graphs of X k n T functions for n = 2 , 5 and k = 0 , , 4 are given. Again, one can clearly see the fulfillment of the boundary conditions and the coincidence of the number of zero values of these functions on the interval ( 0 ; 1 ) with the value of the index k.
The poloidal solutions of the spectral problem (6) for a magnetic field have the form
B k n m P = rot rot X k n P ( r ) Y n m ( θ , φ ) r = n ( n + 1 ) X k , n P ( r ) r Y n m ( θ , φ ) e r + + d X k n P ( r ) d r + X k n P ( r ) r e θ θ + 1 sin θ e φ φ Y n m ( θ , φ ) , X k n P ( r ) = a k n P j n η k n P r + b k n P y n η k n P r , k = 0 , 1 , 2 , ,       n = 1 , 2 , 3 , ,       m = n , , n ,
where eigenvalues η k n P > 0 .
The boundary condition B ( r = 0 ) < from (4), as in the case of the toroidal modes, requires b k n P = 0 .
For r = 1 , a continuous transition of the B k n m P modes to the external field B n m o u t modes
B n m o u t = rot rot r n 1 n Y n m ( θ , φ ) r
is needed. To do this, the components of the corresponding modes must be proportional. From this proportionality, it is easy to obtain the boundary condition
d X k n P d r | r = 1 + n + 1 X k n P ( 1 ) = 0 ,
and then the eigenvalues equation
η j n η + ( n + 1 ) j n η = 0 .
The normalization condition
n 2 ( n + 1 ) 2 0 1 X k n P ( r ) 2 d r + n ( n + 1 ) 0 1 r 2 d X k n P ( r ) d r + X k n P ( r ) r 2 d r = 1
gives the explicit expressions for the coefficients
a k n P = n 2 ( n + 1 ) 2 0 1 j n 2 η k n P r d r + + n ( n + 1 ) 0 1 r 2 j n η k n P r d r + j n η k n P r r 2 d r 1 / 2 .
Let us describe the calculation scheme for η k n P and a k n P in Maple. The following calculations are performed in the loop for n = 1 , , N :
  • The expression (41) for the coefficient a k n P is calculated and written to the variable U symbol in symbolic form with undefined eigenvalues.
    Usymbol:=(n^2∗(n+1)^2∗int(eval(j[n],z=sqrt(eta_)∗r)^2,r=0..1)+
             n∗(n+1)∗int(r^2∗(diff(eval(j[n],z=sqrt(eta_)),r)+
             eval(j[n],z=sqrt(eta_))/r)^2,r=0..1))^(-1/2):
  • The left part of the Equation (39) is formed and its first K + 1 roots η k n P are determined numerically. The roots are first separated with a step of 1 and then refined with the required degree of accuracy.
     LPEq:=sqrt(eta_)∗eval(diff(j[n],z),z=sqrt(eta_))+
           (n+1)∗eval(j[n],z=sqrt(eta_)):
     eta_left:=1e-03:
     eta_right:=eta_left+1.:
     LPEq_left:=eval(LPEq,eta_=eta_left):
     k:=0:
     while (k<=K) do
       LPEq_right:=eval(LPEq,eta_=eta_right):
       if ((LPEq_left∗LPEq_right)<=0) then
         etaP[k,n]:=fsolve(LPEq=0,eta_=eta_left..eta_right):
         k:=k+1:
       end if:
       eta_left=eta_right:
       eta_right:=eta_left+1.:
       LPEq_left:=LPEq_right:
     end do:
  • The numeric value a k n P is calculated by substituting into U symbol the numeric value η k n P found above.
    for k from 0 to K do
      aP[k,n]:=eval(Usymbol,[eta_=eta_P[k,n]]):
    end do:
The found values of a k n P and η k n P , together with the expressions (37), define the poloidal magnetic modes.
In Figure 4, graphs of the X k n P functions for n = 1 , 3 and k = 0 , , 4 on the segment [ 0 , 1 ] are shown. They are extended to r > 1 by the external field modes’ radial functions B n m out . It is clearly seen from the figure that the boundary conditions (38) ensure the differentiability of this continuation. Then the transition of the magnetic field itself will be continuous. As for the other modes, the number of zero values of these functions on the interval ( 0 ; 1 ) coincides with the value of the index k.

4.3. Temperature Modes

The solution of the spectral problem (4,6) for temperature is given by the following family of eigenmodes
T k n m = Z k n ( r ) Y n m ( θ , φ ) , Z k n ( r ) = a k n j n λ k n r + b k n y n λ k n r , k = 0 , 1 , 2 , ,       n = 0 , 2 , 3 , ,       m = n , , n ,
where eigenvalues λ k n > 0 . This general solution structure follows from the general solution form for the problem of a sphere free of oscillations [50].
Note that, the index n for the temperature modes can also be zero, in contrast to the velocity and magnetic field modes.
The coefficients a k n and b k n must provide the normalization condition
r i 1 r 2 Z k n T ( r ) 2 d r = 1 ,
and boundary conditions
X k n ( r i ) = X k n ( 1 ) = 0 .
The Equalities (43) and (44) ensure that the T k n m modes are normalized with respect to the scalar product · , · T and that the boundary conditions (4) are satisfied.
The eigenvalues of λ k n are solutions to the equation
j n λ r i y n λ j n λ y n λ r i = 0 .
In form, this equation coincides with the Equation (21). Therefore, λ k n = μ k n T for n 1 . Comparison of (43) and (19) also shows that a k n = n ( n + 1 ) A k n T and b k n = n ( n + 1 ) B k n T . Therefore, coefficients of the function Z k n ( r ) and eigenvalues can be determined from (43) and (45) only for n = 0 . However, in order to systematize the computational scheme, it is advisable to find them separately using the Maple tools, without reducing them to the parameters of toroidal velocity modes. Let us carry out the following calculations in Maple:
  • The normalization expression (43) is calculated and written to the variable U symbol in symbolic form with undefined values of the coefficients, eigenvalues, and the integration limit r i .
    assume(r_i>0):
    Z_:=a_∗eval(j[n],z=sqrt(lambda_)∗r)+b_∗eval(y[n],z=sqrt(lambda_)∗r):
    Usymbol:=int(r^2∗Z_^2,r=r_i..1):
  • The left part of the Equation (45) is formed and its first K + 1 roots λ k n are determined numerically. The roots are first separated with a step of 1 and then refined with the required degree of accuracy.
    LPEq:=eval(j[n],z=sqrt(lambda_)∗.35)∗eval(y[n],z=sqrt(lambda_))-
                eval(j[n],z=sqrt(lambda_))∗eval(y[n],z=sqrt(lambda_)∗.35):
    lambda_left:=1e-03:
    lambda_right:=lambda_left+1.:
    LPEq_left:=eval(LPEq,lambda_=lambda_left):
    k:=0:
    while (k<=K) do
      LPEq_right:=eval(LPEq,lambda_=lambda_right):
      if ((LPEq_left∗LPEq_right)<=0) then
        lambda[k,n]:=fsolve(LPEq=0,lambda_=lambda_left..lambda_right):
        k:=k+1:
      end if:
      lambda_left=lambda_right:
      lambda_right:=lambda_left+1.:
      LPEq_left:=LPEq_right:
    end do:
  • Assignments are made:
    a k n : = y n λ k n , b k n : = j n λ k n .
    Such values of the coefficients will ensure the fulfillment of the boundary conditions.
    for k from 0 to K do
      a[k,n]:=eval(y[n],z=sqrt(lambda[k,n])):
      b[k,n]:=-eval(j[n],z=sqrt(lambda[k,n])):
    end do:
  • The numeric value U number is calculated by substituting the numeric values a k n , b k n , λ k n into U symbol and r i . Then, renormalization is performed using assignments:
    a k n : = a k n / U number , b k n : = b k n / U number .
    for k from 0 to K do
      Unumber:=eval(Usymbol,
                    [a_=a[k,n],b_=b[k,n],lambda_=lambda[k,n],r_i=.35]):
      a[k,n]:=a[k,n]/sqrt(Unumber):
      b[k,n]:=b[k,n]/sqrt(Unumber):
    end do:
The calculations from points (1)–(4) must be performed in a loop for n = 0 , , N .
The found values a k n , b k n , λ k n , together with the expressions (42), determine the basic toroidal velocity modes.
In Figure 5, graphs of Z k n ( r ) functions for n = 0 , 8 and k = 0 , , 4 are given. One can see the fulfillment of the boundary conditions and the coincidence of the number of zero values with the index k.

5. Calculation of the Spectral Model Coefficients

When compiling a spectral model (8), the main computational problem is to calculate the coefficients (9). These coefficients are volume integrals of multiplicative combinations of basic modes and differential operators of vector analysis operators in spherical coordinates. The expressions for the modes themselves are composed of spherical harmonics, spherical Bessel functions, and the curl operator (for vector modes). It is clear that very complex expressions will be obtained as a result. It is very difficult to obtain them using manual formula transformations. In addition, it will be difficult to avoid mistakes when writing integrands in the program code. There is actually only one way out—to automate the calculation of integrands. Obviously, there is simply no alternative to using CAS to compose models like (8).
Here, it is also necessary to take into account that, after selecting a finite set of modes and compiling the model, it may turn out that it does not describe all the necessary processes and interactions that exist in the dynamo system. For example, if all E l i coefficients are equal to zero, then the model (8) does not take into account shell rotation. If all coefficients W p i j are equal to zero, then no field generation occurs. In such cases, it will be necessary to change modes and recalculate the coefficients.
Let us now describe the technology for calculating the coefficients of the model using the VectorCalculus package of the Maple system.
First of all, it is necessary to list the set of commands and functions of the Maple system that will be required for the calculations:
  • SetCoordinates(’spherical’[r,theta,phi])—setting spherical coordinates ( r , θ , φ ) .
  • VectorField(<expr1,expr2,expr3>)—vector field constructor with expr1, expr2, expr3 components in a local spherical basis as an object of class VectorField. These components must depend on the coordinates ( r , θ , φ ) .
  • DotProduct(F,P)—calculation of the dot product of two objects of class VectorField.
  • CrossProduct(F,P)—calculation of the two objects of class VectorField cross product.
  • Divergence(F)—calculation of the VectorField class object divergence.
  • Curl(F)—calculation of the VectorField class object curl.
  • Gradient(expr)—calculation of the gradient of the scalar field, which is determined by the expression expr.
The velocity modes v k n m T and v k n m P are determined by the triples of indices ( k , n , m ) and the type (toroidal or poloidal), so the velocity modes’ indices l in the decompositions (5) are multi-indices: l ( k l , n l , m l , t y p e l ) , where t y p e l = 0 for toroidal modes and t y p e l = 1 for poloidal modes. These multi-indices can be defined in Maple using a one-dimensional array of four-element lists indV. For example, if in the decompositions (5) v 3 = v 2 , 4 , 7 T , then the Maple code will be indV[3]: =[2,4,7,0]. Then, for example, the type value of the (toroidal) mode v 2 , 4 , 7 T will be indV[3][4], and its first index value will be indV[3][1].
The situation is completely similar with the B p magnetic modes in (5) expansions.They can be identified using a one-dimensional array of four-element lists indB. This array is organized in the same way as indV.
To identify the temperature modes T s , a one-dimensional array of three-element lists indT is used. Here, there are only three elements in each list, since it is not necessary to specify the mode type, only the indices ( k s , n s , m s )
Let K, N and M be the maximum values of the first three elements in the multi-indices. Let us assume that the program has already calculated or read from the files the elements of the array ( k = 0 , , K , n = 0 , , N , m = 0 , , M ):
expressions j[n] and y[n] for spherical Bessel functions j n ( z ) and y n ( z ) and expressions P[n,m] for associated Legendre functions P n m ( cos θ ) ;
muT[k,n], AT[k,n], BT[k,n] eigenvalues μ k n T and coefficients A k n T and B k n T toroidal velocity modes;
muP[k,n], C1[k,n], … ,C4[k,n] eigenvalues μ k n P and coefficients C k n 1 , , C k n 4 poloidal velocity modes;
etaT[k,n], aT[k,n] eigenvalues η k n T and coefficients a k n T of toroidal magnetic modes;
etaP[k,n], aP[k,n] eigenvalues η k n P and coefficients a k n P of poloidal magnetic modes;
lambda[k,n], a[k,n], b[k,n] eigenvalues λ k n and coefficients a k n and b k n temperature modes.
The associated Legendre functions P n | m | ( cos θ ) must be normalized so that the spherical harmonics
Y n m θ , φ = P n m ( cos θ ) cos ( m φ ) , if m 0 ; P n m ( cos θ ) sin ( m φ ) , if m > 0
are normalized on the sphere in the sense of equality (15).
The spherical harmonics are a complete orthogonal system of functions on the sphere. Therefore, they are included in the expressions for all basic modes. However, in Maple code, it is convenient to define an array of expressions for the associated Legendre functions. Then, instead of a separate array of expressions for spherical harmonics, one can use the right-hand sides of (48).
Assume that the multi-index arrays indV, indT, indB are filled. These arrays define a set of basis modes (5).
Next, arrays of expressions for modes are compiled, but a specific type of dependence on the r variable is not specified yet. To calculate the Galerkin coefficients, it is also convenient to compose an array of curls of the velocity and magnetic field modes.
The corresponding Maple code would be like this.
As a result of executing the code shown in Listing 1, expressions will be formed for the expression arrays for the basic modes, where the dependence on the angular variables will be explicitly specified. However, explicit expressions for the radial functions have not yet been given. Instead, there will be abstract R_[l](r), X_[p](r), Z_[s](r).
Listing 1. Modes expressions calculations.
#
with(VectorCalculus):
SetCoordinates(’spherical’[r,theta,phi]):
#----velocity_modes-----------------------
V:=array(1..Lmax,[]):
rotV:=array(1..Lmax,[]):
for l from 1 to Lmax do
  n:=indV[l][2]: m:=indV[l][3]:
  if (m<=0)then
    func_phi:=cos(-m∗phi):
  else
    func_phi:=sin(m∗phi):
  end if:
  V[l]:=simplify(
        Curl(R_[l](r)∗P[n,abs(m)]∗func_phi∗VectorField(<r,0,0>))):
  if (indV[l][4]=1) then
    V[l]:=simplify(Curl(V[l])):
  end if:
  rotV[l]:=simplify(Curl(V[l])):
end do:
#----magnetic_modes-----------------------
B[p]:=array(1..Pmax,[]):
rotB:=array(1..Pmax,[]):
for p from 1 to Pmax do
  n:=indB[p][2]: m:=indB[p][3]:
  if (m<=0)then
    func_phi:=cos(-m∗phi):
  else
    func_phi:=sin(m∗phi):
  end if:
  B[p]:=simplify(
        Curl(X_[p](r)∗P[n,abs(m)]∗func_phi∗VectorField(<r,0,0>))):
  if (indB[p][4]=1) then
    B[p]:=simplify(Curl(B[p])):
  end if:
  rotB[p]:=simplify(Curl(B[p])):
end do:
#----thermal_modes-----------------------
T[s]:=array(1..Smax,[]):
for s from 1 to Smax do
  n:=indT[s][2]: m:=indT[s][3]:
  if (m<=0)then
    func_phi:=cos(-m∗phi):
  else
    func_phi:=sin(m∗phi):
  end if:
  T[s]:=simplify(Z_[s](r)∗P[n,abs(m)]∗func_phi):
end do:
Let us consider such an example. Let v 5 = v 1 , 4 , 3 P ; then the element indV[5] of the multi-indexes array will be equal to [1,4,−3,1]. After executing the Listing 1 code, the element V[5] of the velocity modes array will be equal to the expression shown in Figure 6. The structure of (26) is clearly visible in the expression in this Figure.
The explicit expressions for the radial functions in the arrays of modes are not specified for the following reason: First, analytical integration over the angular variables φ and θ is carried out when calculating the coefficients (9).
First of all, integration over φ is performed. For this, specific expressions for the radial functions are not needed. CAS only needs to know that these are some functions of the r argument. If the integration result is zero, no further integration is necessary. If it is non-zero, then analytic integration over the variable θ is performed. And, only if this integral is also different from zero, the expression of radial functions is substituted into it and numerical integration over r is performed. Expressions for the radial functions contain parameters that were previously determined numerically. In such a situation, analytic integration over r is no longer appropriate. This is the basic scheme for calculating all the coefficients. Note that, the experience of constructing models shows that the equality of the Galerkin coefficient to zero is usually revealed precisely when integrating over a sphere.
Now let us define explicit expressions for all the radial functions for use in future substitutions.
Further, it is already possible to calculate the coefficients (9) of the spectral model. It is assumed that r i = 0.35 .
Now, consider the Maple code for calculating the B l i j coefficients based on symmetrical definitions (11):
Here, the outer loops go through indexes i and j because this allows only once to evaluate the expression v i × rot v j + v j × rot v i and store it in a temporary variable. Then, in the cycle over the index l, the integrand for B l i j is compiled and is integrated successively over φ , θ , and r. In this case, the scheme of gradual substitution of dependence on r, described above, is used.
All the other coefficients, except for Q l i j , are determined using similar calculations based on (9) definitions. The corresponding codes are given in Appendix B. The coefficients Q l i j , symmetric in i and j, are easily computed from W p i j using the equalities (13).
It was already mentioned in the introduction that, in order to distinguish chains of interacting modes, it is important to know whether one or another coefficient of the model is exactly zero or not. This is important physical information. If the equality to zero is established at the stage of analytical integration, then everything is clear. But it is also possible that the integration over r should give this zero value. In numerical integration, you will never get an exactly zero result.
Floating-point computations in CAS are implemented using the software environment. This makes them slow, but makes it easy to control computation accuracy. For example, in Maple, the value of the Digits environment variable is responsible for this, and is easily changed (the default is 10). If some coefficient is actually zero, then its value will be a small value, the order of which is related to the value of Digits. Therefore, recalculating the coefficients with different accuracy, it is easy to single out the zero ones.

6. Example of a Spectral Model Construction

In the authors’ work [25], a spectral geodynamo model based on the hypothesis of a 6-cell large-scale convection in the Earth’s core was studied. Let us show how the proposed approaches make it possible to calculate the coefficients of the model. The physical substantiation of the 6-cell convection hypothesis, the selection rule for fundamental modes, and the results of numerical simulation will not be discussed here. The purpose of our present work is to describe the computational technology for compiling models with any given set of modes. Therefore, only the calculation of the mode parameters and coefficients of the model is of interest.
First of all, let us list the modes that are used in the model [25], using the notation of our paper. The list of modes is given in Table 1.
The poloidal velocity modes v 0 , 4 , ± 2 P and the temperature modes T 0 , 4 , ± 2 and T 1 , 0 , 0 describe the 6-cell convection. The toroidal velocity modes v 0.4 , ± 2 P and v 0.4 , ± 2 P simulate the Coriolis drift of the poloidal modes. The magnetic modes B 0 , 1 , 0 P and B 1 , 1 , 0 P describe the main geomagnetic dipole. The rest of the magnetic modes are needed to transfer the convection energy to the main dipole. This is the minimum mode set that generates a dipole in the 6-cell convection [25].
The eigenvalues and coefficients of the radial functions for the index values k = 0 , , 8 and n = 0 , , 8 were calculated using the approaches from Section 1. The calculation results are presented in the files (attached in the Supplementary Materials):
function R k n T ( r ) – file “RT.txt”;
function R k n P ( r ) – file “RP.txt”;
function X k n T ( r ) – file “XT.txt”;
function X k n P ( r ) – file “XP.txt”;
function Z k n ( r ) – file “Z.txt”;
Only the eigenvalues of the modes used in the model are given here. They are presented in Table 2.
It can be seen that some eigenvalues coincide. The reason is that eigenmodes that differ only in the order m value of the spherical harmonics have the same eigenvalues. This explains the following equalities:
μ 1 = μ 2 : eigenvalues for v 0 , 5 , 2 T and v 0 , 5 , 2 T ;
μ 3 = μ 4 : eigenvalues for v 0 , 4 , 2 P and v 0 , 4 , 2 P ;
μ 5 = μ 6 : eigenvalues for v 1 , 3 , 2 T and v 1 , 3 , 2 T ;
η 2 = η 3 : eigenvalues for B 0 , 3 , 2 P and B 0 , 3 , 2 P ;
η 5 = η 6 : eigenvalues for B 0 , 4 , 2 T and B 0 , 4 , 2 T ;
η 7 = η 8 : eigenvalues for B 0 , 5 , 2 P and B 0 , 5 , 2 P ;
λ 1 = λ 2 : eigenvalues for T 0 , 4 , 2 P and T 0 , 4 , 2 P .
The coincidence of the last four eigenvalues for magnetic modes in Table 2 is explained as follows: For any integer l, the following equality is true [49]:
2 l + 1 z j l ( z ) j l 1 ( z ) = z l d d z z l j l ( z ) .
From this equality it is easy to obtain that
z j l ( z ) + ( l + 1 ) j l ( z ) = z j l 1 ( z ) .
Let us now compare (50) with the eigenvalue Equations (34) and (39). It can be seen that the positive eigenvalues η k , n P and η k , n 1 T are solutions of equivalent equations. Therefore, these eigenvalues coincide. Then, it turns out that η 5 = η 6 = η 0 , 4 T = η 0 , 5 P = η 7 = η 8 .
For modes from Table 1, it is necessary to form the corresponding arrays of multi-indexes. Here is a Maple code snippet.
Lmax:=6: Pmax:=8: Smax:=3:
indV:=array(1..Lmax,[]):
indB:=array(1..Pmax,[]):
indT:=array(1..Smax,[]):
#--------velocity modes indices-----------------
indV[1]:=[0,5,-2,0];
indV[2]:=[0,5,2,0];
indV[3]:=[0,4,-2,1];
indV[4]:=[0,4,2,1];
indV[5]:=[1,3,-2,0];
indV[6]:=[1,3,2,0];
#--------magnetic modes indices-----------------
indB[1]:=[0,1,0,1];
indB[2]:=[0,3,-2,1];
indB[3]:=[0,3,2,1];
indB[4]:=[1,1,0,1];
indB[5]:=[0,4,-2,0];
indB[6]:=[0,4,2,0];
indB[7]:=[0,5,-2,1];
indB[8]:=[0,5,2,1];
#--------temperature modes indices-----------------
indT[1]:=[0,4,-2];
indT[2]:=[0,4,2];
indT[3]:=[1,0,0];
After that, arrays of expressions are calculated for the modes V[l], B[p] and T[s] with undefined radial functions R_[l](r), X_[p](r) and T_[s](r) (Listing 1). The Maple output for the velocity modes’ expressions is shown in Figure 7.
Next, the arrays of explicit expressions of the radial functions R[l], X[p] and T[s] are calculated (Listing 2). For the first three velocity modes, the expressions for the radial functions are shown in Figure 8.
Listing 2. Radial function expressions calculation.
#
#----velocity_modes_radial_functions--------------
for l from 1 to Lmax do
  k:=indV[l][1]: n:=indV[l][2]: type_:=indV[l][4]
  if (type_=1) then
    R[l]:=C1[k,n]∗eval(j[n],[z=sqrt(muP[k,n])∗r])+
          C2[k,n]∗eval(y[n],[z=sqrt(muP[k,n])∗r])+
          C3[k,n]∗r^n+C4[k,n]∗r^(-n-1):
  else
    R[l]:=AT[k,n]∗eval(j[n],[z=sqrt(muT[k,n])∗r])+
          BT[k,n]∗eval(y[n],[z=sqrt(muT[k,n])∗r]):
  end if:
end do:
#----magnetic_modes_radial_functions-------------
for p from 1 to Pmax do
  k:=indB[p][1]: n:=indB[p][2]: type_:=indB[p][4]
  if (type_=1) then
    X[p]:=aP[k,n]∗eval(j[n],[z=sqrt(etaP[k,n])∗r]):
  else
    X[p]:=aT[k,n]∗eval(j[n],[z=sqrt(etaT[k,n])∗r]):
  end if:
end do:
#----thermal_modes_radial_functions-------------
for s from 1 to Smax do
  k:=indT[s][1]: n:=indT[s][2]:
  Z[s]:=a[k,n]∗eval(j[n],[z=sqrt(lambda[k,n])∗r])+
        b[k,n]∗eval(y[n],[z=sqrt(lambda[k,n])∗r]):
end do:
Next, all the coefficients of the model can be calculated. To illustrate the symbolic computations, the values of the coefficients E 2 , 4 and E 3 , 4 after integration over the variable φ are shown in Figure 9. These are only non-zero coefficients. Next comes the integration over the variable θ . The results are shown in Figure 10. The final step in the code is substitution of the radial function expressions and integration over the radius. The final values of the coefficients are E 2 , 4 = 0.859376 and E 2 , 4 = 0.2 .
Note that, all model coefficients were calculated using Maple (Listings 3 and A1–A6). Calculations W p i α were carried out at A ( r ) = 1 and A ( r ) = r , as in work [25]. All the B l i j coefficients turned out to be zero. The values of all non-zero coefficients of the model are presented in the files (attached in the Supplementary Materials):
E l i – file “E_coeff.txt”;
C l i – file “C_coeff.txt”;
Q l i j – file “Q_coeff.txt”;
F s i j – file “F_coeff.txt”;
H s i – file “H_coeff.txt”;
W s i j – file “W_coeff.txt”;
W s i j α for A ( r ) = 1 – file “Walpha_coeff_1.txt”;
W s i j α for A ( r ) = r – file “Walpha_coeff_r.txt”.
Listing 3. calculation.]Coefficients B[l,i,j] calculation.
#----------------------------------------------------------------------
r_i:=.35:
B_:=array(1..Lmax,1..Lmax,1..Lmax,[]):
for i1 from 1 to Lmax do
  for i2 from 1 to i1 do
    tmp1:=CrossProduct(V[i],rotV[j])+CrossProduct(V[j],rotV[i]):
    for l from 1 to L do
      if (l=i1 and l=i2) then
        B_[l,i1,i2]:=0:
      else
        tmp2:=DotProduct(tmp1,V[l]):
        B_[l,i1,i2]:=int(tmp2,phi=-Pi..Pi):
      end if:
      if (B_[l,i,j]<>0) then
        B_[l,i,j]:=int(sin(theta)∗B_[l,i,j],theta=0..Pi):
      end if:
      if (B_[l,i,j]<>0) then
        B_[l,i,j]:=int(r^2∗eval(B_[l,i,j],[R_[l](r)=R[l],
                  R_[i](r)=R[i],R_[j](r)=R[j]]),r=r_i..1)/2:
      end if:
      B_[l,j,i]:=B_[l,i,j]:
    end do:
  end do:
end do:

7. Conclusions

A new computational technology was developed for calculating the parameters of the basic modes in spectral geodynamo models and calculating the coefficients of these models. The technology is based on a combination of symbolic computation and numerical computation in the Maple system.
The main difficulty in studying the geodynamo using spectral models is calculation of the basic modes and the Galerkin coefficients. The proposed technology makes it easy to solve these problems in automatic mode. Algorithms and programs were developed for:
derivation of explicit analytical expressions for the modes of free decay of the fields of speed, temperature and magnetic induction;
numerical calculation of eigenvalues and parameters of eigenmodes;
derivation of explicit analytical expressions for the integrands of the Galerkin coefficients;
combined analytical and numerical calculation of the Galerkin coefficients.
In the future, it will be possible to develop the results of the work for the cases of a compressible fluid, of the cylindrical geometry of the domain, and of a free boundary. This will make it possible to generalize the results of the work to some other problems of geophysical hydrodynamics.
The proposed computational technology makes it possible to quickly and accurately construct fairly wide classes of new spectral models of geodynamo. This will make it possible to advance the study of the geodynamo mechanism.

Supplementary Materials

The following supporting information can be downloaded at: https://www.mdpi.com/article/10.3390/math11133000/s1, (1) the non-zero Galerkin coefficients files for the 6-cells geodynamo model from the Section 6: E l i – file “E_coeff.txt”; C l i – file “C_coeff.txt”; Q l i j – file “Q_coeff.txt”; F s i j – file “F_coeff.txt”; H s i – file “H_coeff.txt”; W s i j – file “W_coeff.txt”; W s i j α for A ( r ) = 1 – file “Walpha_coeff_1.txt”; W s i j α for A ( r ) = r – file “Walpha_coeff_r.txt”; (2) eigenvalues and radial functions parameters for n = 1 , , 8 and k = 0 , , 8 : R k n T ( r ) – file “RT.txt”; R k n P ( r ) – file “RP.txt”; X k n T ( r ) – file “XT.txt”; X k n P ( r ) – file “XP.txt”; Z k n ( r ) – file “Z.txt”.

Author Contributions

Conceptualization, G.V.; methodology, G.V.; software, G.V. and L.F.; validation, G.V. and L.F.; formal analysis, G.V.; investigation, G.V. and L.F.; writing—original draft preparation, G.V. and L.F.; writing—review and editing, G.V.; visualization, L.F.; supervision, G.V.; project administration, G.V.; funding acquisition, G.V. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the Russian Science Foundation grant 22-11-00064 «Modeling dynamic processes in geospheres taking into account heredity», https://rscf.ru/en/project/22-11-00064/, accessed on 5 June 2023.

Institutional Review Board Statement

Not applicable.

Informed Consent Statement

Not applicable.

Data Availability Statement

The files of calculated eigenvalues, mode parameters and Galerkin coefficients for the considered model example are given in the Supplementary Materials.

Acknowledgments

The authors are grateful to the reviewers for their helpful suggestions.

Conflicts of Interest

The authors declare no conflict of interest.

Abbreviations

The following abbreviations are used in this manuscript:
CASComputer algebra system
MHDMagnetohydrodynamics

Appendix A. Relations for Galerkin Coefficients

Appendix A.1. Coefficient for Pressure

Let us consider why the term with pressure disappears when deriving the spectral model (8). Application of the Galerkin method for the system (1) gives
p , v l v = r i r 1 p v l d V = r i r 1 p v l p v l d V = = r i r 1 p v l d V = 0 r 1 p v l d V = r 1 p v l d S = 0 .
The transition to the surface integral is made according to the divergence theorem. This integral is zero because the velocity modes are zero at the boundary.
For what follows, it is important to note that:
Remark A1.
Any inner product of the form U , q v will be equal to zero if both conditions are true:
1. 
q = 0 ;
2. 
at least one of the U or q fields contains one of the velocity modes v l as a multiplier.
The validity of this statement is established using transformations completely analogous to (A1).

Appendix A.2. Relations for Coefficients Blij

Let us prove the equality
B l i j + B l j i + B i l j + B i j l + B j i l + B j l i = 0 .
Let us introduce the scalar fields U l i j ( r ) = v i v j v l . They are integrands for the B l i j coefficients defined by the Formula (9). Let us denote the velocity components of v l in Cartesian coordinates x 1 , x 2 , x 3 by v l 1 , v l 2 , v l 3 using tensor symbolism.
Then
U l i j + U l j i = v i k v j s x k v l s + v j k v i s x k v l s , U i l j + U i j l = v l k v j s x k v i s + v j k v l s x k v i s , U j l i + U j i l = v l k v i s x k v j s + v i k v l s x k v j s .
After adding these equalities term-by-term, we obtain the following
U l i j + U l j i + U i l j + U i j l + U j l i + U j i l = v i k x k v j s v l s + v j k x k v i s v l s + v l k x k v i s v j s = = v i · v j v l + v j · v i v l + v l · v i v j ,
Now, this equality is multiplied by 1 and integrated term-by-term over the volume of the spherical shell. On the left, the sum of the coefficients B l i j over the permutations of the indices appears. And the integral of each expression of the form v l · v i v j is equal to zero. This follows from Remark A1. The required equality (A2) is obtained.
Let us derive one more equality useful for calculating the coefficients. From the Formula (9), it turns out that
B l i j + B l j i = v i v j , v l v v j v j , v l v = v i v j + v j v j , v l v .
The expressions for v i v j , in terms of the field components in spherical coordinates, are very complex. However, according to the formulas of vector calculus [49], for any two vector fields q and s , the equality
q s + s q = q s q × rot s s × rot q .
Then,
v i v j + v j v i = v i v j v i × rot v j v j × rot v i .
From Remark A1, it follows that v i v j , v l v = 0 .
It turns out that the following equality is obtained for the coefficients
B l i j + B l j i = v i × rot v j + v j × rot v i , v l v .

Appendix A.3. Relations for the Coefficients Qlij and Wpij

Let us establish a connection between the coefficients Q l i j and W p i j . By definition (9), Q l i j = rot B i × B j , v l v . Then, by the Formula (A6)
Q l i j + Q l j i = rot B i × B j + rot B j × B i , v l v = = B i B j + B j B i , v l v B i B j , v l v = 0
The inner product B i B j , v l v = 0 . This follows from Remark A1. Then,
Q l i j + Q l j i = r i r 1 B i B j v l d V + r i r 1 B j B i v l d V = = r i r 1 B i · B j v l d V r i r 1 B i v l B j d V + + r i r 1 B j · B i v l d V r i r 1 B j v l B i d V
On the right part of the last equality, the first and third integrals are zero (Remark A1). So,
Q l i j + Q l j i = r i r 1 B i v l B j d V r i r 1 B j v l B i d V .
Now, consider
W i l j + W j l i = rot v l × B j , B i v + rot v l × B i , B j v
From the formula for the curl of the vector product of fields, it follows [49]
rot v l × B j = B j v l v l B j + v l B j B j v l = = B j v l v l B j .
Then,
W i l j + W j l i = r i r 1 B j v l B i d V r i r 1 v l B j B i d V + + r i r 1 B i v l B j d V r i r 1 v l B i B j d V = = r i r 1 B j v l B i d V + r i r 1 B i v l B j d V r i r 1 v l · B i B j d V
The last integral in (A14) is zero (Remark A1).
Now, from (A11) and (A14), it is clear that
Q l i j + Q l j i + W i l j + W j l i = 0 .

Appendix A.4. Relations for the Coefficients Fsij

Find the sum of the coefficients
F s i j + F j i s = r i r 1 v i T j T s + v i T s T j d V = = r i r 1 v i T j T s d V = 0 .
The vanishing of the last integral follows from the Remark A1. Then,
F s i j = F j i s and F s i s = 0 .

Appendix B. Maple Codes for Galerkin Coefficients Calculating

Code to calculate E l i based on definitions (9) and relations E l i = E i l :
Listing A1. calculation.]Coefficients E[l,i] calculation.
#----------------------------------------------------------------------
E:=array(1..Lmax,1..Lmax,[]):
e_z:=VectorField(<cos(theta),-sin(theta),0>):
for i1 from 1 to Lmax do
  tmp1:=CrossProduct(e_z,V[i1]):
  for l from 1 to i1-1 do
    tmp2:=-2∗DotProduct(tmp1,V[l]):
    E[l,i1]:=int(tmp2,phi=-Pi..Pi):
    if (E[l,i1]<>0) then
      E[l,i1]:=int(sin(theta)∗E[l,i1],theta=0..Pi):
    end if:
    if (E[l,i1]<>0) then
      E[l,i1]:=int(r^2∗eval(E[l,i1],[R_[l](r)=R[l],
                  R_[i1](r)=R[i1]]),r=r_i..1):
    end if:
    E[i1,l]:=-E[l,i1]:
  end do:
  E[i1,i1]:=0:
end do:
to calculate C l i based on definitions (9):
Listing A2. calculation.]Coefficients C[l,i] calculation.
#----------------------------------------------------------------------
C:=array(1..Lmax,1..Smax,[]):
for i1 from 1 to Smax do
  tmp1:=T[i1]∗VectorField(<r,0,0>):
  for l from 1 to Lmax do
    tmp2:=DotProduct(tmp1,V[l]):
    C[l,i1]:=int(tmp2,phi=-Pi..Pi):
    if (C[l,i1]<>0) then
      C[l,i1]:=int(sin(theta)∗C[l,i1],theta=0..Pi):
    end if:
    if (C[l,i1]<>0) then
      C[l,i1]:=int(r^2∗eval(C[l,i1],[R_[l](r)=R[l],
              Z_[i1](r)=Z[i1]]),r=r_i..1):
    end if:
  end do:
end do:
Code to calculate F s i j based on definitions (9) and relations F s i j = F j i s :
Listing A3. calculation.]Coefficients F[s,i,j] calculation.
#----------------------------------------------------------------------
F:=array(1..Smax,1..Lmax,1..Smax,[]):
for i1 from 1 to Lmax do
  for i2 from 1 to Smax do
    tmp1:=DotProduct(V[i1],Gradient(T[i2])):
    for s from 1 to i2-1 do
      tmp2:=T[s]∗tmp1:
      F[s,i1,i2]:=-int(tmp2,phi=-Pi..Pi):
      if (F[s,i1,i2]<>0) then
        F[s,i1,i2]:=int(sin(theta)∗F[s,i1,i2],theta=0..Pi):
      end if:
      if (F[s,i1,i2]<>0) then
        F[s,i1,i2]:=int(r^2∗eval(F[s,i1,i2],[Z_[s](r)=Z[s],
                  R_[i1](r)=R[i1],Z_[i2](r)=Z[i2]]),r=r_i..1):
      end if:
      F[i2,i1,s]:=-F[s,i1,i2]:
    end do:
    F[i2,i1,i2]:=0:
  end do:
end do:
Code to calculate H s i based on definitions (9):
Listing A4. calculation.]Coefficients H[s,i] calculation.
#----------------------------------------------------------------------
H:=array(1..Smax,1..Lmax,[]):
for i1 from 1 to Lmax do
  tmp1:=V[i1][1]/r^2:
  for s from 1 to Smax do
    tmp2:=T[s]∗tmp1:
    H[s,i1]:=int(tmp2,phi=-Pi..Pi):
    if (H[s,i1]<>0) then
      H[s,i1]:=int(sin(theta)∗H[s,i1],theta=0..Pi):
    end if:
    if (H[s,i1]<>0) then
      H[s,i1]:=r_i/(1-r_i)∗int(r^2∗eval(H[s,i1],[Z_[s](r)=Z[s],
                               R_[i1](r)=R[i1]]),r=r_i..1):
    end if:
  end do:
end do:
Code to calculate W p i j and Q l i j based on definitions (9) and relations (13):
Listing A5. and Q[l,i,j] calculation.]Coefficients W[p,i,j] and Q[l,i,j] calculation.
#----------------------------------------------------------------------
W:=array(1..Pmax,1..Lmax,1..Pmax,[]):
for i1 from 1 to Lmax do
  for i2 from 1 to Pmax do
    tmp1:=Curl(CrossProduct(V[i1],B[i2])):
    for p from 1 to Pmax do
      tmp2:=DotProduct(tmp1,B[p]):
      W[p,i1,i2]:=int(tmp2,phi=-Pi..Pi):
      if (W[p,i1,i2]<>0) then
        W[p,i1,i2]:=int(sin(theta)∗W[p,i1,i2],theta=0..Pi):
      end if:
      if (W[p,i1,i2]<>0) then
        W[p,i1,i2]:=int(r^2∗eval(W[p,i1,i2],[X_[p](r)=X[p],
                        R_[i1](r)=R[i1],X_[i2](r)=X[i2]]),r=r_i..1):
      end if:
    end do:
  end do:
end do:
for l from 1 to L max do
  for i1 from 1 to Pmax do
    for i2 from to i1 do
      Q[l,i1,i2]:=(W[i1,l,i2]+W[i2,l,i1])/2:
      Q[l,i2,i1]:=Q[l,i1,i2]:
    end do:
  end do:
end do:
Code to calculate W p i α based on definitions (9):
Listing A6. calculation.]Coefficients Walpha[p,i] calculation.
#----------------------------------------------------------------------
funcA:=<expression for function A(r)>
Walpha:=array(1..Pmax,1..Pmax,[]):
for i1 from 1 to Pmax do
  tmp1:=Curl(A_(r)∗cos(theta)∗B[i1]):
    for p from 1 to Pmax do
      tmp2:=DotProduct(tmp1,B[p]):
      Walpha[p,i1]:=int(tmp2,phi=-Pi..Pi):
      if (Walpha[p,i1]<>0) then
        Walpha[p,i1]:=int(sin(theta)∗Walpha[p,i1],theta=0..Pi):
      end if:
      if (Walpha[p,i1]<>0) then
        Walpha[p,i1]:=int(r^2∗eval(Walpha[p,i1],[X_[p](r)=X[p],
                          X_[i1](r)=X[i1],A_(r)=funcA]),r=r_i..1):
      end if:
    end do:
  end do:
end do:

References

  1. Zeldovich, Y.B.; Rusmaikin, A.A.; Sokoloff, D.D. Magnetic Fields in Astrophysics. The Fluid Mechanics of Astrophysics and Geophysics; Gordon and Breach: New York, NY, USA, 1983. [Google Scholar]
  2. Chandrasekhar, S. Hydrodynamics and Hydromagnetic Stability; Dover Publ.: New York, NY, USA, 1981. [Google Scholar]
  3. Krause, F.; Rädler, K.-H. Mean-Filed Magnetohydrodynamics and Dynamo Theory; Academic: Berlin, Germany, 1980. [Google Scholar]
  4. Merril, R.T.; McElhinny, M.W.; McFadden, P.L. The Magnetic Field of the Earth: Paleomagnetism, the Core, and the Deep Mantle; Academic Press: London, UK, 1996. [Google Scholar]
  5. Roberts, P.H. Kinematic dynamo models. Phil. Trans. R. Soc. A 1972, 272, 663–668. [Google Scholar]
  6. Jones, C.A. Convection-driven geodynamo models. Phil. Trans. R. Soc. Lond. A 2000, 358, 873–897. [Google Scholar] [CrossRef] [Green Version]
  7. Aurnou, J.; King, E. The cross-over to magnetostrophic convection in planetary dynamo systems. Proc. R. Soc. A Math. Phys. Eng. Sci. 2017, 473, 20160731. [Google Scholar] [CrossRef] [PubMed]
  8. Aubert, J.; Gastine, T.; Fournier, A. Spherical convective dynamos in the rapidly rotating asymptotic regime. J. Fluid Mech. 2017, 813, 558–593. [Google Scholar] [CrossRef] [Green Version]
  9. Glatzmaier, G.A. Numerical simulations of stellar convective dynamos. I—The model and method. J. Comput. Phys. 1984, 55, 461–484. [Google Scholar] [CrossRef]
  10. Glatzmaier, G.A.; Roberts, P.H. A three-dimensional convective dynamo solution with rotating and finitely conducting inner core and mantle. Phys. Earth Planet. Inter. 1995, 91, 63–75. [Google Scholar] [CrossRef]
  11. Hejda, P.; Reshetnyak, M. The grid-spectra approach to 3-d geodynamo modelling. Comput. Geosci. 2000, 26, 167–175. [Google Scholar] [CrossRef]
  12. Christensen, U.R.; Aubert, J.; Cardin, P.; Dormy, E.; Gibbons, S.; Glatzmaier, G.A.; Grote, E.; Honkura, Y.; Jones, C.; Kono, M.; et al. A numerical dynamo benchmark. Phys. Earth Planet. Inter. 2001, 128, 25–34. [Google Scholar] [CrossRef]
  13. Jones, C.A. Planetary magnetic fields and fluid dynamos. Annu. Rev. Fluid Mech. 2011, 43, 583–614. [Google Scholar] [CrossRef] [Green Version]
  14. Christensen, U.R.; Wicht, J. Numerical dynamo simulations. In Core Dynamics; Olson, P., Ed.; Elsevier: Amsterdam, The Netherlands, 2015; pp. 245–282. [Google Scholar]
  15. Aubert, J. Recent geomagnetic variations and the force balance in Earth’s core. Geophys. J. Int. 2020, 221, 378–393. [Google Scholar] [CrossRef]
  16. Meduri, D.G.; Biggin, A.J.; Davies, C.J.; Bono, R.K.; Sprain, C.J.; Wicht, J. Numerical dynamo simulations reproduce paleomagnetic field behavior. Geophys. Res. Lett. 2021, 48, e2020GL090544. [Google Scholar] [CrossRef]
  17. Hardy, C.M.; Livermore, P.W.; Niesen, J. The inherent instability of axisymmetric magnetostrophic dynamo models. Geophys. Astrophys. Fluid Dyn. 2022, 116, 499–520. [Google Scholar] [CrossRef]
  18. Fletcher, C.A.J. Computational Galerkin Methods; Springer: New York, NY, USA, 1984. [Google Scholar]
  19. Fletcher, C.A.J. Computational Techniques for Fluid Dynamics; Springer: New York, NY, USA, 1988. [Google Scholar]
  20. Sokoloff, D.; Nefedov, S. A small-mode approximation in the stellar dynamo problem. Numer. Methods Program. 2007, 8, 142–149. [Google Scholar]
  21. Bonazzola, S.; Villain, L.; Bejger, M. MHD of rotating compact stars with spectral methods: Description of the algorithm and tests. Class. Quantum Gravity 2007, 24, S221. [Google Scholar] [CrossRef]
  22. Giannakis, D.; Fischer, P.F.; Rosner, R. A spectral Galerkin method for the coupled Orr-Sommerfeld and induction equations for free-surface MHD. J. Comput. Phys. 2008, 228, 1188–1233. [Google Scholar] [CrossRef] [Green Version]
  23. Vodinchar, G.M.; Kruteva, L.K. Low-moded Geodynamo Model. Comput. Technol. 2011, 16, 35–44. (In Russian) [Google Scholar]
  24. Barikbin, Z.; Ellahi, R.; Abbasbandy, S. The Ritz-Galerkin method for MHD Couette flow of non-Newtonian fluid. Int. J. Ind. Math. 2014, 6, IJIM-00504. [Google Scholar]
  25. Vodinchar, G.M.; Feshchenko, L.K. Model of Geodynamo Driven by Six-jet Convection in the Eart’s Core. Magnetohydrodynamics 2016, 52, 287–299. [Google Scholar] [CrossRef]
  26. Stefani, F.; Tretter, C. On a spectral problem in magnetohydrodynamics and its relevance for the geodynamo. GAMM-Mitteilungen 2018, e201800012. [Google Scholar] [CrossRef]
  27. Khader, M.M.; Adel, M. Implementing the spectral relaxation method for MHD Casson and Williamson model under the effects of heat generation and viscous dissipation. Math. Methods Appl. Sci. 2022, 1–15. [Google Scholar] [CrossRef]
  28. Sheremetyeva, O. Magnetic Field Dynamical Regimes in a Large-Scale Low-Mode αΩ-Dynamo Model with Hereditary α-Quenching by Field Energy. Mathematics 2023, 11, 2297. [Google Scholar] [CrossRef]
  29. Ladyzhenskaya, O.A. Mathematical Problems in the Dynamics of a Viscous Incompressible Fluid; Nauka: Moscow, Russia, 1970. (In Russian) [Google Scholar]
  30. Davenport, J.; Siret, Y.; Tournier, E. Computer Algebra; Academic: London, UK, 1988. [Google Scholar]
  31. Enns, R.H.; McGuire, G. Nonlinear Physics with Maple for Scientists and Engineers; Birkhauser: Boston, MA, USA, 1997. [Google Scholar]
  32. Ochkov, V.; Vasileva, I.; Nori, M.; Orlov, K.; Nikulchev, E. Symbolic Computation to Solving an Irrational Equation on Based Symmetric Polynomials Method. Computation 2020, 8, 40. [Google Scholar] [CrossRef]
  33. Oliveri, F. ReLie: A Reduce Program for Lie Group Analysis of Differential Equations. Symmetry 2021, 13, 1826. [Google Scholar] [CrossRef]
  34. Conceição, A.C.; Pires, J.C. Symbolic Computation Applied to Cauchy Type Singular Integrals. Math. Comput. Appl. 2022, 27, 3. [Google Scholar] [CrossRef]
  35. Pijls, H.; Quan, L.P. A Computational Method with Maple for Finding the Maximum Curvature of a Bézier-Spline Curve. Math. Comput. Appl. 2023, 28, 56. [Google Scholar] [CrossRef]
  36. Huang, B.; Niu, W.; Xie, S. Algebraic Analysis of Zero-Hopf Bifurcation in a Chua System. Symmetry 2022, 14, 1036. [Google Scholar] [CrossRef]
  37. Campo-Montalvo, E.; Fernández de Sevilla, M.; Magdalena Benedicto, J.R.; Pérez-Díaz, S. Some New Symbolic Algorithms for the Computation of Generalized Asymptotes. Symmetry 2023, 15, 69. [Google Scholar] [CrossRef]
  38. Fritzsche, S. The Ratip program for relativistic calculations of atomic transition, ionization and recombination properties. Comput. Phys. Commun. 2012, 183, 1525–1559. [Google Scholar] [CrossRef]
  39. Zhang, X.; Gerdt, V.P.; Blinkov, Y.A. Algebraic Construction of a Strongly Consistent, Permutationally Symmetric and Conservative Difference Scheme for 3D Steady Stokes Flow. Symmetry 2019, 11, 269. [Google Scholar] [CrossRef] [Green Version]
  40. Kaplan, M.; Akbulut, A.; Alqahtani, R.T. New Solitary Wave Patterns of the Fokas System in Fiber Optics. Mathematics 2023, 11, 1810. [Google Scholar] [CrossRef]
  41. Sytnyk, D.; Melnik, R. Mathematical Models with Nonlocal Initial Conditions: An Exemplification from Quantum Mechanics. Math. Comput. Appl. 2021, 26, 73. [Google Scholar] [CrossRef]
  42. Fritzsche, S. Symbolic Evaluation of Expressions from Racah’s Algebra. Symmetry 2021, 13, 1558. [Google Scholar] [CrossRef]
  43. Gayoso Martínez, V.; Hernández Encinas, L.; Martín Muñoz, A.; Queiruga-Dios, A. Using Free Mathematical Software in Engineering Classes. Axioms 2021, 10, 253. [Google Scholar] [CrossRef]
  44. Conceição, A.C. Dynamic and Interactive Tools to Support Teaching and Learning. Math. Comput. Appl. 2022, 27, 1. [Google Scholar] [CrossRef]
  45. Vodinchar, G.; Shevtsov, B. Low dimensional model of convection in a rotating spherical layer of a viscous liquid. Comput. Technol. 2009, 14, 3–15. (In Russian) [Google Scholar]
  46. Vodinchar, G. Hereditary Oscillator Associated with the Model of a Large-Scale αΩ-Dynamo. Mathematics 2020, 8, 2065. [Google Scholar] [CrossRef]
  47. Vodinchar, G.M.; Feshchenko, L.K. Fractal Properties of the Magnetic Polarity Scale in the Stochastic Hereditary αω-Dynamo Model. Fractal Fract. 2022, 6, 328. [Google Scholar] [CrossRef]
  48. Vodinchar, G.M.; Feshchenko, L.K. Computer algebra application for the developed of the spectral models of kinematic axisymmetric dynamo. Comput. Technol. 2023, 28, 4–18. (In Russian) [Google Scholar] [CrossRef]
  49. Korn, G.; Korn, T. Mathematical Handbook for Scientists and Engineers: Definitions, Theorems, and Formulas for Reference and Review; McGraw W-Hill Book Company: New York, NY, USA, 1968. [Google Scholar]
  50. Tikhonov, A.N.; Samarskii, A.A. Equations of Mathematical Physics; Pergamon Press: Oxford, UK, 1963. [Google Scholar]
Figure 1. Functions R k n T ( r ) graphs: (a) n = 2 ; (b) n = 5 .
Figure 1. Functions R k n T ( r ) graphs: (a) n = 2 ; (b) n = 5 .
Mathematics 11 03000 g001
Figure 2. Functions R k n P ( r ) graphs: (a) n = 1 ; (b) n = 4 .
Figure 2. Functions R k n P ( r ) graphs: (a) n = 1 ; (b) n = 4 .
Mathematics 11 03000 g002
Figure 3. Functions X k n T ( r ) graphs: (a) n = 2 ; (b) n = 5 .
Figure 3. Functions X k n T ( r ) graphs: (a) n = 2 ; (b) n = 5 .
Mathematics 11 03000 g003
Figure 4. Graphs of functions X k n P ( r ) for r 1 and their extensions X k n P ( 1 ) r n 1 for r > 1 : (a) n = 1 ; (b) n = 3 .
Figure 4. Graphs of functions X k n P ( r ) for r 1 and their extensions X k n P ( 1 ) r n 1 for r > 1 : (a) n = 1 ; (b) n = 3 .
Mathematics 11 03000 g004
Figure 5. Functions Z k n ( r ) graphs: (a) n = 0 ; (b) n = 8 .
Figure 5. Functions Z k n ( r ) graphs: (a) n = 0 ; (b) n = 8 .
Mathematics 11 03000 g005
Figure 6. Maple output: The value of element V[5] of the velocity modes array after executing the Listing 1 code in the case indV[5]=[1,4,−3,1].
Figure 6. Maple output: The value of element V[5] of the velocity modes array after executing the Listing 1 code in the case indV[5]=[1,4,−3,1].
Mathematics 11 03000 g006
Figure 7. Maple output: The expressions for the velocity modes with undefined radial functions.
Figure 7. Maple output: The expressions for the velocity modes with undefined radial functions.
Mathematics 11 03000 g007
Figure 8. Maple output: The expressions for the first three velocity modes radial functions.
Figure 8. Maple output: The expressions for the first three velocity modes radial functions.
Mathematics 11 03000 g008
Figure 9. Maple output: The expressions for coefficients E 2 , 4 and E 3 , 4 after integration over the variable φ .
Figure 9. Maple output: The expressions for coefficients E 2 , 4 and E 3 , 4 after integration over the variable φ .
Mathematics 11 03000 g009
Figure 10. Maple output: The expressions for coefficients E 2 , 4 and E 3 , 4 after integration over the variables φ and θ .
Figure 10. Maple output: The expressions for coefficients E 2 , 4 and E 3 , 4 after integration over the variables φ and θ .
Mathematics 11 03000 g010
Table 1. List of basic modes.
Table 1. List of basic modes.
Index iVelocity Modes v i Magnetic Modes B i Temperature Modes  T i
1 v 0 , 5 , 2 T B 0 , 1 , 0 P T 1 = T 0 , 4 , 2
2 v 0 , 5 , 2 T B 0 , 3 , 2 P T 2 = T 0 , 4 , 2
3 v 0 , 4 , 2 P B 0 , 3 , 2 P T 3 = T 1 , 0 , 0
4 v 0 , 4 , 2 P B 1 , 1 , 0 P
5 v 1 , 3 , 2 T B 0 , 4 , 2 T
6 v 1 , 3 , 2 T B 0 , 4 , 2 T
7 B 0 , 5 , 2 P
8 B 0 , 5 , 2 P
Table 2. Modes eigenvalues.
Table 2. Modes eigenvalues.
Index i μ i η i λ i
187.9001996170961189679.869604401089358618867.86985576121043418
287.90019961709611896733.2174619142683688667.86985576121043418
3100.1543957998650338333.2174619142683688693.440041667118188107
4100.1543957998650338339.478417604357434475
5125.9759007786909482466.954311925104805326
6125.9759007786909482466.954311925104805326
766.954311925104805326
866.954311925104805326
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Vodinchar, G.; Feshchenko, L. Computational Technology for the Basis and Coefficients of Geodynamo Spectral Models in the Maple System. Mathematics 2023, 11, 3000. https://doi.org/10.3390/math11133000

AMA Style

Vodinchar G, Feshchenko L. Computational Technology for the Basis and Coefficients of Geodynamo Spectral Models in the Maple System. Mathematics. 2023; 11(13):3000. https://doi.org/10.3390/math11133000

Chicago/Turabian Style

Vodinchar, Gleb, and Liubov Feshchenko. 2023. "Computational Technology for the Basis and Coefficients of Geodynamo Spectral Models in the Maple System" Mathematics 11, no. 13: 3000. https://doi.org/10.3390/math11133000

APA Style

Vodinchar, G., & Feshchenko, L. (2023). Computational Technology for the Basis and Coefficients of Geodynamo Spectral Models in the Maple System. Mathematics, 11(13), 3000. https://doi.org/10.3390/math11133000

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop