reverted to initial smidt normalization

This commit is contained in:
Marius Eggert 2022-12-12 11:51:56 +01:00
parent fac2fc4971
commit e9dd0f8f6d

View File

@ -144,39 +144,39 @@ void Igrf13Model::updateCoeffGH(timeval timeOfMagMeasurement) {
void Igrf13Model::schmidtNormalization() {
double kronDelta = 0;
schmidtFactors[0][0] = 1;
// for (int n = 1; n <= igrfOrder; n++) {
// if (n == 1) {
// schmidtFactors[0][n - 1] = 1;
// } else {
// schmidtFactors[0][n - 1] = schmidtFactors[0][n - 2] * (2 * n - 1) / n;
// }
//
// for (int m = 1; m <= igrfOrder; m++) {
// if (m == 1) {
// kronDelta = 1;
// } else {
// kronDelta = 0;
// }
// schmidtFactors[m][n - 1] =
// schmidtFactors[m - 1][n - 1] * sqrt((n - m + 1) * (kronDelta + 1) / (n + m));
// }
// }
for (int n = 1; n <= igrfOrder; n++) {
for (int m = 0; m <= n; m++) {
if (m > 1) {
schmidtFactors[m][n - 1] = schmidtFactors[m - 1][n - 1] * pow((n - m + 1) / (n + m), .5);
} else if (m > 0) {
schmidtFactors[m][n - 1] =
schmidtFactors[m - 1][n - 1] * pow(2 * (n - m + 1) / (n + m), .5);
} else if (n == 1) {
schmidtFactors[m][n - 1] = 1;
if (n == 1) {
schmidtFactors[0][n - 1] = 1;
} else {
schmidtFactors[0][n - 1] = schmidtFactors[0][n - 2] * (2 * n - 1) / n;
}
for (int m = 1; m <= igrfOrder; m++) {
if (m == 1) {
kronDelta = 1;
} else {
schmidtFactors[m][n - 1] = schmidtFactors[0][n - 2] * (2 * n - 1) / (n);
kronDelta = 0;
}
schmidtFactors[m][n - 1] =
schmidtFactors[m - 1][n - 1] * sqrt((n - m + 1) * (kronDelta + 1) / (n + m));
}
}
// for (int n = 1; n <= igrfOrder; n++) {
// for (int m = 0; m <= n; m++) {
// if (m > 1) {
// schmidtFactors[m][n - 1] = schmidtFactors[m - 1][n - 1] * pow((n - m + 1) / (n + m),
// .5);
// } else if (m > 0) {
// schmidtFactors[m][n - 1] =
// schmidtFactors[m - 1][n - 1] * pow(2 * (n - m + 1) / (n + m), .5);
// } else if (n == 1) {
// schmidtFactors[m][n - 1] = 1;
// } else {
// schmidtFactors[m][n - 1] = schmidtFactors[0][n - 2] * (2 * n - 1) / (n);
// }
// }
// }
for (int i = 0; i <= igrfOrder; i++) {
for (int j = 0; j <= (igrfOrder - 1); j++) {
coeffG[i][j] = schmidtFactors[i][j] * coeffG[i][j];