Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Consider using release 0.2.3 instead.
Reason given by maintainers: Contains numerical correctness and crash defects fixed in later releases. Use 0.2.1 or later.

YAPSS: Yet Another Pseudo-Spectral Solver

YAPSS is a Python package for numerically solving optimal control problems using pseudospectral methods. Features include:

  • Computational approach based on the GPOPS-II algorithm of Patterson and Rao (2014)
  • Support for multiple differentiation methods: automatic differentiation via the CasADi package, user-defined derivatives, and central difference numerical differentiation for problems not amenable to automatic differentiation.
  • Choice of collocation method, including Legendre-Gauss (LG), Legendre-Gauss-Radau (LGR), and Legendre-Gauss-Lobatto (LGL) options.
  • Segmented mesh support, enabling mesh refinement in specific regions. (Automatic mesh refinement is not yet available.)
  • An API for defining optimal control problems designed to catch common errors and provide helpful messages.
  • Documentation covering installation, setup, and example usage.
  • Examples available as both Python scripts and Jupyter notebooks.

Quickstart

To get started, install YAPSS and verify the installation using pip:

$ python -m venv yapss-env
$ source yapss-env/bin/activate
(yapss-env) $ pip install yapss
(yapss-env) $ python -m yapss.examples.isoperimetric

If the console output shows a small relative error and a Matplotlib window displays a circle, the installation is successful!

For more detailed installation instructions, see the next section.

Installation

YAPSS supports installation via Conda or pip. It requires Python 3.10 or later.

Option 1: Using Conda

Create and activate a virtual environment, and install YAPSS:

$ conda create -n yapss-env python=3.10
$ conda activate yapss-env
(yapss-env) $ conda install -c conda-forge yapss

Option 2: Using Pip

Create and activate a virtual environment, then install YAPSS:

$ python -m venv yapss-env
$ source yapss-env/bin/activate
(yapss-env) $ pip install yapss

To install from source:

(yapss-env) $ pip install git+https://github.com/stevenrhall/yapss.git

As above, this installs from the tip of the default branch; append @vX.Y.Z to pin a specific released version.

Verify the Installation

To verify the installation, run the isoperimetric example:

(yapss-env) $ python -m yapss.examples.isoperimetric

The result should be a matplotlib window with a plot of the optimal curve (a circle), and console output that concludes with something similar to

Maximum area = 0.07957747154594766 (Should be 1 / (4 pi) = 0.07957747154594767)
Relative error in solution = 1.743934249004316e-16

If the plot does not display, add %matplotlib inline in a Jupyter notebook or set the backend with matplotlib.use('Agg') for headless environments.

The console output may differ slightly depending on machine precision. Minor deviations in the final digits are normal, and the relative error should be on the order of machine precision. If it is, the installation is correct.

Additional examples are available in

  • the examples/notebooks directory
  • the src/yapss/examples directory
  • the Examples section of the documentation.

License

YAPSS is licensed under the MIT License. See the LICENSE file for more information.

Documentation

The documentation is available on Read the Docs.

Contributing

YAPSS is open source — contributions are not only welcome but encouraged. See Contributing to YAPSS.

Download files

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

Source Distribution

yapss-0.1.1.tar.gz (155.4 kB view details)

Uploaded Source

Built Distribution

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

yapss-0.1.1-py3-none-any.whl (99.3 kB view details)

Uploaded Python 3

File details

Details for the file yapss-0.1.1.tar.gz.

File metadata

  • Download URL: yapss-0.1.1.tar.gz
  • Upload date:
  • Size: 155.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for yapss-0.1.1.tar.gz
Algorithm Hash digest
SHA256 7b80d5d3b9e9dc4b812bffa25b0791744a8bb7753ed5df1967603dadcc516c62
MD5 088d8440b16178e4c5ab28fe01e577a9
BLAKE2b-256 070b97c3ee16d91d824f8ced465a05879d4c048c424ec7b269d5d3810425d7b5

See more details on using hashes here.

File details

Details for the file yapss-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: yapss-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 99.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for yapss-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0fbe4a959db4686bfa4f5896840e91eec05c6e0f2c8a1b80973ab3f556049bd5
MD5 755ae4d54152bbfcc8c479ad88649877
BLAKE2b-256 05bfde9917844f52bcbc0cb7c1bf6a47fdc42eafa0ab55d19821bc355ae2376e

See more details on using hashes here.

Release history Release notifications | RSS feed

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.1rc1

2 files

0.2.0

2 files

This release

0.1.1 This release

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page