<p>FYI, the usual reference relied on for the equations used in geomagnetism is:</p>
<ul>
<li>Langel, R. A. &quot;Chapter four: Main field.&quot; Geomagnetism, edited by JA Jacobs (1987).</li>
</ul>
<p>If it wasn't for lockdown I'd have copied from the book locked in my office to make sure I got it right...but until someone corrects me...</p>
<p>The Schmidt quasi/semi-normalisations for the associated Legendre polynomials are given by these recursions, in the form you'd actually use for calculations typically:</p>
<p><img src="https://latex.codecogs.com/gif.latex?S_%7B0,0%7D=1" title="S_{0,0}=1" /></p>
<p><img src="https://latex.codecogs.com/gif.latex?S_%7Bn,0%7D=S_%7Bn-1,0%7D%5Cleft&space;(&space;%5Cfrac%7B2n-1%7D%7Bn%7D&space;%5Cright&space;)" title="S_{n,0}=S_{n-1,0}\left ( \frac{2n-1}{n} \right )" /></p>
<p><img src="https://latex.codecogs.com/gif.latex?S_%7Bn,m%7D=S_%7Bn,m-1%7D&space;%5Csqrt%7B&space;%5Cfrac%7B(n-m&plus;1)(%5Cdelta_m%5E1&plus;1)%7D%7Bn&plus;m%7D&space;%7D" title="S_{n,m}=S_{n,m-1} \sqrt{ \frac{(n-m+1)(\delta_m^1+1)}{n+m} }" /></p>
<p>Note that if you use Schmidt normalisation of Legendre polynomials from a given software language to do calculations, you <em>do not</em> want to include the Condon-Shortley phase factor of <img src="https://latex.codecogs.com/gif.latex?(-1)%5E%7Bm%7D" title="(-1)^{m}" />. So check if it is included in the Legendre polynomial and/or normalisation formula.</p>
<p>Edit: Some links to open source geomagnetism compatible software for calculating Schmidt normalised associated Legendre polynomials.</p>
<p>Python: <a href="https://github.com/ancklo/ChaosMagPy/blob/72c22e67dc844a71dcb678a1e81bdcde9f0c9627/chaosmagpy/model_utils.py#L665" rel="nofollow noreferrer">ChaosMagPy</a></p>
<p>Python/Fortran-95: <a href="https://github.com/SHTOOLS/SHTOOLS/blob/master/pyshtools/legendre/legendre_functions.py" rel="nofollow noreferrer">SHTools</a></p>

CC BY-SA 4.0
2020-08-24T16:06:54.310Z
That exactly what I was looking for, except I couldn't find the mentioned reference anywhere on the web, so thanks for the hint. However, I really need a confirmation about the formula correctness including the derivatives too.
Ayoub
CC BY-SA 4.0
2020-08-24T16:27:20.340Z
I don't think there is a digital version of Langel (1987) anywhere online, but I just found I could view enough of the following reference through Google Books to confirm the equations:
Wertz, J. R. "Spacecraft Attitude Determination and Control", (1978).
Use the "Search inside" option and search for "Appendix H", you can see the first few pages about Schmidt normalisation.
WJB
CC BY-SA 4.0
2020-08-24T17:33:32.577Z
That was useful, thanks again! So, the factors S are used with Gauss functions to obtain Schmidt functions, where: P_Schmidt = S * P_Gauss. But, it's still a long way to go with. I would love to compute directly the P_Schmidt functions since we know that there's recursion relations for them out there.
Ayoub
CC BY-SA 4.0
2020-08-24T19:15:15.453Z
Are you actually after the final recursive formula for the Schmidt P_n^m(cos(theta)) functions themselves, or are you ultimately trying to write code to calculate these values for geomag problems? I can add links to open source code in a few languages much more easily than I can work back and type up the formula working from those codes right now!
WJB
CC BY-SA 4.0
2020-08-24T21:22:53.177Z
Exactly I'm trying to implement a code to calculate those values, any open source code is welcomed! but I can't just take the code without the formula since I need to document that.
Ayoub
CC BY-SA 4.0
2020-08-24T22:49:54.933Z
I understand, I've added links to the two clearest and most accessible examples of code.  There also a C library, Fortran-77, Python/C, and Matlab code I can dig out if those would be better.
WJB
CC BY-SA 4.0
2020-08-24T22:57:19.070Z
To work out the final recursion formula, you need to take the normalisation formula above, combine them with the unnormalised Legendre recursion formula, and cancel them down. There's a special case for the first couple of terms, and for geomag use, the d.P_n^m(cos(theta))/d.theta terms needed are actually equivalent to values of P_m^{n+1}(cos(theta)).
WJB
CC BY-SA 4.0
2020-09-16T02:25:28.057Z
@WJB you might be able to shed some light on this; I've asked [How can I verify my reconstructed gravity field of Ceres from spherical harmonics?](https://space.stackexchange.com/q/27779/12102) and there might be some helpful information at [How are the coefficients in the EGM96 model normalized?](https://space.stackexchange.com/q/12617/12102) but I can't tell. I want to generate the gravitational potential for Ceres so I can propagate orbits around it (e.g. Dawn spacecraft) but I don't know how to get it from those coefficients. I want to do it myself rather than use a library.
uhoh
CC BY-SA 4.0
2020-08-24T14:51:06.747Z
2020-08-24T22:47:07.703Z
2020-08-24T22:47:07.703Z
WJB
<p>Can someone please provides me with the recursion relations of Associated Legendre Polynomials when using Schmidt quasi-normalization? I need that in the context of Geomagnetism to obtain the Spherical Harmonics coefficients g and h.</p>

CC BY-SA 4.0
2021-06-15T09:14:48.807Z
The answers here might help with this also, for future browsers: https://earthscience.stackexchange.com/q/22368/14123
WJB
<geomagnetism>
Recursion relations of Associated Legendre Polynomials with Schmidt Semi-normalization
Ayoub
# Recursion relations of Associated Legendre Polynomials with Schmidt Semi-normalization

(Asked by: username_0 on 2020-08-24)

Can someone please provides me with the recursion relations of Associated Legendre Polynomials when using Schmidt quasi-normalization? I need that in the context of Geomagnetism to obtain the Spherical Harmonics coefficients g and h.

**Tags:** geomagnetism

> **Comments:**
> **username_1**: The answers here might help with this also, for future browsers: https://earthscience.stackexchange.com/q/22368/14123  

---

## 1 answers

### Answer by username_1 on 2020-08-24. Score: 2 | Accepted answer

FYI, the usual reference relied on for the equations used in geomagnetism is:

* Langel, R. A. "Chapter four: Main field." Geomagnetism, edited by JA Jacobs (1987).

If it wasn't for lockdown I'd have copied from the book locked in my office to make sure I got it right...but until someone corrects me...

The Schmidt quasi/semi-normalisations for the associated Legendre polynomials are given by these recursions, in the form you'd actually use for calculations typically:

![](https://latex.codecogs.com/gif.latex?S_%7B0,0%7D=1 "S_{0,0}=1")

![](https://latex.codecogs.com/gif.latex?S_%7Bn,0%7D=S_%7Bn-1,0%7D%5Cleft&space;(&space;%5Cfrac%7B2n-1%7D%7Bn%7D&space;%5Cright&space;) "S_{n,0}=S_{n-1,0}\left ( \frac{2n-1}{n} \right )")

![](https://latex.codecogs.com/gif.latex?S_%7Bn,m%7D=S_%7Bn,m-1%7D&space;%5Csqrt%7B&space;%5Cfrac%7B(n-m&plus;1)(%5Cdelta_m%5E1&plus;1)%7D%7Bn&plus;m%7D&space;%7D "S_{n,m}=S_{n,m-1} \sqrt{ \frac{(n-m+1)(\delta_m^1+1)}{n+m} }")

Note that if you use Schmidt normalisation of Legendre polynomials from a given software language to do calculations, you *do not* want to include the Condon-Shortley phase factor of ![](https://latex.codecogs.com/gif.latex?(-1)%5E%7Bm%7D "(-1)^{m}"). So check if it is included in the Legendre polynomial and/or normalisation formula.

Edit: Some links to open source geomagnetism compatible software for calculating Schmidt normalised associated Legendre polynomials.

Python: [ChaosMagPy](https://github.com/ancklo/ChaosMagPy/blob/72c22e67dc844a71dcb678a1e81bdcde9f0c9627/chaosmagpy/model_utils.py#L665)

Python/Fortran-95: [SHTools](https://github.com/SHTOOLS/SHTOOLS/blob/master/pyshtools/legendre/legendre_functions.py)

> **Comments:**
> **username_0**: That exactly what I was looking for, except I couldn't find the mentioned reference anywhere on the web, so thanks for the hint. However, I really need a confirmation about the formula correctness including the derivatives too.  
> **username_1**: I don't think there is a digital version of Langel (1987) anywhere online, but I just found I could view enough of the following reference through Google Books to confirm the equations: Wertz, J. R. "Spacecraft Attitude Determination and Control", (1978). Use the "Search inside" option and search for "Appendix H", you can see the first few pages about Schmidt normalisation.  
> **username_0**: That was useful, thanks again! So, the factors S are used with Gauss functions to obtain Schmidt functions, where: P_Schmidt = S * P_Gauss. But, it's still a long way to go with. I would love to compute directly the P_Schmidt functions since we know that there's recursion relations for them out there.  
> **username_1**: Are you actually after the final recursive formula for the Schmidt P_n^m(cos(theta)) functions themselves, or are you ultimately trying to write code to calculate these values for geomag problems? I can add links to open source code in a few languages much more easily than I can work back and type up the formula working from those codes right now!  
> **username_0**: Exactly I'm trying to implement a code to calculate those values, any open source code is welcomed! but I can't just take the code without the formula since I need to document that.  
> **username_1**: I understand, I've added links to the two clearest and most accessible examples of code.  There also a C library, Fortran-77, Python/C, and Matlab code I can dig out if those would be better.  
> **username_1**: To work out the final recursion formula, you need to take the normalisation formula above, combine them with the unnormalised Legendre recursion formula, and cancel them down. There's a special case for the first couple of terms, and for geomag use, the d.P_n^m(cos(theta))/d.theta terms needed are actually equivalent to values of P_m^{n+1}(cos(theta)).  
> **username_2**: @username_1 you might be able to shed some light on this; I've asked [How can I verify my reconstructed gravity field of Ceres from spherical harmonics?](https://space.stackexchange.com/q/27779/12102) and there might be some helpful information at [How are the coefficients in the EGM96 model normalized?](https://space.stackexchange.com/q/12617/12102) but I can't tell. I want to generate the gravitational potential for Ceres so I can propagate orbits around it (e.g. Dawn spacecraft) but I don't know how to get it from those coefficients. I want to do it myself rather than use a library.  

---

