Skip to main content

PyCRTBP

CRTBP Orbits and Utilities

version downloads license implementation pythonver

The package pycrtbp allows you to integrate orbits in the CRTBP problem.

For the science behind the model please refer to the following papers:

Acosta, D.A., Zuluaga, J.I. & Restrepo, R. (2024), A web interface for a collection of CRTBP periodic orbits, in preparation.

Download and install

pycrtbp is available at PyPI, https://pypi.org/project/pycrtbp/. To install use:

   pip install -U pycrtbp

If you prefer you may download the package directly from the
sources cloning the repo:

   git clone https://github.com/seap-udea/crtbpCorrectorIntegrator

Quick start

Import package:

import pycrtbp as py3

Create a system:

sys = p3.System(mu=0.3)

Add a particle:

sys.add(r=[1,0,0],v=[0,0.5,0])

Propagate solution:

solution,ts = sys.propagate(p=0,time=10,N=1000)

You may plot the trajectory:

plt.plot(solucion[:,0],solucion[:,1])
plt.axis('equal')

Or calculate quantities of interest:

  • Jacobi constant:

    sys.getJacobiConstant(p=0)
    
  • Position of the Lagrange equilibrium points:

    sys.getLagrangePoints()
    
  • Value of the state transition matrix:

    STM, ts = sys.getSTM(p=0,time=0.5)
    

The following code plot a Lyapunov periodic orbit around the L1 point in the Earth-Moon system:

import plotly.graph_objects as go

# Data taken from https://ssd.jpl.nasa.gov/tools/periodic_orbits.html
sys = p3.System(mu=1.215058560962404E-2)
sys.add(r=[4.3840151982551506E-1,8.1854815386736461E-23,-2.4989800229106000E-25],
        v=[2.1780773271699781E-13,1.3613843962742438E+0,-8.2105956297402337E-25])
sys.refsystem = 'barycenter'
solucion,ts = sys.propagate(time=10,p=0,N=1000)

fig = go.Figure(data=go.Scatter3d(
    x=solucion[:, 0],
    y=solucion[:, 1],
    z=solucion[:, 2],
    mode='lines',
    line=dict(color='blue', width=2),
))

fig.add_trace(go.Scatter3d(
    x=[-sys.mu, 1-sys.mu],
    y=[0, 0],
    z=[0, 0],
    mode='markers',
    marker=dict(color='red', size=[5, 1]),
))

rang = 1.5
fig.update_layout(scene=dict(
    xaxis=dict(title='X',range=[-rang,rang]),
    yaxis=dict(title='Y',range=[-rang,rang]),
    zaxis=dict(title='Z',range=[-rang,rang]),
))

fig.show()

Periodic orbit database

The package can interact with the periodic orbit database by Acosta, Zuluaga and Restrepo. To do it you must install independently mysql:

pip3 install mysql-connector-python

and install the database following the instructions we will publish.

The present version of the package does not have yet this functionality but we include it in this README to let you know of a coming feature.

What's new

For a detailed list of the newest features introduced in the latest releases pleas check What's new.


This package has been designed and written originally by Diego A. Acosta & Jorge I. Zuluaga with the scientific and techincal advise of Ricardo Restrepo (C) 2024

Release files for pycrtbp 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pycrtbp 0.1.6
File Size Uploaded
pycrtbp-0.1.6.tar.gz 10.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pycrtbp 0.1.6
File Interpreter ABI Platform
pycrtbp-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 19.6 kB

Release files / pycrtbp-0.1.6.tar.gz

Download URL pycrtbp-0.1.6.tar.gz
Size 10.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f76c218e0757d15e29d20bc225175d5e221a14518ed5ac263b167fb44d984cd4
BLAKE2b-256 checksum
How to use checksums
222ab62f7614f645ba756dcaa7464ae30fdba7b76cb83653b85bd3e6f4444bec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release files / pycrtbp-0.1.6-py3-none-any.whl

Download URL pycrtbp-0.1.6-py3-none-any.whl
Size 9.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0973b5dc8f26af0599c942e7c9a45ed5d94a3f95243c01ba41f6281d5a809a2f
BLAKE2b-256 checksum
How to use checksums
ea9cb667b049e4a4924403b8a94d006401f139e6435400d16d8a2801d0fb03d8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.12

Release history Release notifications | RSS feed

This release

0.1.6 This release

2 release files

0.1.5

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page