A Julia package for solving saddle-path problems in continuous-time macroeconomic models using stable manifold methods.
- ✅ Ergonomic DSL for declaring continuous-time macro models with Unicode notation
- ✅ Automatic Variable Classification - States, costates, and parameters detected automatically
- ✅ Isolated Namespaces - Each solution instance has its own variable namespace
- ✅ Modular Backend System - Extensible architecture for different numerical methods
- ✅ Comprehensive Testing - 242 parser + 75 namespace + 95 computation tests passing
- 🔄 Backend Abstraction - Ready for spectral methods, finite differences, etc.
- 🔄 Test-Driven Development - Extensive test suite with 60+ computation tests written
using Pkg
Pkg.add("SaddlePaths")using SaddlePaths
# Define a Ramsey growth model with automatic variable classification
@model ramsey begin
# c(k) notation automatically marks c as costate variable
# Greek letters (α, δ, ρ) automatically detected as parameters
# k is automatically classified as state variable
𝑑c = c(k) * (α * k^(α - 1) - δ - ρ)
𝑑k = k^α - δ * k - c(k)
end
# Model structure is automatically created:
# - state = [:k]
# - costate = [:c]
# - params = [:α, :δ, :ρ]
# Create numerical solution with isolated namespace
solution = NumericalSolution(ramsey, [0.3, 0.1, 0.05]) # α, δ, ρ
# Evaluate ODEs at specific points
state_vals = [1.5] # k = 1.5
costate_vals = [0.8] # c = 0.8
dk, dc = evaluate_all_odes(solution, state_vals, costate_vals)
# Clean up namespace when done
cleanup!(solution)- ✅ Parser: Fully implemented with 242 tests passing
- ✅ Namespace Management: Complete isolation system for multiple solutions (75/75 tests)
- ✅ Backend Abstraction: Modular system for numerical methods
- ✅ Numerical Solution: Complete with 95/95 tests passing
- 🔄 Spectral Methods: Backend ready, awaiting library integration
SaddlePaths.jl follows a clean, modular architecture:
- Parser Module: DSL for model specification with automatic variable classification
- Namespace Module: Isolated variable scopes for multiple solution instances
- Backend Module: Abstract interface for different numerical methods
- Computation Module: Numerical solution framework with ODE evaluation
The project uses comprehensive test-driven development:
# Run all tests
make test
# Run specific test suites
julia --project=. test/test_parser.jl # 242/242 tests passing
julia --project=. test/test_namespace.jl # 75/75 tests passing
julia --project=. test/test_computation.jl # 95/95 tests passing- Lines of Code: ~2,900 total
- Test Coverage: All modules fully tested with comprehensive test suites
- Dependencies: None currently (ready for spectral method libraries)
- Julia Version: 1.10+
This project uses a test-driven development approach. New features should:
- Add comprehensive tests first
- Implement the functionality
- Ensure all tests pass
For detailed documentation, see the docs.
MIT