Metadata-Version: 2.4
Name: fibe
Version: 0.4.2
Summary: Fixed boundary tokamak equilibrium solver in pure Python
Author-email: Aaron Ho <aaronkho@mit.edu>
License-Expression: Apache-2.0
Project-URL: Homepage, https://gitlab.com/aaronkho/fibe
Project-URL: Bug Reports, https://gitlab.com/aaronkho/fibe/-/issues
Project-URL: Source, https://gitlab.com/aaronkho/fibe
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Science/Research
Classifier: Topic :: Utilities
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pip
Requires-Dist: numpy>=1.26.4
Requires-Dist: pandas>=2.2.2
Requires-Dist: xarray>=2024.7.0
Requires-Dist: netcdf4
Requires-Dist: tables
Requires-Dist: scipy>=1.13.0
Requires-Dist: contourpy
Requires-Dist: shapely
Requires-Dist: eqdsk; python_version >= "3.10"
Requires-Dist: megpy>=2.0.2
Provides-Extra: dev
Requires-Dist: coverage; extra == "dev"
Requires-Dist: pytest; extra == "dev"
Requires-Dist: pytest-cov; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx; extra == "docs"
Requires-Dist: furo; extra == "docs"
Requires-Dist: sphinx-rtd-theme; extra == "docs"
Provides-Extra: build
Requires-Dist: build; extra == "build"
Requires-Dist: twine; extra == "build"
Provides-Extra: optuna
Requires-Dist: optuna; extra == "optuna"
Provides-Extra: jax
Requires-Dist: jax; extra == "jax"
Dynamic: license-file

# fibe
FIxed Boundary Equilibrium (FIBE) solver for tokamak plasma geometries in pure Python

## Installation

This package is available on PyPI, so installation can simply be done with:

```
pip install fibe
```

However, if you wish to make modifications to the source code or use alpha versions, it is possible to install via:

```
git clone <this_repo>
pip install [--user] -e fibe
```

## Quick setup

Using the following lines in your script should allow for quick setup (parameters in <> are user-defined):

```
from fibe import FixedBoundaryEquilibrium
eq = FixedBoundaryEquilibrium()
eq.define_grid_and_boundary_with_mxh(
    nr=129,
    nz=129,
    rgeo=<R0_m>,
    zgeo=<Z0_m>,
    rminor=<Rmin_m>,
    kappa=<kappa>,
    cos_coeffs=[0.0, 0.0, 0.0],
    sin_coeffs=[0.0, np.arcsin(<delta>), -<zeta>],
)
eq.initialize_profiles_with_minimal_input(<P0_Pa>, <Ip_A>, <Bt_T>)
eq.initialize_psi()
eq.solve_psi()
```

To view the solution in script:

```
eq.plot_contour()
eq.plot_profiles()
```

To save the output in GEQDSK format:

```
eq.to_geqdsk(<geqdsk_filename>)
```
