Skip to main content

ESSOS: e-Stellarator Simulation and Optimization Suite

Project description

❯ ESSOS: e-Stellarator Simulation and Optimization Suite

license last-commit repo-top-language Build Status Coverage Documentation Status

Table of Contents

Overview

ESSOS is an open-source project in Python that uses JAX to optimize stellarator coils. Optimization can be applied to several objectives, such as alpha particle confinement, plasma boundaries and magnetic field equilibria (including near-axis expansions). It leverages automatic differentiation and efficient numerical methods to streamline optimization efforts, creating a specialized and fast numerical tool for optimizing force-free stellarator equilibria. It is parallelized using JAX's sharding tools. It can be imported in a Python script using the essos package, or run directly in the command line as essos. To install it, use

pip install essos

Alternatively, you can install the Python dependencies and run the example scripts in the repository after downloading it as

git clone https://github.com/uwplasma/ESSOS
cd ESSOS
pip install .
python examples/trace_particles_from_coils.py

The project can be downloaded in its GitHub repository.

Features

  • JAX Integration: Utilizes JAX for automatic differentiation and efficient numerical computations.
  • Optimization: Implements optimization routines for stellarator coil design.
  • Particle Tracing: Traces alpha particles in magnetic fields generated by coils.
  • Fieldline Tracing: Traces magnetic field lines.
  • Coils and Near-Axis Fields: Models and optimizes electromagnetic coils and near-axis magnetic fields.

Project Structure

ESSOS/
├── essos/
│   ├── __init__.py
│   ├── __main__.py
│   ├── coils.py
│   ├── constants.py
│   ├── dynamics.py
│   ├── fields.py
│   ├── objective_functions.py
│   ├── optimization.py
│   ├── plot.py
│   └── surfaces.py
├── examples/
│   ├── create_stellarator_coils.py
│   ├── optimize_coils_and_nearaxis.py
│   ├── optimize_coils_for_nearaxis.py
│   ├── optimize_coils_particle_confinement_fullorbit.py
│   ├── optimize_coils_particle_confinement_guidingcenter.py
│   ├── optimize_coils_vmec_surface.py
│   ├── trace_fieldlines_coils.py
│   ├── trace_particles_coils_fullorbit.py
│   ├── trace_particles_coils_guidingcenter.py
│   ├── trace_particles_vmec.py
│   └── comparisons_SIMSOPT/
│   └── inputs/
│       ├── ESSOS_bio_savart_LandremanPaulQA.json
│       ├── SIMSOPT_bio_savart_LandremanPaulQA.json
│       ├── wout_n3are_R7.75B5.7.nc
│       └── wout_LandremanPaul2021_QA_reactorScale_lowres_reference.nc
├── tests/
│   ├── test_coils.py
│   ├── test_constants.py
│   ├── test_dynamics.py
│   ├── test_fields.py
├── README.md
├── LICENSE.md
├── CODE_OF_CONDUCT.md
├── CONTRIBUTING.md
├── setup.py
├── pyproject.toml
└── requirements.txt

Getting Started

Prerequisites

  • Python 3.8 or higher

Installation

From PyPI

To install ESSOS from PyPI, run:

pip install essos

From Source

To install ESSOS from source, clone the repository and install the package:

git clone https://github.com/uwplasma/ESSOS
cd ESSOS
pip install .

Usage

ESSOS can be run directly in the command line as essos, or by following one of the examples in the examples folder. For example, to trace particles in a magnetic field generated from coils, run:

python examples/trace_particles_coils_guidingcenter.py

Testing

To run the tests, use pytest:

pytest .

Project Roadmap

  • Allow several optimization algorithms
  • Allow plotly and/or Mayavi visualization
  • Add DESC and SPEC equilibria for tracing
  • Add beam injection examples
  • Add plotting for near-axis expansion
  • Add particle collisions

Contributing

Contributions are welcome! Please fork the repository and submit a pull request. For major changes, please open an issue first to discuss what you would like to change.

Contributing Guidelines
  1. Fork the Repository: Start by forking the project repository to your github account.
  2. Clone Locally: Clone the forked repository to your local machine using a git client.
    git clone https://github.com/uwplasma/ESSOS
    
  3. Create a New Branch: Always work on a new branch, giving it a descriptive name.
    git checkout -b new-feature-x
    
  4. Make Your Changes: Develop and test your changes locally.
  5. Commit Your Changes: Commit with a clear message describing your updates.
    git commit -m 'Implemented new feature x.'
    
  6. Push to github: Push the changes to your forked repository.
    git push origin new-feature-x
    
  7. Submit a Pull Request: Create a PR against the original project repository. Clearly describe the changes and their motivations.
  8. Review: Once your PR is reviewed and approved, it will be merged into the main branch. Congratulations on your contribution!
Contributor Graph


License

This project is protected under the MIT License. For more details, refer to the LICENSE file.


Acknowledgments


Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

essos-0.13.tar.gz (4.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

essos-0.13-py3-none-any.whl (31.1 kB view details)

Uploaded Python 3

File details

Details for the file essos-0.13.tar.gz.

File metadata

  • Download URL: essos-0.13.tar.gz
  • Upload date:
  • Size: 4.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for essos-0.13.tar.gz
Algorithm Hash digest
SHA256 92e03861aa048aa84f7c355f0026e56a5abc8facdea457eeb9e6c857bfe07dbf
MD5 74d72bf5c7db3eb84ccaa024644b0e79
BLAKE2b-256 7a5767f268505271ecb59138a1692706183243102c7873d5740bb31b1133fc19

See more details on using hashes here.

Provenance

The following attestation bundles were made for essos-0.13.tar.gz:

Publisher: pypi_publish.yml on uwplasma/ESSOS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file essos-0.13-py3-none-any.whl.

File metadata

  • Download URL: essos-0.13-py3-none-any.whl
  • Upload date:
  • Size: 31.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for essos-0.13-py3-none-any.whl
Algorithm Hash digest
SHA256 ae6cfaa3aa5df380862db1db8f66f6ac1725f03049113fb01f30b51cb4df166e
MD5 1df18b7175bab0a6c3ff52d0b0af4007
BLAKE2b-256 27195fd4ffb81a5d1235e4c6b979c53d27b9b4c5b0b07330fbfdce7d24125e46

See more details on using hashes here.

Provenance

The following attestation bundles were made for essos-0.13-py3-none-any.whl:

Publisher: pypi_publish.yml on uwplasma/ESSOS

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page