{"id":13445603,"url":"https://github.com/alphaville/optimization-engine","last_synced_at":"2025-05-14T08:08:31.929Z","repository":{"id":37973701,"uuid":"159477900","full_name":"alphaville/optimization-engine","owner":"alphaville","description":"Nonconvex embedded optimization: code generation for fast real-time optimization + ROS support","archived":false,"fork":false,"pushed_at":"2025-05-06T18:05:16.000Z","size":56341,"stargazers_count":549,"open_issues_count":26,"forks_count":57,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-06T18:37:46.816Z","etag":null,"topics":["code-generation","code-generator","embedded-optimization","embedded-systems","matlab-toolbox","model-predictive-control","mpc","nmpc","nonconvex","nonconvex-optimization","nonlinear-model-predictive-control","nonlinear-optimization","optimal-control","python","robotics","rust","rust-crate","rust-library","solver","solver-library"],"latest_commit_sha":null,"homepage":"https://alphaville.github.io/optimization-engine/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"korken89/panoc-rs","license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alphaville.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"docs/contributing.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-28T09:38:23.000Z","updated_at":"2025-05-04T11:07:52.000Z","dependencies_parsed_at":"2023-09-26T19:15:32.840Z","dependency_job_id":"3b221b36-e4ae-4a99-b49e-fc89fcafb9c8","html_url":"https://github.com/alphaville/optimization-engine","commit_stats":{"total_commits":1224,"total_committers":23,"mean_commits":53.21739130434783,"dds":"0.23529411764705888","last_synced_commit":"d302884052f7ccab52a5fc71dc3c795cca008661"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaville%2Foptimization-engine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaville%2Foptimization-engine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaville%2Foptimization-engine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaville%2Foptimization-engine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alphaville","download_url":"https://codeload.github.com/alphaville/optimization-engine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254101558,"owners_count":22014908,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["code-generation","code-generator","embedded-optimization","embedded-systems","matlab-toolbox","model-predictive-control","mpc","nmpc","nonconvex","nonconvex-optimization","nonlinear-model-predictive-control","nonlinear-optimization","optimal-control","python","robotics","rust","rust-crate","rust-library","solver","solver-library"],"created_at":"2024-07-31T05:00:36.430Z","updated_at":"2025-05-14T08:08:26.919Z","avatar_url":"https://github.com/alphaville.png","language":"Rust","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://alphaville.github.io/optimization-engine/\"\u003e\n    \u003cimg alt=\"OpEn logo\" src=\"design/optimization-engine.png\" width=\"400\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://www.codefactor.io/repository/github/alphaville/optimization-engine\"\u003e\u003cimg src=\"https://www.codefactor.io/repository/github/alphaville/optimization-engine/badge\" alt=\"CodeFactor\" /\u003e\n  \u003c/a\u003e \n  \u003ca href=\"https://github.com/alphaville/optimization-engine/actions?query=branch%3Amaster\"\u003e\n    \u003cimg alt=\"GHA continuous integration\" src=\"https://github.com/alphaville/optimization-engine/workflows/Continuous%20integration/badge.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://ci.appveyor.com/project/alphaville/optimization-engine/branch/master\"\u003e\n    \u003cimg alt=\"build status\" src=\"https://ci.appveyor.com/api/projects/status/fy9tr4xmqq3ka4aj/branch/master?svg=true\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://lbesson.mit-license.org/\"\u003e\n    \u003cimg alt=\"MIT license\" src=\"https://img.shields.io/badge/License-MIT-blue.svg\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://github.com/alphaville/optimization-engine/blob/master/LICENSE-APACHE\"\u003e\n    \u003cimg alt=\"Apache v2 license\" src=\"https://img.shields.io/badge/License-Apache%20v2-blue.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://gitter.im/alphaville/optimization-engine?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\"\u003e\n    \u003cimg alt=\"Gitter\" src=\"https://badges.gitter.im/alphaville/optimization-engine.svg\"\u003e\n  \u003c/a\u003e\n   \u003ca href=\"https://twitter.com/intent/tweet?text=Fast%20and%20accurate%20nonconvex%20optimization\u0026url=https://alphaville.github.io/optimization-engine/\u0026via=isToxic\u0026hashtags=optimization,rustlang,matlab,python\"\u003e\n    \u003cimg alt=\"Tweet\" src=\"https://img.shields.io/twitter/url/http/shields.io.svg?style=social\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://discord.gg/mfYpn4V\"\u003e\n    \u003cimg alt=\"Chat on Discord\" src=\"https://img.shields.io/badge/chat-on%20discord-gold.svg\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\nOptimization Engine (OpEn) is a solver for Fast \u0026 Accurate Embedded Optimization for next-generation Robotics and Autonomous Systems.\n\n**Documentation available at** [**alphaville.github.io/optimization-engine**](https://alphaville.github.io/optimization-engine/)\n\n## Table of contents\n\n- [Features](#features)\n- [Demos](#demos)\n  - [Code generation](#code-generation)\n  - [Embedded applications](#embedded-applications)\n- [Parametric optimization problems](#parametric-problems)\n- [Code generation example](#code-generation-example)\n- [Getting started](#getting-started)\n- [Contact](#contact-us)\n- [Show us your love](#do-you-like-open)\n- [Licence](#license)\n- [Core team](#core-team)\n- [Contributions](#contributions)\n- [Cite OpEn](#citing-open)\n\n## Features\n\n**OpEn** is the counterpart of CVXGen for nonconvex problems.\n\n- Fast nonconvex parametric optimization\n- Numerical algorithm written in Rust\n- Provably safe memory management\n- Auto-generation of ROS packages\n\n**OpEn** is ideal for:\n\n- Embedded **Nonlinear Model Predictive Control**,\n- Embedded **Nonlinear Moving Horizon Estimation** and their applications in \n- Robotics and Advanced Manufacturing Systems\n- Autonomous vehicles\n- Aerial Vehicles and Aerospace\n\n\n## Demos\n\n### Code generation\n\nCode generation? Piece of cake!\n\n**OpEn** generates parametric optimizer modules in Rust - it's blazingly fast - it's safe - it can run on embedded devices.\n\nYou can use the [MATLAB](https://alphaville.github.io/optimization-engine/docs/matlab-interface) or [Python interface](https://alphaville.github.io/optimization-engine/docs/python-interface) of OpEn to generate Rust code for your parametric optimizer.\n\nThis can then be called directly, using Rust, or, it can be consumed as a service over a socket.\n\n\u003cimg src=\"https://alphaville.github.io/optimization-engine/img/open-promo.gif\" alt=\"Easy Code Generation\" width=\"55%\"/\u003e\n\nYou can generate a parametric optimizer in just very few lines of code and in no time.\n\nOpEn allows application developers and researchers to focus on the challenges of the application, rather than the tedious task of solving the associated parametric optimization problems (as in nonlinear model predictive control).\n\n### Embedded applications\nOpEn can run on embedded devices; here we see it running on an intel Atom for the autonomous navigation of a lab-scale micro aerial vehicle - the controller runs at **20Hz** using only **15%** CPU!\n\n\u003cimg src=\"https://raw.githubusercontent.com/alphaville/optimization-engine/master/website/static/img/e8f236af8d38.gif\" alt=\"Fast NMPC of MAV\" width=\"55%\"/\u003e\n\n\n## Parametric Problems\n\n**OpEn** can solve nonconvex parametric optimization problems of the general form\n\n\u003cimg src=\"design/parametric_optimization.png\" alt=\"standard parametric optimziation problem\"/\u003e\n\nwhere *f* is a smooth cost, *U* is a simple - possibly nonconvex - set, *F\u003csub\u003e1\u003c/sub\u003e* and *F\u003csub\u003e2\u003c/sub\u003e* are nonlinear smooth mappings and *C* is a convex set ([read more](https://alphaville.github.io/optimization-engine/docs/open-intro)).\n\n## Code Generation Example\n\nCode generation in **Python** in just a few lines of code (read the [docs](https://alphaville.github.io/optimization-engine/docs/python-examples) for details)\n\n```python\nimport opengen as og\nimport casadi.casadi as cs\n\n# Define variables\n# ------------------------------------\nu = cs.SX.sym(\"u\", 5)\np = cs.SX.sym(\"p\", 2)\n\n# Define cost function and constraints\n# ------------------------------------\nphi = og.functions.rosenbrock(u, p)\nf2 = cs.vertcat(1.5 * u[0] - u[1],\n                cs.fmax(0.0, u[2] - u[3] + 0.1))\nbounds = og.constraints.Ball2(None, 1.5)\nproblem = og.builder.Problem(u, p, phi) \\\n    .with_penalty_constraints(f2)       \\\n    .with_constraints(bounds)\n    \n# Configuration and code generation\n# ------------------------------------\nbuild_config = og.config.BuildConfiguration()  \\\n    .with_build_directory(\"python_test_build\") \\\n    .with_tcp_interface_config()\nmeta = og.config.OptimizerMeta()\nsolver_config = og.config.SolverConfiguration()    \\\n    .with_tolerance(1e-5)                          \\\n    .with_constraints_tolerance(1e-4)\nbuilder = og.builder.OpEnOptimizerBuilder(problem, meta,\n                                          build_config, solver_config)\nbuilder.build()\n```\n\nCode generation in a few lines of **MATLAB** code (read the [docs](https://alphaville.github.io/optimization-engine/docs/matlab-interface) for details)\n\n```matlab\n% Define variables\n% ------------------------------------\nu = casadi.SX.sym('u', 5);\np = casadi.SX.sym('p', 2);\n\n% Define cost function and constraints\n% ------------------------------------\nphi = rosenbrock(u, p);\nf2 = [1.5*u(1) - u(2);\n      max(0, u(3)-u(4)+0.1)];\n\nbounds = OpEnConstraints.make_ball_at_origin(5.0);\n\nopEnBuilder = OpEnOptimizerBuilder()...\n    .with_problem(u, p, phi, bounds)...\n    .with_build_name('penalty_new')...\n    .with_fpr_tolerance(1e-5)...\n    .with_constraints_as_penalties(f2);\n\nopEnOptimizer = opEnBuilder.build();\n```\n\n\n## Getting started\n\n- [More information about OpEn](https://alphaville.github.io/optimization-engine/docs/open-intro)\n- [Quick installation guide](https://alphaville.github.io/optimization-engine/docs/installation)\n- [OpEn in Rust](https://alphaville.github.io/optimization-engine/docs/openrust-basic)\n- [OpEn in Python](https://alphaville.github.io/optimization-engine/docs/python-interface) ([Examples](https://alphaville.github.io/optimization-engine/docs/python-examples))\n- [OpEn in MATLAB](https://alphaville.github.io/optimization-engine/docs/matlab-interface) ([Examples](https://alphaville.github.io/optimization-engine/docs/matlab-examples))\n- [OpEn+Jupyter in Docker](https://alphaville.github.io/optimization-engine/docs/docker)\n- [Generation of ROS packages](https://alphaville.github.io/optimization-engine/docs/python-ros)\n- [Call OpEn in C/C++](https://alphaville.github.io/optimization-engine/docs/python-c)\n- [TCP/IP interface of OpEn](https://alphaville.github.io/optimization-engine/docs/python-tcp-ip)\n- [Frequently asked questions](https://alphaville.github.io/optimization-engine/docs/faq)\n\n## Contact us\n\n- **Join the discussion on [Discord](https://discord.gg/mfYpn4V)**\n- Reach us on [Gitter](https://gitter.im/alphaville/optimization-engine)\n\n## Do you like OpEn?\n\nShow us with a star on github...\n\n![Star](https://media.giphy.com/media/ZxblqUVrPVmcqATkC4/giphy.gif)\n\n## License\n\nOpEn is a free open source project. You can use it under the terms of either [Apache license v2.0](LICENSE-APACHE) or [MIT license](LICENSE-MIT).\n\n\n## Core Team\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\" valign=\"top\"\u003e\n        \u003cimg width=\"150\" height=\"150\" src=\"https://github.com/alphaville.png?s=100\"\u003e\n        \u003cbr\u003e\n        \u003ca href=\"https://alphaville.github.io\"\u003ePantelis Sopasakis\u003c/a\u003e \n      \u003c/td\u003e\n      \u003ctd align=\"center\" valign=\"top\"\u003e\n        \u003cimg width=\"150\" height=\"150\" src=\"https://github.com/korken89.png?s=100\"\u003e\n        \u003cbr\u003e\n        \u003ca href=\"https://github.com/korken89\"\u003eEmil Fresk\u003c/a\u003e     \n      \u003c/td\u003e\n     \u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n\n## Contributions\n\nUnless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.\n\nBefore you contribute to Optimization Engine, please read our [contributing guidelines](https://alphaville.github.io/optimization-engine/docs/contributing).\n\nA list of contributors is automatically generated by github [here](https://github.com/alphaville/optimization-engine/graphs/contributors).\n\n\n\n## Citing OpEn\n\nPlease, cite OpEn as follows ([arXiv version](https://arxiv.org/abs/2003.00292)):\n\n```\n@inproceedings{open2020,\n  author=\"P. Sopasakis and E. Fresk and P. Patrinos\",\n  title=\"{OpEn}: Code Generation for Embedded Nonconvex Optimization\",\n  booktitle=\"IFAC World Congress\",\n  year=\"2020\",\n  address=\"Berlin\"\n}\n```\n","funding_links":[],"categories":["7. Control","Libraries","Planning and Control","Scientific Computation"],"sub_categories":["3.4 High Performance Inference","Computation","Vector Map"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphaville%2Foptimization-engine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falphaville%2Foptimization-engine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falphaville%2Foptimization-engine/lists"}