Solving Kepler's equation via contour integration, implemented in C++

Overview

Kepler's Goat Herd

Code for solving Kepler's equation using contour integration, following Philcox et al. (2021, arXiv). This uses a method originally proposed by Ullisch (2020) to solve the "geometric goat problem".

The C++ code contains implementations of a variety of solution methods:

  • Newton-Raphson: The quadratic Newton-Raphson root finder.
  • Danby: The quartic root finder described in Danby (1988).
  • Series: An elliptical series method, as described in Murray & Dermott.
  • Contour: A new method based on contour integration.

Given an array of mean anomalies, an eccentricity and a desired precision, the code will estimate the eccentricity using each method. The accuracy of each approach is increased until the desired precision is reached, and timing is performed using the C++ chrono package.

To compile the code using g++, simply run g++ -o kepler keplers_goat_herd.cpp -std=c++17 -ffast-math -Wall -O3. The code can be run using ./kepler. The individual functions, e.g. compute_contour can also be used outside of this script, given an input array of mean anomalies and an eccentricity.

We also provide a pure numpy version of the contour integration function in keplers_goat_herd.py. This is around 9 times slower than the C++ code. Python bindings for the C++ code can be added if these would be of use.

Authors:

You might also like...
A gdnative plugin for Godot's UWP export to add xbox live integration

GodotXbox Current instructions for setting up DLL, steps to setup project for contributing/modifying are coming soon. It should be noted that Godot's

Yet Another Ghidra Integration for IDA
Yet Another Ghidra Integration for IDA

Yagi Yet Another Ghidra Integration for IDA Overview Yagi intends to include the wonderful Ghidra decompiler into both IDA pro and IDA Free. 📦 You ca

X-CUBE-AZRTOS-F4 (Azure RTOS Software Expansion for STM32Cube) provides a full integration of Microsoft Azure RTOS in the STM32Cube environment for the STM32F4 series of microcontrollers.
X-CUBE-AZRTOS-F4 (Azure RTOS Software Expansion for STM32Cube) provides a full integration of Microsoft Azure RTOS in the STM32Cube environment for the STM32F4 series of microcontrollers.

X-CUBE-AZRTOS-F4 Azure RTOS Software Expansion for STM32Cube With Azure RTOS complementing the extensive STM32Cube ecosystem providing free developmen

Integration of Rust code with a C Kernel Module

Rust-Kernel-Mod Description Integration of Rust code with a C Kernel Module This project sets up a minimalistic Linux kernel module in C which it uses

Swift Framework for Apple Health Integration with Terra Enabling Developers LTD.

TerraSwift This library allows developers to connect to TERRA ENABLING DEVELOPERS LTD. through Swift (implemented with Swift5.0). This library uses He

Caffeecoin Core integration/staging tree

Caffeecoin Core integration/staging tree https://caffeecoin.com What is Caffeecoin? Caffeecoin is an experimental digital currency that enables instan

2D/3D Registration and system integration for image-based navigation of orthopedic robotic applications, inculding femoroplasty, osteonecrosis, etc.

Registration and System Integration Software for Orthopedic Surgical Robotic System This repository contains software programs for image-based registr

X-CUBE-AZRTOS-F7 (Azure RTOS Software Expansion for STM32Cube) provides a full integration of Microsoft Azure RTOS in the STM32Cube environment for the STM32F7 series of microcontrollers.
X-CUBE-AZRTOS-F7 (Azure RTOS Software Expansion for STM32Cube) provides a full integration of Microsoft Azure RTOS in the STM32Cube environment for the STM32F7 series of microcontrollers.

X-CUBE-AZRTOS-F7 Azure RTOS Software Expansion for STM32Cube With Azure RTOS complementing the extensive STM32Cube ecosystem providing free developmen

A basic, MQTT integration point service for the Waveshare 8 channel relay board

relayboard-control A basic, MQTT integration point service for the Waveshare 8 channel relay board. This was built specifically for our own home's rel

Comments
  • License

    License

    Hi,

    Thanks for putting your code out there! Unfortunately the repo lacks a LICENSE.md file and is thus not "open source" but "source available" and cannot be reused or remixed without your authorization. Is that intended?

    Cheers, Helge

    opened by helgee 2
  • Add version for compilers without GCC extensions

    Add version for compilers without GCC extensions

    This adds a more portable version of the C++ code:

    • Replaces the use of variable-length arrays (GCC extension) with pre-allocated vectors
    • Replaces the use of POSIX j_n function with std::cyl_bessel_j (standardized in C++17)
    • Replaces the use of M_PI (non-standard) with explicitly-defined pi constant. If C++20 is available, use the value defined in the <numbers> header
    • Use only C++ versions of C headers in imports, and explicitly bring the math functions into the namespace via using directives.

    This removes the warnings when compiled with -pedantic in gcc, and also allows compilation with MSVC on Windows. There does seem to be a very slight slowdown in the contour integration as a result of the changes, so I've put the portable version in a separate file.

    opened by ajtribick 1
Owner
Oliver Philcox
Cosmologist at Princeton and the Institute for Advanced Study
Oliver Philcox
Header-only ordinary differential equation solvers in C++20.

ODE Header-only ordinary differential equation solvers in C++20. Example: Lorenz system #include <ode/ode.hpp> using method_type = ode::explicit_met

Virtual Reality & Immersive Visualization Group at RWTH Aachen University 3 Apr 25, 2022
ToPS is an objected-oriented framework implemented using C++ that facilitates the integration of probabilistic models for sequences over a user defined alphabet

ToPS is an objected-oriented framework implemented using C++ that facilitates the integration of probabilistic models for sequences over a user defined alphabet

Andre Yoshiaki Kashiwabara 34 Aug 2, 2022
Vaccine Monitor app implemented in C with system Programming techniques.Projects implemented as part of the course Syspro K24

System_Programming_Projects Vaccine Monitor app implemented in C with system Programming techniques.Projects implemented as part of the course Syspro

Aristi_Papastavrou 10 Dec 30, 2021
Watch TV channels on your device via internet from all over the world for free. IPTV API Implemented with QT C++

IPTV Desktop Description IPTV-Desktop is GUI application made with Qt C++ using IPTV API, which was developed by iptv-org. Watch free tv channels via

Not Your Surya 4 Oct 24, 2022
It's an 90 days challenge where all important concept of DSA I will be learning and solving using C++ or Java.

#90DaysDSA It's an 90 days challenge where all important concept of DSA I will be learning and solving using C++ or Java. Day 1 & 2 -> Space and Time

Priya_pp 1 Dec 11, 2021
A model checker for the Dynamic Logic of Propositional Assignments (DL-PA) with solving and parameterized random formula generation functionalities.

A model checker for the Dynamic Logic of Propositional Assignments (DL-PA) with solving and parameterized random formula generation functionalities.

Jeffrey Yang 7 Dec 31, 2021
Raspberry Pi Pico (RP2040) and Micro-ROS (ROS 2) Integration

The Pico is an amazing microcontroller and I couldn't wait for ROS 2 support or Arduino Core, so here is my approach. Once the Arduino Core for RP2040 is out it will be easier to use micro_ros_arduino.

Darko Lukić 19 Jun 19, 2022
ESPHome integration for the Xiaomi Mijia Bedside Lamp v2.

esphome-xiaomi_bslamp2 Warning: this code is still under development This code might not yet be production-ready. At this point, it is declared beta-q

Maurice Makaay 136 Dec 27, 2022
font rendering, Zep vim emulator, microui integration

LabFont This project is an exploration of getting text into a rendeing pipeline based on @floooh's sokol. Frameworks such as Dear ImGui solve text ren

Nick Porcino 14 Sep 11, 2022
JWM is a cross-platform Java window management and OS integration library.

JWM aims to expose an interface that abstracts over window creation, input handling and OS integration

JetBrains 403 Jan 9, 2023