# Spherical Harmonics Normalization

1. Jul 16, 2009

### Dzyubak

Hello, everyone!

I'm working on parametrizing a magnetic field using spherical harmonics. The equations
Yc n,m (theta, phi) = (R/R0)^n * Pn,m(cos(theta)) * cos(m*phi)
Ys n,m (theta, phi) = (R/R0)^n * Pn,m(cos(theta)) * sin(m*phi)
where Pn,m is a Legendre polynomial where n is degree and m is order of polynomial. 0<=m<=n

Bx = R0x / C1,1 * Sum{n=0:9}(Sum{m = 0:n}(Cn,m * Yc n,m))
By = R0y / S1,1 * Sum{n=0:9}(Sum{m = 0:n}(Sn,m * Ys n,m))
Bz = R0z / C1,0 * Sum{n=0:9}(Sum{m = 0:n}(Cn,m * Yc n,m))

theta, phi, and R are defined as meshes (in Matlab). Every point in 3D space has a unique R, theta, phi combination. Theta is the azimuth angle, phi is the polar angle.

Cn,m for x and z axes, as well as Sn,m for the y axis, are three separate sets of coefficients. The problem is that they are all written as rows of numbers, not pyramids (n=0,m=0; n=1,m=0 and n=1 m=1 etc.), so I am unsure which m and n value the first coefficient has. The manual indicates that the summation starts at n=0,m=0, however, it seems strange that the 3rd term in the series (C1,1) would be normalized. I am not very familiar with spherical harmonics. Could someone suggest a reasonable explanation for how normalization is done and where the summation should start?

2. Jul 16, 2009

### Fenn

Last edited by a moderator: Apr 24, 2017
3. Jul 16, 2009