rodluger / Limbdark.jl

Analytical transit light curves for limb darkened stars
MIT License
14 stars 4 forks source link

Making a module, making autodiff more efficient & time-integrating light curve. #37

Closed ericagol closed 5 years ago

ericagol commented 6 years ago
rodluger commented 6 years ago

I'm mostly done coding the limbdark equations up in starry -- the Python/C++ version will have all these features. I'm still befuddled by most things in julia, so I'm not sure I can be of much help on that front.

ericagol commented 5 years ago

@rodluger I implemented time-integration in the Julia code using [Dan's technique] (https://github.com/dfm/transit/blob/master/transit/include/integrator.h#L24-L52).

To test to see if it is working, I carried out a Taylor-series expansion and integrated, finding that the second-order the difference between integration and find:

image

\overline F(t_0,\Delta t) &= \frac{1}{\Delta t}\int_{t-\frac{1}{2}\Delta t}^{t+\frac{1}{2}\Delta t} F(t) dt\\ &= F(t_0) + \tfrac{1}{24} F^{\prime\prime}(t_0) \Delta t^2 + \mathcal{O}(\Delta t^4)

I've plotted the difference between the time-integrated flux minus the flux evaluated at the central point in blue and the term F''(t_0) dt^2/24 in green, and they agree rather well!

time_integration_difference

The second-order derivative is computed with finite difference at BigFloat precision.