A Julia package for simulating a space-based solar power system, combining orbital mechanics from SatelliteToolbox.jl, thermal modeling, and electrical component simulation using the Dyad modeling language.
Presented in the Power Subsystem Design for Small Satellites in Julia webinar by JuliaHub.
dashboard_with_view.mp4
This package contains:
- Dyad components for modeling a power system fed by a solar panel on a satellite
- Julia code for simulating the satellite's orbit and the angle of the satellite with respect to the Sun
Additionally, in the scripts/
directory, you will find:
demo.jl
: Shows how to run the models defined herevisualization/simple.jl
: Visualizes the satellite's orbit using Makie.jl and GeoMakie.jlvisualization/dashboard.jl
: A 3D visualization of the satellite's orbit and power generation dynamics, plus ground track and satellite perspective. This is the most useful visualization for the workshop.
You will need to set up the Dyad product to use this package. This requires:
- a JuliaHub account
- installing Dyad Studio, a VS Code extension
- having the
DyadRegistry
available and using the JuliaHub package server (JULIA_PKG_SERVER="https://juliahub.com"
), which Dyad Studio will set up automatically for you
This package is available through the Dyad Community Registry. Simply run this code in a Julia REPL:
using Pkg
Pkg.Registry.add("https://github.com/DyadLang/DyadCommunityRegistry")
Then, you can install this package by running:
using Pkg
Pkg.add("SpacePowerWorkshop")
Alternatively, you can clone the repository and install the dependencies manually:
# Clone the repository
git clone https://github.com/yourusername/SpacePowerWorkshop.jl.git
cd SpacePowerWorkshop.jl
# Activate the package environment
julia --project -e 'using Pkg; Pkg.activate(".")'
# Install dependencies
julia --project -e 'using Pkg; Pkg.instantiate()'
The package includes several pre-built components defined in the Dyad DSL:
- TempSensor: Thermal model accounting for solar irradiance and orbital conditions
- PVCell: Photovoltaic cell with nonlinear I-V characteristics
- SolarPanel: Complete solar panel system with integrated MPPT
- DCDC_MPPT: DC-DC converter with Maximum Power Point Tracking
- SolarPanelSimple: Simplified solar panel model for quick simulations
Launch the interactive 3D dashboard to visualize satellite orbits and power generation:
cd scripts/visualization
# make sure this project is instantiated first
julia --project=. dashboard.jl
Features:
- Real-time orbital position tracking
- Power generation graphs
- Eclipse detection visualization
- Interactive camera controls
SpacePowerWorkshop.jl/
├── dyad/ # Dyad DSL component definitions
├── generated/ # Auto-generated Julia code
├── src/ # Core Julia source code
│ ├── SpacePowerWorkshop.jl
│ ├── main.jl
│ └── analysis/
├── scripts/ # Demo and visualization scripts
└── test/ # Test suite