Agent skill
qlaw-jl
Develop and maintain QLaw.jl, a Julia library for Q-Law Lyapunov-based low-thrust guidance. Use when working on QLaw.jl, designing low-thrust orbit transfers, tuning Q-Law weights, or implementing feedback control for orbital maneuvering.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/qlaw-jl-hammerhead-space-agenticcodingrules
SKILL.md
QLaw.jl
Julia implementation of the Q-Law Lyapunov-based feedback control law for low-thrust orbit transfers. Repo: HAMMERHEAD-Space/QLaw.jl
Architecture
Spacecraft Types
QLawSpacecraft # Constant thrust (dry, wet, thrust, isp)
SEPQLawSpacecraft # Solar electric (+ r_ref for 1/r^2 scaling)
Control Types
# Effectivity (coasting logic)
AbsoluteEffectivity # Coast when absolute effectivity < threshold
RelativeEffectivity # Coast when relative effectivity < threshold
# Convergence criteria
SummedErrorConvergence # Sum of weighted element errors
MaxElementConvergence # Maximum individual element error
VargaConvergence # Varga's convergence metric
Problem/Solution Types
QLawParameters # Algorithm configuration (smoothing, tolerances)
QLawWeights # Element weights for proximity quotient Q
QLawProblem # Problem definition (SciML pattern)
QLawSolution # Transfer result (converged, time, mass, trajectory)
Source Layout
src/
QLaw.jl # Module entry
types.jl # All type definitions
api.jl # qlaw_problem(), solve(), remake()
qlaw_core.jl # Q function, optimal thrust angles (α*, β*), effectivity
dynamics.jl # ODE RHS: Gauss VE in modified equinoctial elements
Key Patterns
SciML Interface
# Define transfer
prob = qlaw_problem(oe0, oeT, tspan, μ, spacecraft;
weights=QLawWeights(...),
qlaw_params=QLawParameters(...))
# Solve
sol = solve(prob)
# Remake
prob2 = remake(prob; spacecraft=new_spacecraft)
Modified Equinoctial Elements
Q-Law operates in modified equinoctial elements [p, f, g, h, k, L]:
oe0 = ModEq(kep_initial, μ) # Convert from Keplerian via AstroCoords
oeT = ModEq(kep_target, μ)
Q-Law Core Math
- Proximity quotient Q: Weighted sum of squared element errors, penalized near singularities
- Optimal thrust angles:
α*(in-plane) andβ*(out-of-plane) computed via ForwardDiff of dQ/doe - Effectivity: Measures how efficiently current thrust reduces Q; used for coasting decisions
- Smooth activations:
tanhfor AD-compatible coasting thresholds
Weight Optimization
# Global optimization via BlackBoxOptim
# Local optimization via SAMIN (Optim.jl)
# Both through Optimization.jl unified interface
Perturbation Support
Integrates with AstroForceModels.jl for:
- J2+ gravity harmonics
- Third-body perturbations (Moon, Sun)
- Eclipse/shadow modeling
Integration with Ecosystem
- AstroCoords: Coordinate conversions (Keplerian <-> ModEq)
- AstroPropagators: ODE integration infrastructure
- AstroForceModels: Perturbation force models
- ComponentArrays: Named state vectors
Adding New Features
New Convergence Criterion
- Define
struct NewConvergencetype - Implement convergence check dispatch
- Test on known reference transfers
New Effectivity Model
- Define effectivity type struct
- Implement smooth (AD-compatible) effectivity computation
- Verify ForwardDiff compatibility
Dependencies
AstroCoords0.3,AstroForceModels0.3,AstroPropagators0.2ComponentArrays0.15,ForwardDiff1,StaticArrays1Optim2 (local optimization for weight tuning)OrdinaryDiffEqAdamsBashforthMoulton1.5,OrdinaryDiffEqCore1SciMLBase2
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?