Agent skill
astroforcemodels-jl
Develop and maintain AstroForceModels.jl, a Julia library for astrodynamics force modeling (gravity, drag, SRP, third-body, relativity). Use when working on AstroForceModels.jl, adding new force models, or computing orbital perturbation accelerations.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/astroforcemodels-jl
SKILL.md
AstroForceModels.jl
Julia package for modeling astrodynamics perturbation forces. Repo: HAMMERHEAD-Space/AstroForceModels.jl
Architecture
Type Hierarchy
AbstractAstroForceModel
├── AbstractPotentialBasedForce
│ └── AbstractGravityAstroModel
│ ├── GravityHarmonicsAstroModel # Spherical harmonics (EGM96 etc.)
│ └── KeplerianGravityAstroModel # Two-body point mass
└── AbstractNonPotentialBasedForce
├── DragAstroModel # Atmospheric drag
├── SRPAstroModel # Solar radiation pressure
├── ThirdBodyModel # Sun, Moon, planets
└── RelativityModel # GR corrections
AbstractDynamicsModel
└── CentralBodyDynamicsModel{N,GT,PT} # Gravity + N perturbations
Source Layout
src/
AstroForceModels.jl # Module entry, abstract types, exports
constants.jl # Physical constants (R_EARTH, μ_SUN, etc.)
utils.jl # angle_between_vectors()
dynamics_builder.jl # CentralBodyDynamicsModel, build_dynamics_model
force_models/
drag/ # satellite_shape_model.jl, density_calculator.jl, drag_accel.jl
gravity/ # utils.jl, gravity_accel.jl
relativity/ # relativity_accel.jl
solar_radiation_pressure/ # satellite_shape_model.jl, shadow_models.jl, srp_accel.jl
third_body/ # celestial_body.jl, third_body_model.jl, third_body_accel.jl
Key Patterns
Unified Acceleration Interface
Every force model implements the same 4-argument signature:
@inline function acceleration(
u::AbstractVector, p::ComponentVector, t::Number, model::SomeForceModel
)::SVector{3}
# ... compute and return acceleration in km/s^2 ...
end
Gravity models additionally implement:
potential(u, p, t, model) -> Numberpotential_time_derivative(u, p, t, model) -> Number
Force Composition
grav = GravityHarmonicsAstroModel(; gravity_model=..., eop_data=..., order=36, degree=36)
sun = ThirdBodyModel(; body=SunBody(), eop_data=eop_data)
moon = ThirdBodyModel(; body=MoonBody(), eop_data=eop_data)
srp = SRPAstroModel(; satellite_srp_model=CannonballFixedSRP(0.2), ...)
drag = DragAstroModel(; satellite_drag_model=CannonballFixedDrag(0.2), ...)
model = CentralBodyDynamicsModel(grav, (sun, moon, srp, drag))
accel = build_dynamics_model(u, p, t, model) # Returns SVector{3}
sum_accelerations uses compile-time tuple recursion (first/Base.tail) for zero-overhead force summation.
Satellite Shape Models
- Drag:
CannonballFixedDrag(area_mass_ratio),StateDragModel(f) - SRP:
CannonballFixedSRP(area_mass_ratio),StateSRPModel(f) - Shadow:
Conical(),Cylindrical(),No_Shadow()
Atmospheric Density
compute_density() dispatches on atmosphere model type: JB2008, JR1971, MSIS2000, ExpAtmo, NoDensityModel.
Units Convention
- Input/output: km, km/s, km/s^2 (J2000 ECI)
- Internal SatelliteToolbox calls: convert to/from meters (
* 1E3,/ 1E3)
Adding a New Force Model
- Create struct
<: AbstractNonPotentialBasedForce(orAbstractPotentialBasedForce) - Implement
acceleration(u, p, t, model)returningSVector{3} - Use
@inline, returnSVector{3}, usepromote_typefor AD - Add to
CentralBodyDynamicsModelperturbation tuple - Tests: correctness against reference, AD with all 5 backends,
@check_allocs
Dependencies
ComponentArrays0.15,Parameters0.12,StaticArraysCore1.4- SatelliteToolbox: atmospheric, gravity, celestial bodies, transformations
SpaceIndices2 for space weather data
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?