Agent skill
simsflanagan-jl
Develop and maintain SimsFlanagan.jl, a Julia library for low-thrust trajectory optimization using the Sims-Flanagan transcription method. Use when working on SimsFlanagan.jl, designing low-thrust transfers, or optimizing trajectory segments with impulsive delta-V.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/simsflanagan-jl
SKILL.md
SimsFlanagan.jl
Julia implementation of the Sims-Flanagan transcription method for low-thrust trajectory optimization. Repo: HAMMERHEAD-Space/SimsFlanagan.jl
Architecture
Spacecraft Types
AbstractSpacecraft
├── Spacecraft # Constant thrust
├── SEPSpacecraft # Solar electric propulsion (1/r^2 thrust scaling)
└── SolarSail # Solar sail (radiation pressure)
Problem/Solution Types
SimsFlanaganProblem # Problem definition (SciML pattern)
SimsFlanaganSolution # Optimized trajectory result
Initial Guess Strategies
AbstractInitialGuess
├── RandomGuess # Random throttle vectors
├── ZeroGuess # Zero thrust (ballistic)
├── ConstantGuess # Constant throttle direction
├── RadialGuess # Radial thrust direction
└── LambertGuess # Lambert arc-based initialization
Source Layout
src/
SimsFlanagan.jl # Module entry
types.jl # All type definitions
problem.jl # simsflanagan_problem() construction
propagation.jl # Kepler propagation, segment/leg propagation, mismatch
solve.jl # solve() via MadNLP optimizer
utils.jl # safe_norm (AD-safe), utilities
Key Patterns
SciML Interface
# Create problem
prob = simsflanagan_problem(r0, v0, rf, vf, tof, μ, spacecraft; kwargs...)
# Solve
sol = solve(prob; kwargs...)
# Remake for different parameters
prob2 = remake(prob; tof=new_tof)
Solution Accessors
position_mismatch(sol) # Match-point position error
velocity_mismatch(sol) # Match-point velocity error
mass_mismatch(sol) # Mass continuity error
Optimization Stack
- MadNLP interior-point NLP solver with MUMPS linear solver
- ForwardDiff for gradient computation
- Optimization.jl unified interface via OptimizationMOI bridge
Trajectory Discretization
- Splits trajectory into forward/backward legs from match point
- Each segment has impulsive delta-V at midpoint (
SVector{3}throttle) - Sundman transformation for adaptive segment sizing based on orbital distance
AD-Safe Utilities
safe_norm(v) # Handles zero vector without NaN gradients
Lambert-Based Initialization
Uses Lambert.jl to compute initial guess from Lambert arcs, providing better convergence than random initialization.
Adding a New Spacecraft Model
- Define
struct NewCraft <: AbstractSpacecraftwith propulsion parameters - Implement thrust computation method (how thrust scales with position/state)
- Add dispatch in propagation for the new thrust model
- Add initial guess compatibility
- Test: convergence on known transfer, AD gradient correctness
Dependencies
AstroCoords0.3,Lambert0.1,SciMLBase2,StaticArrays1.9ForwardDiff1.3 (AD for optimization gradients)MadNLP0.8,MadNLPMumps0.5 (interior-point NLP solver)Optimization5,OptimizationMOI1,OptimizationMadNLP1
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?