CRTBP Integrator and Tools
Project description
PyCRTBP
CRTBP Orbits and Utilities
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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pycrtbp-0.1.6.tar.gz
.
File metadata
- Download URL: pycrtbp-0.1.6.tar.gz
- Upload date:
- Size: 10.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f76c218e0757d15e29d20bc225175d5e221a14518ed5ac263b167fb44d984cd4 |
|
MD5 | 231acff23332c9be5f4a473b61f58fd2 |
|
BLAKE2b-256 | 222ab62f7614f645ba756dcaa7464ae30fdba7b76cb83653b85bd3e6f4444bec |
File details
Details for the file pycrtbp-0.1.6-py3-none-any.whl
.
File metadata
- Download URL: pycrtbp-0.1.6-py3-none-any.whl
- Upload date:
- Size: 9.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0973b5dc8f26af0599c942e7c9a45ed5d94a3f95243c01ba41f6281d5a809a2f |
|
MD5 | 2bf4ef6fb9a1369a24f517dc843bc04c |
|
BLAKE2b-256 | ea9cb667b049e4a4924403b8a94d006401f139e6435400d16d8a2801d0fb03d8 |