An algorithm to compute the coefficients of a function development in a spherical harmonics convergent series
This program computes the coefficients of a function development in a spherical harmonics convergent series, by using a standard mathematical algorithm.
When running the program, you have simply to input the generic shape of the equation and the values of m and l and the coefficients will be calculated.
Some program features:
- Can calculate coefficients for any generic function, entered by the user during the program running.
- coefficients are expressed as complex numbers.
- It works well for each negative or positive value of m, with very good accuracy until m < 5. For higher m values, the accuracy gradually decrease.
NOTE: equations are displayed in green color in order to be correctly visualized in both normal and dark mode.
Output example:
The software is and will stay free, but if you want to support me with a donation it would be really appreciated!
Here the diagram structure of the repository:
SAFD-agorithm/
├── include/
│ ├── aliases.hpp
│ ├── utils.hpp
│ ├── functions.hpp
├── src/
│ ├── utils.cpp
│ ├── functions.cpp
│ ├── main.cpp
├── scripts/
│ ├── debug.sh
├── test/
│ ├── test_utils.cpp
│ ├── test_functions.cpp
├── doc/
│ ├── algorithm_explanation.md
│ ├── download_and_run.md
│ ├── CREDITS.md
│ ├── CONTRIBUTING.md
├── img/
│── README.md
│── LICENSE
│── CITATION.cff
│── .gitignore
│── .valgrindrc
│── .all-contributorsrc
│── makefile
Extra documentation is available in the doc folder:
- Download, compile and run: contains documentation about how to download, compile and run the program as well as a complete list of prerequisites.
- Algorithm explanation and physical background: contains information about the mathematical and physical explanation related to the coefficients computation and a detailed description of the used algorithm.
- Credits: contains a list of all the people who contributed to this project.
- Contributing: contains information about how to contribute to this project.
When running the program, some options are displayed:
Available options:
1. Display the single value of a f(m,l) coefficient.
2. Display all the values of f(m,l) coefficients from m to 0 and from l to 0.
3. Quit the program.
Option choice:
The first one is used to compute a single value of the coefficient for a certain m and l.
The second one is used, instead, to compute all the values of from m to 0 and from l to 0.
Third option explanation is trivial.
When one of the options has been chosen, an output like this will be displayed:
Option choice: 1
Enter the f(th,phi) equation shape (avoid backspaces):
You can enter the function shape and the values of m and l. For example:
Enter the f(th,phi) equation shape (avoid backspaces): 3*cos(th)+pow(sin(phi),5)
Enter the value of m: 2
Enter the value of l: 3
and the final result is displayed with both real and imaginary parts:
f(2,3) = 0.0546019 + -0.00160564i