SMILE  v2.5
Schwarzschild Modelling Interactive expLoratory Environment
Functions
testaccuracy.cpp File Reference

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"
Include dependency graph for testaccuracy.cpp:

Functions

int main (int nparam, char **param)
 

Detailed Description

Tool: check accuracy of approximation of an N-body snapshot by a potential expansion.

Author
EV
Date
2014-2015

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.