// falling in from infinity; small impact parameters. // gcc p.c fall.c -fnested-functions -O3 #include "h.h" int main(){assert(N==2); int j = 11; while(--j){ pt z[] = {{{{1, -sqrtl(2)},{0,(5.5-j)*2.e-6}},1e-20},{{{0,0},{0,0}},1}}; spin(z, 2.*0.4714045207910317, 1, 1000); prx("fall", z); printf("j=%d\n", j); getchar();} return 0;} /* mv2/2 = ke = - pe = 1/r ; -1/r is the potential energy v = dr/dt; m=1 (dr/dt)^2 = 2/r (dt/dr)^2 = r/2 ; reciprocal dt/dr = √(r/2) = 2^(-½)r^(½) ; square root t(r) = (2/3)r^(3/2)2^(-½) ; integrate by r t = 2^(½)3^(-1)r^(3/2) ; simplify constants t^(⅔) = 2^(⅓)3(-⅔)r ; take ⅔ power of both sides r = 2^(-⅓)3^(⅔)t^(⅔) ; solve for r (define (r t) (* (expt 2 -1/3) (expt 3 2/3) (expt t 2/3))) (define (dr/dt t) (* (expt 2 2/3) (expt 3 -1/3) (expt t -1/3))) (define (t r) (* (expt 2 1/2) (expt 3 -1) (expt r 3/2))) */ /* for dt = 0.00005*ds*df (in p.c) 1.000000032992724 1.414213656711674 0.000026870059478 0.000028500004129 for dt = 0.0001*ds*df 0.999999985306545 1.414213521730140 0.000025455843391 0.000026999998328 0.999999962196816 1.414213456003915 0.000019798988384 0.000020999996582 0.999999951591204 1.414213425735185 0.000014142134257 0.000014999996861 1.000000482640594 1.414214927588523 0.000008485289566 0.000009000018825 1.000002847578684 1.414221616548282 0.000002828443233 0.000003000037019 for dt = 0.0002*ds*df 1.000000017877259 1.414213613854030 0.000025455845050 0.000027000002139 1.000000094350792 1.414213829791800 0.000019798993618 0.000021000008609 1.000000048089514 1.414213698673623 0.000014142136987 0.000015000003134 0.999999821835685 1.414213058550118 0.000008485278352 0.000008999993054 0.999999974968357 1.414213491584231 0.000002828426984 0.000002999999675 for dt = 0.0004*ds*df 1.000000050191025 1.414213705251159 0.000025455846702 0.000027000005930 1.000000070826186 1.414213763254170 0.000019798992693 0.000021000006478 1.000000202827711 1.414214136339311 0.000014142141371 0.000015000013202 1.000000310193797 1.414214439835409 0.000008485286647 0.000009000012110 1.000003959087410 1.414224760365129 0.000002828449528 0.000003000051479 */