SMILE
v2.5
Schwarzschild Modelling Interactive expLoratory Environment
|
Tool: check accuracy of approximation of an N-body snapshot by a potential expansion. More...
#include <fstream>
#include "configfile.h"
#include "iosnapshot.h"
#include "managepotential.h"
#include "massmodelaxi.h"
#include "schwarzschild.h"
#include "utils.h"
Functions | |
int | main (int nparam, char **param) |
Tool: check accuracy of approximation of an N-body snapshot by a potential expansion.
This program checks the accuracy of potential approximation constructed from an N-body snapshot or from an analytic density profile, using one of the potential expansions available in SMILE (BSE, Spline, CylSpline, etc.) It doesn't compare potential or forces, but instead focuses on density (as this quantity is more sensitive to systematic biases if the potential parameters are chosen inappropriately). It creates a spatial grid, similar to the one used in Schwarzschild models, and computes the mass in each grid cell twice: from the smooth potential expansion, and summing up point masses that fall in the given cell (in the case of initialization from an N-body snapshot), or from the original smooth density profile. In the former case, the numbers are not expected to agree exactly, but the relative variation should be of order 1/sqrt{N_points_in_cell}, and that's what this program actually checks and reports as the chi^2/d.o.f. statistical measure, which should be of order unity for a good approximation. In the latter case, the Mean Integrated Square Error (MISE) is reported as the density-weighted measure of approximation error; the smaller is this number, the better.