G-FOLD: Fuel Optimal Large Divert Guidance Algorithm
Project description
G-FOLD Python Generator
This is the Python implementation of the G-FOLD algorithm with code generation capabilities. The problem is described using CVXPY/Python and C/C++ code is generated using CVXPYGen.
Installation
Option 1: Install from source
Prerequisites
You need to install Rust and Eigen for the code generation feature.
Clone the repository:
git clone https://github.com/samutoljamo/g-fold.git
cd g-fold/generator
Install the package in development mode:
pip install -e .
On WSL, make sure you've installed Tkinter (version depends on the python version you're using):
sudo apt-get install python3.12-tk
Option 2: Install from PyPI
pip install gfold
Usage
As a command-line tool
After installation, you can run G-FOLD from the command line:
# Solve the example problem with 100 steps and display graphs
gfold -n 100
# Generate C++ code
gfold -g -n 100 -o output_directory
# Save the plot to a file without displaying it
gfold -n 100 --save-plot --no-plot
As a Python library
from gfold import GFoldSolver
from gfold.visualization import plot_results
# Create a solver with 100 steps
solver = GFoldSolver()
# Solve the problem
solution = solver.solve(verbose=True)
print(f"Final mass: {solution['final_mass']:.2f} kg")
# Plot the results
plot_results(solution, save_path="gfold_plot.png")
# Generate C++ code
solver.generate_code(code_dir="generated_code")
Example scripts
Check the examples directory for more usage examples:
simple_example.py: Basic usage of the solver and visualization
Development
To set up the development environment:
cd g-fold/generator
pip install -e .
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gfold-0.1.2.tar.gz.
File metadata
- Download URL: gfold-0.1.2.tar.gz
- Upload date:
- Size: 8.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
229f5c278203f439e98b84569c49c9b01147c8a09f875fe98bfd89be432cfbaa
|
|
| MD5 |
4ab230f3fae26255beea4778e1cd5fac
|
|
| BLAKE2b-256 |
a76b030f640f48cbcd9b21921e8597f8040f4cdae9059537e87cfd8f0e125cb5
|
Provenance
The following attestation bundles were made for gfold-0.1.2.tar.gz:
Publisher:
python-publish.yml on samutoljamo/g-fold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gfold-0.1.2.tar.gz -
Subject digest:
229f5c278203f439e98b84569c49c9b01147c8a09f875fe98bfd89be432cfbaa - Sigstore transparency entry: 187671004
- Sigstore integration time:
-
Permalink:
samutoljamo/g-fold@8402edb704fe1e622d1f66049e70e59886099717 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/samutoljamo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8402edb704fe1e622d1f66049e70e59886099717 -
Trigger Event:
release
-
Statement type:
File details
Details for the file gfold-0.1.2-py3-none-any.whl.
File metadata
- Download URL: gfold-0.1.2-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b4c47b9915858b534f7d1bd5293f221e19ee402ad86526b5d68823a443dd441
|
|
| MD5 |
d8118335823adf3ea3ef2c7e35ee988e
|
|
| BLAKE2b-256 |
33101fcad144506d631e15ce386509e78c61930c41f4ceff8e87c2bc052af629
|
Provenance
The following attestation bundles were made for gfold-0.1.2-py3-none-any.whl:
Publisher:
python-publish.yml on samutoljamo/g-fold
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
gfold-0.1.2-py3-none-any.whl -
Subject digest:
4b4c47b9915858b534f7d1bd5293f221e19ee402ad86526b5d68823a443dd441 - Sigstore transparency entry: 187671007
- Sigstore integration time:
-
Permalink:
samutoljamo/g-fold@8402edb704fe1e622d1f66049e70e59886099717 -
Branch / Tag:
refs/tags/0.1.2 - Owner: https://github.com/samutoljamo
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
python-publish.yml@8402edb704fe1e622d1f66049e70e59886099717 -
Trigger Event:
release
-
Statement type: