Skip to main content

Python bindings for the affine_mpc library

Project description

affine_mpc

affine_mpc is a library for model predictive control using discrete-time affine models, with C++ and Python interfaces. It is designed to support real-time control and rapid research prototyping with a focused set of common costs and constraints, along with live parameter updates.

Statement of Need

Researchers and engineers often need an MPC tool that sits between low-level QP assembly and large general-purpose control frameworks. affine_mpc aims to lower the barrier to entry for developing MPC controllers by reducing the amount of low-level problem assembly needed for common affine MPC workflows. affine_mpc focuses on discrete-time affine MPC problems with optional costs and constraints, efficient repeated solves, and workflows that support both experimentation in Python and integration in C++.

Highlights

  • Condensed and sparse MPC formulations behind a common interface
  • Move-blocking, linear interpolation, and B-spline input parameterizations
  • Optional input cost, state bounds, input bounds, and slew-rate constraints
  • Efficient OSQP-backed updates when the QP sparsity pattern is unchanged
  • Binary .npz logging via MPCLogger for plotting and post-run analysis

Documentation

The primary documentation lives at https://byu-rad-lab.github.io/affine_mpc/.

The Markdown source for the documentation lives in docs/.

Core C++ sources live under src/ and include/, Python bindings and package sources live under python/, and example workflows live under examples/.

Important Usage Notes

  • Fully configure the model, limits, weights, and references before calling initializeSolver()
  • OSQP sparsity is fixed at initialization; later updates must not introduce new nonzero structure
  • If a model coefficient or cost weight may become nonzero later, initialize with that structure already present

Community Standards

  • Contributing guide: CONTRIBUTING.md
  • Code of conduct: CODE_OF_CONDUCT.md
  • Citation metadata: CITATION.cff

Citation

If you use affine_mpc in research, please cite the project using the metadata in CITATION.cff.

License

This project is licensed under the BSD 3-Clause License. See LICENSE for details.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

affine_mpc-0.1.0-cp314-cp314-win_amd64.whl (559.1 kB view details)

Uploaded CPython 3.14Windows x86-64

affine_mpc-0.1.0-cp314-cp314-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.14musllinux: musl 1.2+ x86-64

affine_mpc-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (484.5 kB view details)

Uploaded CPython 3.14manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

affine_mpc-0.1.0-cp314-cp314-macosx_11_0_arm64.whl (325.4 kB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

affine_mpc-0.1.0-cp313-cp313-win_amd64.whl (542.8 kB view details)

Uploaded CPython 3.13Windows x86-64

affine_mpc-0.1.0-cp313-cp313-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

affine_mpc-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (484.1 kB view details)

Uploaded CPython 3.13manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

affine_mpc-0.1.0-cp313-cp313-macosx_11_0_arm64.whl (324.9 kB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

affine_mpc-0.1.0-cp312-cp312-win_amd64.whl (542.9 kB view details)

Uploaded CPython 3.12Windows x86-64

affine_mpc-0.1.0-cp312-cp312-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.12musllinux: musl 1.2+ x86-64

affine_mpc-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (483.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

affine_mpc-0.1.0-cp312-cp312-macosx_11_0_arm64.whl (324.8 kB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

affine_mpc-0.1.0-cp311-cp311-win_amd64.whl (540.8 kB view details)

Uploaded CPython 3.11Windows x86-64

affine_mpc-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ x86-64

affine_mpc-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (484.2 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

affine_mpc-0.1.0-cp311-cp311-macosx_11_0_arm64.whl (323.9 kB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

affine_mpc-0.1.0-cp310-cp310-win_amd64.whl (540.0 kB view details)

Uploaded CPython 3.10Windows x86-64

affine_mpc-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl (1.4 MB view details)

Uploaded CPython 3.10musllinux: musl 1.2+ x86-64

affine_mpc-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (482.6 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

affine_mpc-0.1.0-cp310-cp310-macosx_11_0_arm64.whl (322.7 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

File details

Details for the file affine_mpc-0.1.0-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: affine_mpc-0.1.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 559.1 kB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for affine_mpc-0.1.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 7465ada41967f79b2bcd80f19abb594a46c1d4b85c166436143e65cfea1ee95f
MD5 8e11da708922ecad7851b77f7729a4de
BLAKE2b-256 37dc70d61d33caf0a07752f20898f6202c520134e2360be2eb17b1a8908e5471

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp314-cp314-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp314-cp314-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 22b03667e4f34e42e13476d7ddac7ca4fcb4f3ddbadc9f26c0abed55c03b0a57
MD5 2c9cde30d0b769022e03c0661d5a775f
BLAKE2b-256 bd6a9784e6d7ecbbe1e1e6f6cfc93f34e64e9b8edd09f8349f88737d07e27c81

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp314-cp314-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9fcda15f9553570273a37e438cc4714a7122f514fe2b560a3e9bccc3ae7ed353
MD5 defdf74f41e5aef121a8b86452e43764
BLAKE2b-256 18d20816b5876d6a9824185ff2570ec56e84d21c51eb0038465fd1e4ac97e67a

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7ae6a7100daeaa4558afdf29e41cf61c1ba0955dc43c8a52fdc8bc593612a6f5
MD5 0e4668f399a8d0bc9e2c3a5019fcd76f
BLAKE2b-256 91f45001da0c1e0d57a1fa084a326a3484995bc9da464c50490e188ae5466bbe

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: affine_mpc-0.1.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 542.8 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for affine_mpc-0.1.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 7078b484f32a7f7138fa7144e4fa9464997ffcbc67a1906bfd91ba23e50ec2e1
MD5 2d8a4655dc234092b307874a53e65036
BLAKE2b-256 fc64f38603930c003b712516e7018febc7e993083758af22636e5072169f287d

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 82c451efb9507b578af29cdf4d92eaddd6d157ef6eb55db323ec51945743c8bc
MD5 6e2917277fbd3e8854dcc5c62f024afb
BLAKE2b-256 e8855d3bae86d3735cb8e7763798ce99f5ee59cef74dece34615b8d4da7724f0

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp313-cp313-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ae23715fd5de5526dca81156c183066dea8df8b2c8b07af0fec28cfa1188d4f4
MD5 c0095c825cd7ddcc84b145c7b67b9fd9
BLAKE2b-256 be2f803b10497e8c6fdc409798c09dcc0eed8053dda595c416fc9f020ddd6795

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b67da969b403c3e3de69b01779abfaebf3a595d2f701b54fabb49a51796236b
MD5 c1dfd5e4c3dbd0d18f76582a88e9164f
BLAKE2b-256 32ef943b89a42620ab9ab107c7e9b1e80c3deacd71dea96bdf82c18bcfc1330d

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: affine_mpc-0.1.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 542.9 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for affine_mpc-0.1.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 10d2f94faacc37ed2aca4ca0240d4fe0bdd31d11c563e48fcf34dd645f273e6e
MD5 b00176097f2a01650616da34daeb0c6a
BLAKE2b-256 4d7b060ecdab6a78f381eede4d50903260faff7eb34959f450fa70b303e27905

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp312-cp312-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 55b4eac4d991f12dd37315e07feb9f6a60ebb34f34d64ef275a5470062ff2436
MD5 99a7e43914dd250b203f7138b5714762
BLAKE2b-256 e6b4eb3b434dbed46841e56ce29fb5f08c74ba436488fd01ee268ccb997b4dd9

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 4442eb18dc03476617fb3f830ed7a0b4064d67493eefe55195544df8f12b890d
MD5 4cbfe837b9f380909b6e90291817fdab
BLAKE2b-256 057b58129f5bb7343ccdb59b6e759ef1d845b411938fa74e19eebbbdd47f9c9f

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f9ffc6e63867042ac779f8cfc041374be420f0d130bf31ac62c57b5ecaaf8fa8
MD5 a8387b79a24c59e65efc2865f6a5da00
BLAKE2b-256 dab3e7383d780d65973389226b0080310c8da7e7102cb75492d66dc2ac234c5b

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: affine_mpc-0.1.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 540.8 kB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for affine_mpc-0.1.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 38c66c1f791f8f2fc09eb008afbf0df8e25a8b45c90c3b162f89d21257f9750d
MD5 0946ec5d8a3abeffa5ed65ab4801bbb0
BLAKE2b-256 c40b7e0fc4b5e6b42b524c0709d151ec3a81138890f242ade8a8ac3a72c6dbcd

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 03bb9e993832a884e7dc7668eeb3f2fa41bbbbd2a92de0d68cac46e46ca11856
MD5 88f18f05f8a12b8c1c3097d25b657391
BLAKE2b-256 98eafa071da8c56307a0ca6511703d8bdc072f29fe9a9b1f9ea39fdea5f47d8a

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3c149e1cbd560f43cd3bd3211a2bcb68e302a2e83b21eedc1de199559db54eb4
MD5 6b1ce70086f6c4cdc937c71f66e45c71
BLAKE2b-256 a08c18a1eb9930658d891d4be4d54b929f29063808e1ba4cbc43db0fa2bec1c8

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 65bf2e059b682ff9355c533fe995d8db88f8a28b174228ac325d5e49b3d05255
MD5 bed72de9def4a78e08486e8450a3b6b5
BLAKE2b-256 12c992518288bd4faa6bcd9ae41aba61e4a5857841e10db0b90ac8e3f395981a

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp310-cp310-win_amd64.whl.

File metadata

  • Download URL: affine_mpc-0.1.0-cp310-cp310-win_amd64.whl
  • Upload date:
  • Size: 540.0 kB
  • Tags: CPython 3.10, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for affine_mpc-0.1.0-cp310-cp310-win_amd64.whl
Algorithm Hash digest
SHA256 c58fd9e2bde8cd79167d276ca0f29e86f3ab48b3e79bfa9339846b30f9cc2d9f
MD5 0f2ab7402266d7d2b2476862d8d48e57
BLAKE2b-256 3535fc72631cf3cf1a10536d7a9eaf78815717b6eaaff8add2dbf1a074dddc78

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0e50d0ae04c748efdd75e6a51b218e5d1137639bd726a71e087d428dbdcb411a
MD5 c8ee674f6cac9c197d742f80f393ca23
BLAKE2b-256 42a74091ad5651ceaba8636f72d0a31a287b0c13032be3a60316d31a0c09d0fc

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 8925c3ddccfd1e4d301682a97d33781f57fac70505cf24d6dbf674d427ca959e
MD5 539b6a041a14ddc8e8d76fbbd7a9df00
BLAKE2b-256 a57b830a129883e75d0319733469a27335a5866fb0db6ef17e03fb6aac602015

See more details on using hashes here.

File details

Details for the file affine_mpc-0.1.0-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for affine_mpc-0.1.0-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c853e313aab5935e0a5db599fc52b87f7a23b604c3e6784203c0e60e27b74cfe
MD5 cba5ca1e3574449d116b736320b62f93
BLAKE2b-256 b7f6d20fe8875c1c3f5e28e2ffb0a3f8e16bc42bf6ac28da006aef4bf8f5ce83

See more details on using hashes here.

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