00001 00002 #include "stdinc.h" 00003 00004 main(int argc, char** argv) 00005 { 00006 if (argc < 3) { 00007 cerr << "usage: perturb ecc\n"; 00008 exit(1); 00009 } 00010 00011 real a = 1; 00012 real m = 1; 00013 real e = atof(argv[1]); 00014 real th = atof(argv[2]); 00015 00016 cerr << "e = " << e << " th = " << th << endl; 00017 00018 real E = -0.5*m/a; 00019 real r = a*(1-e*e)/(1+e*cos(th)); 00020 real rp = a*(1-e); 00021 real ra = a*(1+e); 00022 00023 cerr << "E = " << E << " r = " << r << endl; 00024 cerr << "rp = " << rp << " ra = " << ra << endl; 00025 00026 real j0 = M_PI/2 + asin((r/a-1)/e); 00027 real y = r - rp; 00028 00029 cerr << "j0 = " << j0 << " y = " << y << endl; 00030 00031 real coeff = -1.5*a*a/(e*sqrt(2*abs(E))); 00032 real term1 = e*e*j0; 00033 real term2 = sqrt((ra-r)*(r-rp))*(2-e*e+y/(3*a)); 00034 00035 cerr << "coeff = " << coeff << " term1 = " << term1 00036 << " term2 = " << term2 << endl; 00037 00038 cerr << "result = " << coeff * (term1 - term2) << endl; 00039 }