{"id":48455612,"url":"https://alphaville.github.io/optimization-engine/","last_synced_at":"2026-04-07T20:01:00.330Z","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":"2026-03-31T13:31:37.000Z","size":61034,"stargazers_count":619,"open_issues_count":11,"forks_count":68,"subscribers_count":13,"default_branch":"master","last_synced_at":"2026-03-31T15:09:22.769Z","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":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2018-11-28T09:38:23.000Z","updated_at":"2026-03-31T13:39:57.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":61,"template":false,"template_full_name":null,"purl":"pkg:github/alphaville/optimization-engine","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","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alphaville%2Foptimization-engine/sbom","scorecard":{"id":186711,"data":{"date":"2025-08-11","repo":{"name":"github.com/alphaville/optimization-engine","commit":"54a35b81fa076b2c9d1c71efc44f0c0f7e0ad4bd"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.7,"checks":[{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":6,"reason":"8 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Code-Review","score":3,"reason":"Found 1/3 approved changesets -- score normalized to 3","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/ci.yml:1","Warn: no topLevel permission defined: .github/workflows/clippy.yml:1","Warn: no topLevel permission defined: .github/workflows/dox.yml:1","Warn: no topLevel permission defined: .github/workflows/rustfmt.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE-APACHE:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:27: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:59: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:61: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/ci.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/ci.yml:66: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/ci.yml:69: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/ci.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/clippy.yml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/clippy.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/clippy.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/clippy.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/clippy.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/clippy.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/dox.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/dox.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/dox.yml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/dox.yml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/rustfmt.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/rustfmt.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/rustfmt.yml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/rustfmt.yml/master?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/rustfmt.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/alphaville/optimization-engine/rustfmt.yml/master?enable=pin","Warn: containerImage not pinned by hash: docker/Dockerfile:18: pin your Docker image by updating debian:stable to debian:stable@sha256:e9f62364e0cfd9269cbc422be431ac496e22c98c5401ddf03701638a280b398d","Warn: downloadThenRun not pinned by hash: docker/Dockerfile:36-50","Warn: pipCommand not pinned by hash: docker/Dockerfile:37-51","Warn: pipCommand not pinned by hash: docker/Dockerfile:37-51","Warn: pipCommand not pinned by hash: docker/Dockerfile:37-51","Warn: pipCommand not pinned by hash: ci/install.sh:8","Warn: pipCommand not pinned by hash: ci/install.sh:9","Warn: pipCommand not pinned by hash: ci/script.sh:33","Warn: pipCommand not pinned by hash: ci/script.sh:42","Warn: pipCommand not pinned by hash: ci/script.sh:45","Warn: pipCommand not pinned by hash: ci/sphinx-documentation.sh:26","Warn: pipCommand not pinned by hash: ci/sphinx-documentation.sh:27","Warn: pipCommand not pinned by hash: ci/sphinx-documentation.sh:31","Warn: pipCommand not pinned by hash: open-codegen/publish-pypi.sh:15","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   9 third-party GitHubAction dependencies pinned","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   1 downloadThenRun dependencies pinned","Info:   0 out of  12 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Branch-Protection","score":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-16T19:55:39.948Z","repository_id":37973701,"created_at":"2025-08-16T19:55:39.949Z","updated_at":"2025-08-16T19:55:39.949Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31526666,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":"2026-04-06T23:00:18.807Z","updated_at":"2026-04-07T20:01:00.287Z","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=\"250\"\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/workflows/ci.yml?query=branch%3Amaster\"\u003e\n    \u003cimg alt=\"CI on master\" src=\"https://github.com/alphaville/optimization-engine/actions/workflows/ci.yml/badge.svg?branch=master\"\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  \u003cbr\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  \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\n\nOptimization Engine (OpEn) is a solver for Fast \u0026 Accurate Embedded Optimization for next-generation Robotics and Autonomous Systems. Read on to see how you can use OpEn on your robot today.\n\n**Documentation available at** [**alphaville.github.io/optimization-engine**](https://alphaville.github.io/optimization-engine/)\n\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 nonlinear model predictive control** and **moving horizon estimation**\n- Robotics and advanced manufacturing \n- Autonomous (aerial/ground) vehicles\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 [Python interface](https://alphaville.github.io/optimization-engine/docs/python-interface) of OpEn, `opengen`, to generate Rust code for your parametric optimizer. The optimizer can then be called from Python, used as a solver in Rust, consumed as a service over TCP (even remotely), or used in ROS on your robot.\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/docs/website/static/img/e8f236af8d38.gif\" alt=\"Fast NMPC of MAV\" width=\"55%\"/\u003e\n\n\n## Optimal Control\n\nOptimal control problems can now be set up directly from their natural ingredients: dynamics, prediction horizon, stage cost, terminal cost, and constraints. You can easily choose between a single or multiple shooting formulation. The solver is parametrizable, so you don't have to recompile whenever a parameter changes.\n\nOpEn allows to solve optimal control problems of the form\n\n\u003cimg width=\"489\" height=\"207\" alt=\"image\" src=\"https://github.com/user-attachments/assets/10efdcd8-2386-4956-bdce-e2a7b7961c73\" /\u003e\n\nHere is a minimal Python example (try it in [Google Colab](https://colab.research.google.com/drive/17vbVUbqcah9seIg17aN6bW0-T15FWrBo?usp=sharing)):\n\n\u003ca href=\"https://colab.research.google.com/drive/17vbVUbqcah9seIg17aN6bW0-T15FWrBo?usp=sharing\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Try it In Colab\"\u003e\n\u003c/a\u003e\n\n\n```python\nimport opengen as og\nimport casadi.casadi as cs\n\nocp = og.ocp.OptimalControlProblem(nx=2, nu=1, horizon=20)\nocp.add_parameter(\"x0\", 2)\nocp.add_parameter(\"xref\", 2, default=[0.0, 0.0])\n\nocp.with_dynamics(\n  lambda x, u, p: \n    cs.vertcat(x[1], -x[0] + u[0]))\n\nocp.with_stage_cost(\n  lambda x, u, p, t: \n    cs.dot(x - p[\"xref\"], x - p[\"xref\"]) \n    + 0.1 * cs.dot(u, u))\n\nocp.with_terminal_cost(\n  lambda x, p: \n    10.0 * cs.dot(x - p[\"xref\"], x - p[\"xref\"]))\n\nocp.with_input_constraints(og.constraints.BallInf(radius=1.))\n\noptimizer = og.ocp.OCPBuilder(\n    ocp, \n    meta=..., \n    build_config=..., \n    solver_config=...).build()\n\nresult = optimizer.solve(x0=[1.0, 0.0], xref=[0.0, 0.0])\n```\n\nSee the dedicated [OCP documentation](https://alphaville.github.io/optimization-engine/docs/python-ocp-1) for more details and examples.\n\n## General Parametric Optimization\n\n**OpEn** can solve nonconvex parametric optimization problems of the general form\n\n\u003cimg width=\"268\" height=\"137\" alt=\"standard parametric optimziation problem\" src=\"https://github.com/user-attachments/assets/22104383-34ae-480f-805f-bd764968184a\" /\u003e\n\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\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\u003ca href=\"https://colab.research.google.com/drive/14F6IQWo8Q65mIz5Ru4FGxRPqyFMRMyzE?usp=sharing\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"\u003e\n\u003c/a\u003e\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\n## Use the Solver in Rust\n\nYou can also use OpEn directly in Rust by defining a cost function, its gradient, and a set of constraints, then solving the problem.\n\nHere is a minimal Rust example:\n\n```rust\nuse optimization_engine::{constraints, panoc::*, Problem, SolverError};\n\nlet f = |u: \u0026[f64], c: \u0026mut f64| -\u003e Result\u003c(), SolverError\u003e {\n    *c = (1.0 - u[0]).powi(2) + 200.0 * (u[1] - u[0].powi(2)).powi(2);\n    Ok(())\n};\n\nlet df = |u: \u0026[f64], grad: \u0026mut [f64]| -\u003e Result\u003c(), SolverError\u003e {\n    grad[0] = 2.0 * (u[0] - 1.0) - 800.0 * u[0] * (u[1] - u[0].powi(2));\n    grad[1] = 400.0 * (u[1] - u[0].powi(2));\n    Ok(())\n};\n\nlet bounds = constraints::Ball2::new(None, 1.0);\nlet problem = Problem::new(\u0026bounds, df, f);\nlet mut cache = PANOCCache::new(2, 1e-8, 10);\nlet mut optimizer = PANOCOptimizer::new(problem, \u0026mut cache).with_max_iter(100);\nlet mut u = [-1.5, 0.9];\nlet status = optimizer.solve(\u0026mut u)?;\n```\n\nSee the dedicated [Rust documentation](https://alphaville.github.io/optimization-engine/docs/openrust-basic) for a full introduction and more complete examples.\nSee more Rust examples [here](rust/examples).\n\n## Check out next...\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- [Optimal control](https://alphaville.github.io/optimization-engine/docs/python-ocp-1)\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":["[Libraries](#contents)","**Solvers, Tools, and Libraries**"],"sub_categories":["[Motion Planning and Control](#contents)","Tools and Libraries"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/alphaville.github.io%2Foptimization-engine%2F","html_url":"https://awesome.ecosyste.ms/projects/alphaville.github.io%2Foptimization-engine%2F","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/alphaville.github.io%2Foptimization-engine%2F/lists"}