Metadata-Version: 2.4
Name: optymus
Version: 0.1.11
Summary: Optimization methods in Python
Project-URL: Homepage, https://github.com/quant-sci/optymus
Project-URL: Bug Tracker, https://github.com/quant-sci/optymus/issues
Requires-Python: >=3.12
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: jax>=0.4.28
Requires-Dist: jaxlib>=0.4.28
Requires-Dist: numpy==1.26.4
Requires-Dist: rich>=13.0
Requires-Dist: scipy>=1.12
Provides-Extra: dev
Requires-Dist: pytest~=8.2; extra == "dev"
Requires-Dist: black~=24.4; extra == "dev"
Requires-Dist: ruff~=0.4; extra == "dev"
Provides-Extra: testing
Requires-Dist: jax>=0.4.28; extra == "testing"
Requires-Dist: jaxlib>=0.4.28; extra == "testing"
Requires-Dist: numpy==1.26.4; extra == "testing"
Requires-Dist: rich>=13.0; extra == "testing"
Requires-Dist: scipy>=1.12; extra == "testing"
Provides-Extra: docs
Requires-Dist: pydata-sphinx-theme==0.15.2; extra == "docs"
Requires-Dist: sphinx_design==0.5.0; extra == "docs"
Requires-Dist: sphinx_togglebutton==0.3.2; extra == "docs"
Requires-Dist: sphinxcontrib.youtube==1.4.1; extra == "docs"
Requires-Dist: sphinx_copybutton==0.5.2; extra == "docs"
Requires-Dist: myst_parser==3.0.1; extra == "docs"
Requires-Dist: nbsphinx==0.9.4; extra == "docs"
Requires-Dist: ipython==8.25.0; extra == "docs"
Dynamic: license-file

<h1 align="left">
<img src="logo.png" width="100">
</h1>

[![PyPI](https://img.shields.io/pypi/v/optymus)](https://pypi.org/project/optymus/)
[![GitHub](https://img.shields.io/github/license/kleyt0n/optymus)](https://github.com/kleyt0n/optymus/blob/master/LICENSE)
[![Documentation Status](https://readthedocs.org/projects/optymus/badge/?version=latest)](https://optymus.readthedocs.io/en/latest/?badge=latest)
![jax_badge][jax_badge_link]

**Structural Optimization and Scientific Computing**

`optymus` is a Python library for solving optimization problems in mechanical engineering and scientific computing. Built on [JAX](https://jax.readthedocs.io/en/latest/index.html) for automatic differentiation, it provides efficient gradient computation and GPU acceleration. The library is designed for structural optimization, topology optimization, and general-purpose numerical optimization.

## Key Features

- **Topology Optimization**: PolyMesher-based mesh generation with signed distance functions
- **Pre-built Engineering Domains**: Cook membrane, Michell truss, MBB beam, Wrench, Suspension
- **Structural Analysis Support**: Boundary conditions, load definitions, and FEM-ready domains
- **Multiple Optimization Methods**: Gradient-based (BFGS, Conjugate Gradient, Newton), adaptive (Adam, AdaGrad), and evolutionary (CMA-ES, Differential Evolution, Particle Swarm)
- **Constraint Handling**: Support for equality and inequality constraints via penalty methods

## Getting Started

1. Install optymus:
   ```bash
   uv add optymus
   ```

2. Basic optimization example:
   ```python
   from optymus import Optimizer
   from optymus.benchmark import Mccormick

   import jax.numpy as jnp

   f = Mccormick()
   initial_point = jnp.array([2.0, 2.0])

   opt = Optimizer(f_obj=f,
                   x0=initial_point,
                   method='bfgs')

   opt.report()
   ```

3. Topology optimization with engineering domains:
   ```python
   from optymus.benchmark import MbbDomain
   from optymus.methods import polymesher

   # MBB beam domain with boundary conditions
   domain = MbbDomain

   # Generate polygonal mesh
   result = polymesher(domain=domain, num_elements=100)
   ```

## Documentation

Visit the [official documentation](https://optymus.readthedocs.io/en/latest/) for:
- Complete API reference
- Optimization method guides
- Mechanical engineering examples
- Topology optimization tutorials

## Citation

If you use `optymus` in your research, please cite:

```bibtex
@misc{optymus2024,
  author = {da Costa, Kleyton and Menezes, Ivan and Lopes, Helio},
  title = {Optymus: Optimization Methods in Python},
  year = {2024},
  note = {GitHub Repository},
  url = {https://github.com/quant-sci/optymus}
}
```


[jax_link]: https://github.com/google/jax
[jax_badge_link]: https://img.shields.io/badge/JAX-Accelerated-9cf.svg?style=flat-square&logo=data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAC0AAAAaCAYAAAAjZdWPAAAIx0lEQVR42rWWBVQbWxOAkefur+7u3les7u7F3ZIQ3N2tbng8aXFC0uAuKf2hmlJ3AapIgobMv7t0w+a50JzzJdlhlvNldubeq/Y+XrTS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