first
pc-1
This commit is contained in:
41
three_body_problem/__init__.py
Normal file
41
three_body_problem/__init__.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""
|
||||
三体问题求解器 - 纯Python方案
|
||||
|
||||
一个用于模拟和可视化三体问题的Python库。
|
||||
使用四阶龙格-库塔法数值求解牛顿引力下的三体运动。
|
||||
|
||||
主要组件:
|
||||
- ThreeBodySolver: 主求解器类
|
||||
- Particle: 质点类
|
||||
- RK4Integrator: 数值积分器
|
||||
- ThreeBodyVisualizer: 可视化工具
|
||||
- ThreeBodyConfig: 配置管理
|
||||
|
||||
示例用法:
|
||||
>>> from three_body_problem import ThreeBodySolver, Particle, ThreeBodyConfig
|
||||
>>> particles = ThreeBodyConfig.create_figure8_config()
|
||||
>>> solver = ThreeBodySolver(particles, dt=0.001)
|
||||
>>> solver.simulate(total_time=10.0)
|
||||
>>> from three_body_problem import ThreeBodyVisualizer
|
||||
>>> visualizer = ThreeBodyVisualizer()
|
||||
>>> visualizer.plot_trajectories(solver)
|
||||
>>> visualizer.show()
|
||||
"""
|
||||
|
||||
from .particle import Particle
|
||||
from .integrator import RK4Integrator
|
||||
from .solver import ThreeBodySolver
|
||||
from .visualizer import ThreeBodyVisualizer
|
||||
from .config import ThreeBodyConfig
|
||||
|
||||
__version__ = "1.0.0"
|
||||
__author__ = "ThreeBodyProblem Team"
|
||||
__email__ = "threebody@example.com"
|
||||
|
||||
__all__ = [
|
||||
"Particle",
|
||||
"RK4Integrator",
|
||||
"ThreeBodySolver",
|
||||
"ThreeBodyVisualizer",
|
||||
"ThreeBodyConfig"
|
||||
]
|
||||
Reference in New Issue
Block a user