--- id: casadi version: "3.7.2" license: GNU Lesser General Public License v3 or later (LGPLv3+) license_treatment: copyleft maintenance: active --- # casadi — CasADi -- framework for algorithmic differentiation and numeric optimization License: copyleft · Maintenance: active · Downloads: 1.5M/mo ## What it is and what it does CasADi is a symbolic computation and optimization framework written in C++ with Python bindings. It provides automatic differentiation, allowing you to define optimization problems symbolically and have gradients computed automatically. The package is designed for researchers and engineers working on nonlinear optimization, optimal control, and algorithmic differentiation tasks where you need to compute derivatives efficiently without hand-coding them. The framework depends only on numpy at runtime and offers prebuilt wheels for Python 2.7 and 3.4–3.12 across macOS, Windows, and Linux. It has been in production use since 2017 and maintains active development. The copyleft license means that if you modify CasADi itself, those changes must remain open-source; using it unmodified in a proprietary application is permitted but may require review of your use case. Use it for: - Define and solve nonlinear optimization problems with automatic gradient computation - Implement optimal control algorithms where symbolic differentiation reduces implementation burden - Perform sensitivity analysis and parameter optimization in scientific computing workflows - Build embedded optimization routines for real-time control systems ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. CasADi is a framework for algorithmic differentiation and numeric optimization, providing symbolic computation and automatic differentiation capabilities for optimization problems. Yes, if you need symbolic optimization with automatic differentiation. CasADi is actively maintained, has no known vulnerabilities, and offers broad platform support. The main consideration is the copyleft license: if you're building proprietary software, verify that using an unmodified library under LGPLv3+ aligns with your licensing strategy, or contact the maintainers about commercial options. ## Install pip install casadi uv add casadi poetry add casadi ## Installing casadi Before you install: Medium install friction due to compiled C++ bindings, but prebuilt wheels are available for common Python versions (2.7, 3.10–3.12) and platforms (macOS, Windows, Linux). The project is actively maintained with a recent commit history and no known vulnerabilities. License in practice: Licensed under LGPLv3+, a copyleft license requiring that derivative works and modifications remain open-source under the same license. Proprietary projects using CasADi must either comply with these terms or obtain a commercial license. Quickstart: pip install casadi import casadi as ca import numpy as np # Define a simple optimization variable x = ca.SX.sym('x') # Define objective and solve objective = (x - 2)**2 solver = ca.nlpsol('solver', 'ipopt', {'x': x, 'f': objective}) result = solver(x0=0) Requires a working C++ compiler or prebuilt wheel for your Python version and platform; wheels are provided for Python 2.7 and 3.4–3.12 on common architectures. Verify before relying: - Whether CasADi's symbolic computation model is suitable for real-time or embedded optimization tasks - Performance characteristics compared to other automatic differentiation frameworks for large-scale problems - Availability of commercial licensing options for proprietary use ## Package facts - License: GNU Lesser General Public License v3 or later (LGPLv3+) (copyleft) - Python support: unspecified - Install friction: medium - Maintenance: active - Downloads: 1.5M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags automatic differentiation python, symbolic optimization framework, numeric optimization library, algorithmic differentiation tool, nonlinear optimization casadi, symbolic math computation, gradient computation framework, optimization, automatic-differentiation, symbolic-computation [View on SkillFed](https://skillfed.io/packages/casadi) · [View on PyPI](https://pypi.org/project/casadi/)