PINE LIBRARY

LunarSolver

668
LunarSolver Library

Implements analytical approximations from Éphéméride Lunaire Parisienne (ELP2000-82B) lunar theory (Chapront-Touzé & Chapront). Uses truncated Fourier series of the main problem in Delaunay arguments D, l, l', F.

Exported functions:
  • delta_t(t_ms) → ΔT (seconds); polynomial fit valid ~1950–2050.
  • julian_day_tt(t_ms) → JD in Terrestrial Time from UTC millisecond timestamp.
  • jde_tt_to_utc_ms(jde_tt) → Approximate UTC millisecond timestamp from JD TT.
  • elp_true_distance_km_50(jd_tt) → Geocentric distance (km); 50 largest-amplitude terms.
  • elp_new_moon_solver_50(k) → JDE TT of new moon nearest lunation number k (k=0 ≈ 2000-01-06); 50-term longitude series + Newton-Raphson iteration (convergence <0.005 days).
  • elp_full_moon_solver_50(k) → JDE TT of full moon nearest k (k=0 ≈ 2000-01-21); 50-term longitude series + nutation correction + damped iteration (convergence <0.001 days).


Accuracy (truncation-limited):
- Distance: typically ± 10 - 100 km.
- Syzygy times: typically ± few minutes.

Import:
Pine Script®


Usage examples:
Pine Script®


Coefficients: top 50 terms by amplitude from ELP main problem series (radius vector & longitude). Phase solvers use longitude terms only. Library contains no latitude series.


Disclaimer: The library was developed with assistance from Grok 4.1, always under human supervision and decision-making.

إخلاء المسؤولية

لا يُقصد بالمعلومات والمنشورات أن تكون، أو تشكل، أي نصيحة مالية أو استثمارية أو تجارية أو أنواع أخرى من النصائح أو التوصيات المقدمة أو المعتمدة من TradingView. اقرأ المزيد في شروط الاستخدام.