HPOP High Precision Orbit Propagator
HPOP High Precision Orbit Propagator
Note: This document is AI-translated.
Overview
HPOP (High Precision Orbit Propagator) is a high-precision orbit propagation module based on numerical integration methods. It employs a modular design philosophy inspired by Simulink simulation concepts, allowing flexible configuration of force models and numerical integrators to meet various precision requirements.
Core Concepts
Modular Design
HPOP decomposes complex orbit propagation systems into functional blocks, each responsible for specific tasks:
- Force Model Blocks: Calculate various perturbation forces
- Numerical Integration Blocks: Solve differential equations
- Coordinate Transformation Blocks: Handle coordinate system conversions
Force Model Configuration
HPOP supports multiple force model configurations:
- Gravity Models: Spherical harmonics of different degrees and orders
- Atmospheric Drag: Atmospheric resistance effects
- Third-Body Gravity: Sun and Moon gravitational perturbations
- Solar Radiation Pressure: Solar radiation pressure effects
Main Interfaces
Class Interface
class HPOPKey Methods:
errc_t setForceModel(const HPOPForceModel& force_model);
errc_t setIntegrator(const std::string& integrator_type);
errc_t propagate(const TimePoint& start_time, const TimePoint& end_time, Vector3d& pos, Vector3d& vel);
errc_t initialize();Parameter Description:
force_model: Force model configuration parametersintegrator_type: Numerical integrator type (e.g., "RK4", "RK78")start_time: Propagation start timeend_time: Propagation end timepos: Input/output position vector (meters)vel: Input/output velocity vector (m/s)
Usage Examples
1. Basic HPOP Propagation
#include "AstCore/HPOP.hpp"
#include "AstCore/HPOPForceModel.hpp"
#include "AstCore/TimePoint.hpp"
#include "AstCore/RunTime.hpp"
#include "AstMath/Vector.hpp"
#include "AstUtil/Literals.hpp"
#include "AstUtil/Constants.h"
#include <iostream>
#include <iomanip>
AST_USING_NAMESPACE
using namespace _AST literals;
int main()
{
// 初始化运行时环境
aInitialize();
setlocale(LC_ALL, ".UTF-8");
std::cout << std::fixed << std::setprecision(3);
std::cout << "HPOP高精度轨道预报器 - 基本使用示例" << std::endl;
std::cout << "====================================" << std::endl;
// 创建HPOP对象
HPOP hpop;
// 配置基本力模型 (仅使用JGM3地球重力场J2项)
HPOPForceModel force_model;
force_model.gravity_.model_ = "JGM3"; // 使用JGM3重力场模型
force_model.gravity_.maxDegree_ = 2; // 阶数
force_model.gravity_.maxOrder_ = 0; // 次数
// 设置力模型
errc_t result = hpop.setForceModel(force_model);
if (result != eNoError) {
std::cout << "设置力模型失败,错误码: " << result << std::endl;
return -1;
}
// 初始化HPOP
result = hpop.initialize();
if (result != eNoError) {
std::cout << "初始化失败,错误码: " << result << std::endl;
return -1;
}
std::cout << "HPOP初始化成功" << std::endl;
std::cout << "力模型配置: " << force_model.gravity_.model_ << " (阶数="
<< force_model.gravity_.maxDegree_ << ", 次数=" << force_model.gravity_.maxOrder_ << ")" << std::endl;
std::cout << std::endl;
// 设置初始轨道状态 (近地轨道)
TimePoint start_time = TimePoint::FromUTC(2026, 1, 1, 0, 0, 0);
Vector3d position{7000_km, 0.0, 0.0};
Vector3d velocity{0.0, 7.5_km_s, 1.0_km_s};
std::cout << "初始轨道状态:" << std::endl;
std::cout << "起始时间: 2026-01-01 00:00:00 UTC" << std::endl;
std::cout << "位置: (" << position[0]/1000.0 << ", "
<< position[1]/1000.0 << ", "
<< position[2]/1000.0 << ") km" << std::endl;
std::cout << "速度: (" << velocity[0]/1000.0 << ", "
<< velocity[1]/1000.0 << ", "
<< velocity[2]/1000.0 << ") km/s" << std::endl;
std::cout << std::endl;
// 设置传播时间 (1天)
TimePoint end_time = start_time + 24 * 3600.0; // 加1天
// 执行轨道预报
result = hpop.propagate(start_time, end_time, position, velocity);
if (result == eNoError) {
std::cout << "轨道预报成功" << std::endl;
std::cout << "结束时间: 2026-01-02 00:00:00 UTC" << std::endl;
std::cout << "预报后位置: (" << position[0]/1000.0 << ", "
<< position[1]/1000.0 << ", "
<< position[2]/1000.0 << ") km" << std::endl;
std::cout << "预报后速度: (" << velocity[0]/1000.0 << ", "
<< velocity[1]/1000.0 << ", "
<< velocity[2]/1000.0 << ") km/s" << std::endl;
// 计算轨道参数
double radius = position.norm() / 1000.0; // km
double speed = velocity.norm() / 1000.0; // km/s
std::cout << std::endl;
std::cout << "轨道参数:" << std::endl;
std::cout << "轨道半径: " << radius << " km" << std::endl;
std::cout << "轨道速度: " << speed << " km/s" << std::endl;
} else {
std::cout << "轨道预报失败,错误码: " << result << std::endl;
}
return 0;
}2. Advanced Force Model Configuration
#include "AstCore/HPOP.hpp"
#include "AstCore/HPOPForceModel.hpp"
#include "AstCore/TimePoint.hpp"
#include "AstCore/RunTime.hpp"
#include "AstMath/Vector.hpp"
#include "AstUtil/Literals.hpp"
#include "AstUtil/Constants.h"
#include <iostream>
#include <iomanip>
#include <cmath>
AST_USING_NAMESPACE
using namespace _AST literals;
int main()
{
// 初始化运行时环境
aInitialize();
setlocale(LC_ALL, ".UTF-8");
std::cout << std::fixed << std::setprecision(3);
std::cout << "HPOP高精度轨道预报器 - 高级力模型配置示例" << std::endl;
std::cout << "==========================================" << std::endl;
// 创建HPOP对象
HPOP hpop;
// 配置高级力模型
HPOPForceModel force_model;
// 1. 配置地球重力场 (JGM3模型)
force_model.gravity_.model_ = "JGM3"; // 使用JGM3重力场模型
force_model.gravity_.maxDegree_ = 4; // 阶数
force_model.gravity_.maxOrder_ = 0; // 次数
// 2. 配置大气阻力模型
force_model.useDrag_ = true; // 启用大气阻力
// 3. 配置第三体引力 (太阳和月球)
force_model.useMoonGravity_ = true; // 启用月球引力
// 设置力模型
errc_t result = hpop.setForceModel(force_model);
if (result != eNoError) {
std::cout << "设置力模型失败,错误码: " << result << std::endl;
return -1;
}
// 初始化HPOP
result = hpop.initialize();
if (result != eNoError) {
std::cout << "初始化失败,错误码: " << result << std::endl;
return -1;
}
std::cout << "HPOP初始化成功" << std::endl;
std::cout << "力模型配置:" << std::endl;
std::cout << "- 重力场: " << force_model.gravity_.model_
<< " (阶数=" << force_model.gravity_.maxDegree_ << ", 次数=" << force_model.gravity_.maxOrder_ << ")" << std::endl;
std::cout << "- 大气阻力: " << (force_model.useDrag_ ? "启用" : "禁用") << std::endl;
std::cout << "- 月球引力: " << (force_model.useMoonGravity_ ? "启用" : "禁用") << std::endl;
std::cout << std::endl;
// 设置初始轨道状态 (低地球轨道)
TimePoint start_time = TimePoint::FromUTC(2026, 1, 1, 0, 0, 0);
Vector3d position{6878.14_km, 0.0, 0.0}; // 约400km高度
Vector3d velocity{0.0, 7.668_km_s, 0.0}; // 圆轨道速度
std::cout << "初始轨道状态:" << std::endl;
std::cout << "起始时间: 2026-01-01 00:00:00 UTC" << std::endl;
std::cout << "位置: (" << position[0]/1000.0 << ", "
<< position[1]/1000.0 << ", "
<< position[2]/1000.0 << ") km" << std::endl;
std::cout << "速度: (" << velocity[0]/1000.0 << ", "
<< velocity[1]/1000.0 << ", "
<< velocity[2]/1000.0 << ") km/s" << std::endl;
std::cout << std::endl;
// 设置传播时间 (3天)
TimePoint end_time = start_time + 3 * 24 * 3600.0; // 加3天
// 执行轨道预报
result = hpop.propagate(start_time, end_time, position, velocity);
if (result == eNoError) {
std::cout << "轨道预报成功" << std::endl;
std::cout << "传播时长: 3天" << std::endl;
std::cout << "结束时间: 2026-01-04 00:00:00 UTC" << std::endl;
std::cout << "预报后位置: (" << position[0]/1000.0 << ", "
<< position[1]/1000.0 << ", "
<< position[2]/1000.0 << ") km" << std::endl;
std::cout << "预报后速度: (" << velocity[0]/1000.0 << ", "
<< velocity[1]/1000.0 << ", "
<< velocity[2]/1000.0 << ") km/s" << std::endl;
// 计算轨道参数变化
double initial_radius = 6878.14; // km
double final_radius = position.norm() / 1000.0; // km
double radius_change = final_radius - initial_radius;
std::cout << std::endl;
std::cout << "轨道参数变化:" << std::endl;
std::cout << "初始轨道半径: " << initial_radius << " km" << std::endl;
std::cout << "最终轨道半径: " << final_radius << " km" << std::endl;
std::cout << "轨道半径变化: " << radius_change << " km" << std::endl;
} else {
std::cout << "轨道预报失败,错误码: " << result << std::endl;
}
return 0;
}3. Multi-Day Propagation
#include "AstCore/HPOP.hpp"
#include "AstCore/HPOPForceModel.hpp"
#include "AstCore/TimePoint.hpp"
#include "AstCore/RunTime.hpp"
#include "AstMath/Vector.hpp"
#include "AstUtil/Literals.hpp"
#include "AstUtil/Constants.h"
#include <iostream>
#include <iomanip>
#include <cmath>
#include <vector>
AST_USING_NAMESPACE
using namespace _AST literals;
int main()
{
// 初始化运行时环境
aInitialize();
setlocale(LC_ALL, ".UTF-8");
std::cout << std::fixed << std::setprecision(3);
std::cout << "HPOP高精度轨道预报器 - 多天传播示例" << std::endl;
std::cout << "====================================" << std::endl;
// 创建HPOP对象
HPOP hpop;
// 配置高精度力模型
HPOPForceModel force_model;
// 配置地球重力场 (使用高精度模型)
force_model.gravity_.model_ = "EGM2008"; // 使用高精度重力场模型
force_model.gravity_.maxDegree_ = 8; // 阶数
force_model.gravity_.maxOrder_ = 8; // 次数
// 配置大气阻力模型
force_model.useDrag_ = true; // 启用大气阻力
// 配置第三体引力
force_model.useMoonGravity_ = true; // 启用月球引力
// 设置力模型
errc_t result = hpop.setForceModel(force_model);
if (result != eNoError) {
std::cout << "设置力模型失败,错误码: " << result << std::endl;
return -1;
}
// 初始化HPOP
result = hpop.initialize();
if (result != eNoError) {
std::cout << "初始化失败,错误码: " << result << std::endl;
return -1;
}
std::cout << "HPOP初始化成功" << std::endl;
std::cout << "力模型配置:" << std::endl;
std::cout << "- 重力场: " << force_model.gravity_.model_
<< " (阶数=" << force_model.gravity_.maxDegree_
<< ", 次数=" << force_model.gravity_.maxOrder_ << ")" << std::endl;
std::cout << "- 大气阻力: " << (force_model.useDrag_ ? "启用" : "禁用") << std::endl;
std::cout << "- 月球引力: " << (force_model.useMoonGravity_ ? "启用" : "禁用") << std::endl;
std::cout << std::endl;
// 设置初始轨道状态 (中地球轨道 - 导航卫星轨道)
TimePoint start_time = TimePoint::FromUTC(2026, 1, 1, 0, 0, 0);
Vector3d position{26560_km, 0.0, 0.0}; // 约20000km高度
Vector3d velocity{0.0, 3.87_km_s, 0.0}; // 圆轨道速度
std::cout << "初始轨道状态:" << std::endl;
std::cout << "起始时间: 2026-01-01 00:00:00 UTC" << std::endl;
std::cout << "位置: (" << position[0]/1000.0 << ", "
<< position[1]/1000.0 << ", "
<< position[2]/1000.0 << ") km" << std::endl;
std::cout << "速度: (" << velocity[0]/1000.0 << ", "
<< velocity[1]/1000.0 << ", "
<< velocity[2]/1000.0 << ") km/s" << std::endl;
std::cout << std::endl;
// 定义多个传播时间点
std::vector<double> propagation_days = {1.0, 7.0, 30.0, 90.0}; // 1天, 7天, 30天, 90天
std::cout << "多时间点轨道预报结果:" << std::endl;
std::cout << "=====================" << std::endl;
// 保存初始状态用于比较
Vector3d initial_position = position;
Vector3d initial_velocity = velocity;
for (double days : propagation_days) {
// 重置到初始状态
position = initial_position;
velocity = initial_velocity;
// 设置传播时间
TimePoint end_time = start_time + days * 24 * 3600.0;
// 执行轨道预报
result = hpop.propagate(start_time, end_time, position, velocity);
if (result == eNoError) {
std::cout << "\n传播时长: " << days << " 天" << std::endl;
// std::cout << "结束时间: " << end_time.toString() << std::endl;
// 计算轨道参数变化
double initial_radius = initial_position.norm() / 1000.0; // km
double final_radius = position.norm() / 1000.0; // km
double radius_change = final_radius - initial_radius;
double initial_speed = initial_velocity.norm() / 1000.0; // km/s
double final_speed = velocity.norm() / 1000.0; // km/s
double speed_change = final_speed - initial_speed;
std::cout << "轨道半径变化: " << radius_change << " km" << std::endl;
std::cout << "轨道速度变化: " << speed_change << " km/s" << std::endl;
} else {
std::cout << "传播 " << days << " 天失败,错误码: " << result << std::endl;
}
}
return 0;
}System Architecture
Simulation Engine
HPOP's core is a simulation engine that coordinates various functional modules:
- Time Management: Handles time stepping and synchronization
- Data Flow Control: Manages data transfer between modules
- Error Handling: Provides comprehensive error detection and reporting
Functional Modules
HPOP includes several types of functional modules:
- Force Calculation Modules: Gravity, drag, third-body, etc.
- Numerical Integration Modules: Different integration algorithms
- Coordinate System Modules: Coordinate transformations
- Output Modules: Result processing and output
Accuracy and Performance
Accuracy Characteristics
- Highest Precision: Numerical integration methods provide the highest precision
- Force Model Flexibility: Supports various perturbation force combinations
- Adaptive Step Control: Some integrators support adaptive step size control
Performance Considerations
- Computational Cost: Higher than analytical methods, suitable for high-precision requirements
- Memory Usage: Moderate memory requirements
- Real-time Capability: May not be suitable for real-time applications with strict performance requirements
Configuration Guide
Force Model Configuration
Configure appropriate force models based on application requirements:
- LEO Orbits: Consider atmospheric drag and Earth gravity field
- GEO Orbits: Focus on third-body gravity and solar radiation pressure
- High-Precision Requirements: Use higher-degree gravity field models
Integrator Selection
Choose suitable numerical integrators:
- RK4: Good balance of accuracy and performance
- RK78: Higher accuracy, suitable for long-term propagation
- Adaptive Integrators: Automatic step size adjustment
Notes
- HPOP requires initialization before use
- Force model configuration affects calculation accuracy and performance
- Numerical integrator selection should consider precision and computational cost
- For long-term propagation, consider using higher-precision integrators
Advantages and Limitations
Advantages
- High Precision: Numerical integration provides highest accuracy
- Flexibility: Modular design supports various configurations
- Comprehensive Force Models: Supports multiple perturbation forces
Limitations
- Higher Computational Cost: Slower than analytical methods
- Complex Configuration: Requires understanding of force models and integrators
- Memory Requirements: Higher than analytical methods
API Reference
///
/// @file HPOP.hpp
/// @brief ~
/// @details ~
/// @author axel
/// @date 2026-01-16
/// @copyright 版权所有 (C) 2026-present, ast项目.
///
/// ast项目(https://github.com/space-ast/ast)
/// 本项目基于 Apache 2.0 开源许可证分发。
/// 您可在遵守许可证条款的前提下使用、修改和分发本软件。
/// 许可证全文请见:
///
/// http://www.apache.org/licenses/LICENSE-2.0
///
/// 重要须知:
/// 软件按"现有状态"提供,无任何明示或暗示的担保条件。
/// 除非法律要求或书面同意,作者与贡献者不承担任何责任。
/// 使用本软件所产生的风险,需由您自行承担。
#pragma once
#include "AstGlobal.h"
#include "AstUtil/Constants.h"
#include "AstCore/CelestialBody.hpp"
#include <string>
#include <vector>
AST_NAMESPACE_BEGIN
/*!
@addtogroup Propagator
@{
*/
class HPOPEquation;
class ODEIntegrator;
class HPOPForceModel;
/// @brief 高精度轨道预报接口类
class AST_CORE_API HPOP
{
public:
HPOP() = default;
~HPOP();
public:
/// @brief 设置力模型
errc_t setForceModel(const HPOPForceModel& forcemodel);
/// @brief 设置预报坐标系
errc_t setPropagationFrame(Frame* frame);
/// @brief 设置积分器
void setIntegrator(ODEIntegrator* integrator);
/// @brief 获取积分器
ODEIntegrator* getIntegrator() const;
/// @brief 轨道预报
/// 考虑到有停止条件,所以预报结束时间同时也是一个输出参数
/// @param[in] startTime 预报起始时间
/// @param[in,out] targetTime 预报结束时间
/// @param[in,out] position 输出位置向量
/// @param[in,out] velocity 输出速度向量
/// @return errc_t 错误码
errc_t propagate(const TimePoint& startTime, TimePoint& targetTime, Vector3d& position, Vector3d& velocity);
/// @brief 初始化
errc_t initialize();
protected:
HPOPEquation* equation_{nullptr}; ///< 高精度轨道预报方程
mutable ODEIntegrator* integrator_{nullptr}; ///< 高精度轨道预报积分器
};
/*! @} */
AST_NAMESPACE_END