Skip to main content

e2m2e: Earth to Moon, Moon to Earth

License: Apache 2.0 Python Version PyPI CI GitHub stars Rust: 1.98.0 Docs

e2m2e 是地月空间算法工具集。

安装

用 uv 安装:

uv pip install e2m2e

从源码开发:

git clone https://github.com/cislunarspace/CODE-core.git
cd e2m2e
make dev
Windows 安装 make Windows 默认不提供 `make`。可使用 [Scoop](https://scoop.sh/) 安装;在 PowerShell 中依次执行:
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser
irm get.scoop.sh | iex
scoop install make

e2m2e 所需的全部星历数据已打包在 GitHub Release 的 kernels-v1 中,make dev 会自动下载到 kernels/;也可手动下载解压到该目录。

快速开始

设计一条地月 L2 Halo 轨道:

from e2m2e.api import Facade

facade = Facade()

result = facade.design_orbit(
    orbit_type="Halo",
    collinear_point=2,
    amplitude=30000.0,
    epoch=[2024, 1, 1, 0, 0, 0.0],
    duration=365.25 * 86400.0,
)

print(result.orbit_type)
print(result.initial_state)

功能介绍

MCP

e2m2e 为 19 个工具设计了 MCP 接口。

安装 MCP:

uv pip install "e2m2e[mcp]"

在 MCP 客户端配置中注册服务器(command 指向安装了 e2m2e 的环境里的可执行文件,多数 MCP 客户端都采用这一 mcpServers 格式):

{
  "mcpServers": {
    "e2m2e": {
      "command": "/path/to/venv/bin/e2m2e",
      "args": ["mcp-serve"],
      "cwd": "/path/to/e2m2e-repo"
    }
  }
}

配置完成后在客户端直接用自然语言驱动,例如:

设计一条 L2 南族 NRHO,近月点高度 3000 km。

时空系统

  • 坐标系转换:J2000 / ITRF93(SPICE 高精度)/ IAU 2006,GMAT 兼容的原生 ITRF,动态坐标轴 VNB / LVLH。
  • 时空联合转换:TDT+GCRS ↔ TDB+EBCRS(r2s2 后端,含相对论项)。
  • SPICE 星历与时间管理:内核加载、UTC / TDB / TAI 时间尺度、天体状态与帧旋转查询。

积分器与动力学

  • Rust 积分器内核:单步 RK(PD45 / PD78 / RK89)、Adams 多步、Störmer–Cowell 二阶积分;状态转移矩阵(STM)传播;事件检测(terminal / direction 语义)。
  • 动力学模型:CR3BP(快速设计)、星历 N 体(SPICE,精确外推)、含太阳解析摄动的 BCR4BP,以及三者之间的转换。
  • 高精度力模型:点质量与第三体引力、球谐重力场(含固体潮)、ECOM 9 系数光压、大气阻力、太阳光压、连续推力。

任务轨道设计

  • 周期轨道族:DRO、Halo、Lyapunov、Lissajous、共振轨道(RO)、DPO、Axial、三角平动点 SPO / LPO、Horseshoe。
  • 数值算法:微分修正、多重打靶、延拓;全链路 CR3BP 初猜 → 星历修正 → 高精度预报。
  • 名义轨道契约(NominalOrbit):等间距状态表,供轨道保持消费;Floquet 基、投影因子与高次插值器为可选扩展点,本仓库不预计算(见 .out-of-scope/nominal-orbit-floquet-precompute.md)。

转移轨道设计

  • 脉冲转移:Lambert 求解与 porkchop 扫描、多脉冲优化(Lawden 主矢量检验)、霍曼直接转移(HMN)。
  • 低能量转移:月球引力辅助(LGA)、WSB 太阳引力辅助弹道捕获、不变流形与庞加莱截面拼接。
  • 低推力转移:Q-law 初猜 + 打靶 / 配点。
  • 网格搜索 + 非线性规划两步法(Rust Rayon 并行)。

轨道控制

  • 三种控制律:特征点、目标点严格、目标点宽松;蒙特卡洛测定轨与推力误差仿真。
  • 角动量管理:姿态发动机联合控制。

文档

在线文档(教程 / 示例 / API 参考)见 https://cislunarspace.github.io/CODE-core/。本地构建:

uv pip install sphinx myst-parser sphinx-autoapi shibuya
make docs   # 产物在 docs/_build/html/

设计决策记录(ADR)见 docs/adr/,ADR 0043 起以中文书写,更早条目为英文历史存档。接口字段的权威描述在请求/响应模型的字段描述中,CLI --help 与 MCP schema 与之同源。

测试与代码规范

make test
make check

贡献

见 CONTRIBUTING.md

引用

@software{e2m2e,
  title = {e2m2e: Earth to Moon, Moon to Earth Transfer Orbit Design Library},
  author = {ouyangjiahong},
  email = {ouyangjiahong22@nudt.edu.cn},
  url = {https://github.com/cislunarspace/CODE-core},
  version = {5.9.4},
  year = {2026},
}

许可证

Apache 2.0

Metadata

Release files for e2m2e 5.9.7

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

Source distribution (sdist)

Source distribution for e2m2e 5.9.7
File Size Uploaded
e2m2e-5.9.7.tar.gz 6.0 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for e2m2e 5.9.7
File Interpreter ABI Platform
e2m2e-5.9.7-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details
e2m2e-5.9.7-cp310-abi3-manylinux_2_28_x86_64.whl CPython 3.10 abi3 Linux glibc 2.28+ x86-64 Details
e2m2e-5.9.7-cp310-abi3-manylinux_2_28_aarch64.whl CPython 3.10 abi3 Linux glibc 2.28+ ARM64 Details

Total release size: 30.5 MB

Release files / e2m2e-5.9.7.tar.gz

Download URL e2m2e-5.9.7.tar.gz
Size 6.0 MB
Tags Source
SHA-256 checksum
How to use checksums
61ff171ff1ed56ea5733cbea50399b7032c3d14bb2d8ef5135c1491872b9bd35
BLAKE2b-256 checksum
How to use checksums
38e959739d4e156a70b58a47c8ca4042cfa5fe0bc10a3dc1fb9b97bb6fa047b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / e2m2e-5.9.7-cp310-abi3-win_amd64.whl

Download URL e2m2e-5.9.7-cp310-abi3-win_amd64.whl
Size 8.0 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3dd332dcf47620ee209aab3f4f19c1ca1f0ba37d8747c0459593a19c98624de2
BLAKE2b-256 checksum
How to use checksums
69b1482b02f7561a30fdc921d28a8599a286828ca532c48a124dd2c5f54e75b2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / e2m2e-5.9.7-cp310-abi3-manylinux_2_28_x86_64.whl

Download URL e2m2e-5.9.7-cp310-abi3-manylinux_2_28_x86_64.whl
Size 8.3 MB
Tags CPython 3.10 Linux glibc 2.28+ x86-64 abi3
SHA-256 checksum
How to use checksums
2bedf22842221f63f4f444f5f7666f4a901962f9dffdc587ba9d5babe10ce789
BLAKE2b-256 checksum
How to use checksums
e6924b36ca47fddf90ad21fa8f36f8c2f51e5a448d94c9a66f01ebd155c9c5e9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release files / e2m2e-5.9.7-cp310-abi3-manylinux_2_28_aarch64.whl

Download URL e2m2e-5.9.7-cp310-abi3-manylinux_2_28_aarch64.whl
Size 8.2 MB
Tags CPython 3.10 Linux glibc 2.28+ ARM64 abi3
SHA-256 checksum
How to use checksums
c812dd954c90869d4c4b9325cf3bf515343c5226a0ea7aa6996f54c3ef9fee4f
BLAKE2b-256 checksum
How to use checksums
962f48aed673e38efac8851190dd44ad3b4d78aac9b825c4ce2013a50c9716fa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 26, 2026.

Transparency log

Release history Release notifications | RSS feed

5.9.11

4 release files

5.9.9

4 release files

5.9.8

4 release files

This release

5.9.7 This release

4 release files

5.9.6

4 release files

5.9.5

4 release files

5.9.4

4 release files

5.9.3

4 release files

5.9.2

4 release files

5.9.1

4 release files

5.9.0

4 release files

5.8.10

4 release files

5.8.9

4 release files

5.8.8

4 release files

5.8.7

4 release files

5.8.6

4 release files

5.8.5

4 release files

5.8.4

4 release files

5.8.3

4 release files

5.8.2

4 release files

5.8.1

4 release files

5.8.0

4 release files

5.7.3

4 release files

5.7.2

4 release files

5.7.1

4 release files

5.6.10

4 release files

5.6.9

4 release files

5.6.8

3 release files

5.6.7

3 release files

5.6.6

3 release files

5.6.5

3 release files

5.6.4

3 release files

5.6.3

3 release files

5.6.2

3 release files

5.6.1

3 release files

5.6.0

3 release files

5.5.0

3 release files

5.3.1

3 release files

5.2.0

3 release files

5.1.0

3 release files

5.0.0

2 release files

4.2.0

2 release files

4.1.0

2 release files

4.0.0

2 release files

3.1.11

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