Casadi

Latest version: v3.6.5

Safety actively analyzes 630305 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 2 of 16

3.5.5

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):
<table>
<tr><th></th><th>Windows</th><th>Linux</th><th>Mac (High Sierra or above)</th></tr>
<tr>
<th>Matlab</th>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-matlabR2016a-v3.5.5.zip">R2016a</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-matlabR2014b-v3.5.5.zip">R2014b</a>,<br /> <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-matlabR2014a-v3.5.5.zip">R2014a</a>,<br /> <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-matlabR2013a-v3.5.5.zip">R2013a</a> or R2013b</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-matlabR2014b-v3.5.5.tar.gz">R2014b</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-matlabR2014a-v3.5.5.tar.gz">R2014a</a></td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-osx-matlabR2015a-v3.5.5.tar.gz">R2015a</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-osx-matlabR2014b-v3.5.5.tar.gz">R2014b</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-osx-matlabR2014a-v3.5.5.tar.gz">R2014a</a></td>
</tr>
<tr>
<th>Octave</th>
<td> 4.4.1 (<a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-octave-4.4.1-w32-v3.5.5.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-octave-4.4.1-w64-v3.5.5.zip">64bit</a>), <br /> 4.4.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-octave-4.4.0-w32-v3.5.5.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-octave-4.4.0-w64-v3.5.5.zip">64bit</a>),
<br /> 5.1.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-octave-5.1.0-w32-v3.5.5.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-octave-5.1.0-w64-v3.5.5.zip">64bit</a>),
<br /> 5.2.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-octave-5.2.0-w32-v3.5.5.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-octave-5.2.0-w64-v3.5.5.zip">64bit</a>),
<br /> 6.1.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-octave-6.1.0-w32-v3.5.5.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-octave-6.1.0-w64-v3.5.5.zip">64bit</a>)</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-octave-4.4.1-v3.5.5.tar.gz">4.4.1</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-octave-5.1.0-v3.5.5.tar.gz">5.1.0</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-octave-5.2.0-v3.5.5.tar.gz">5.2.0</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-octave-6.1.0-v3.5.5.tar.gz">6.1.0</a></td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-osx-octave-5.2.0-v3.5.5.tar.gz">5.2.0</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-osx-octave-6.1.0-v3.5.5.tar.gz">6.1.0</a>(Mojave or higher)</td>
</tr>
<tr>
<th rowspan="2">Python</th>
<td>Py27 (<a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-py27-v3.5.5.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-py27-v3.5.5-64bit.zip">64bit</a><sup>*</sup>),<br /> Py35 (<a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-py35-v3.5.5.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-py35-v3.5.5-64bit.zip">64bit</a><sup>*</sup>),<br /> Py36 (<a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-py36-v3.5.5.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-py36-v3.5.5-64bit.zip">64bit</a><sup>*</sup>),<br /> Py37 (<a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-py37-v3.5.5.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-py37-v3.5.5-64bit.zip">64bit</a><sup>*</sup>),<br /> Py38 (<a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-py38-v3.5.5.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-py38-v3.5.5-64bit.zip">64bit</a><sup>*</sup>)<br /> Py39 (<a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-py39-v3.5.5.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-windows-py39-v3.5.5-64bit.zip">64bit</a><sup>*</sup>)</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-py27-v3.5.5-64bit.tar.gz">Py27</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-py35-v3.5.5-64bit.tar.gz">Py35</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-py36-v3.5.5-64bit.tar.gz">Py36</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-py37-v3.5.5-64bit.tar.gz">Py37</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-py38-v3.5.5-64bit.tar.gz">Py38</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-linux-py39-v3.5.5-64bit.tar.gz">Py39</a></td>
<td> <a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-osx-py27-v3.5.5.tar.gz">Py27</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-osx-py35-v3.5.5.tar.gz">Py35</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-osx-py36-v3.5.5.tar.gz">Py36</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-osx-py37-v3.5.5.tar.gz">Py37</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-osx-py38-v3.5.5.tar.gz">Py38</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.5/casadi-osx-py39-v3.5.5.tar.gz">Py39</a></td>
</tr>
<tr>
<td colspan="3">or just <code>pip install casadi</code> (needs <code>pip -V</code>>=8.1)</td>
</tr>
</table>

(<sup>*</sup>) Check your Python console if you need 32bit or 64bit - bitness should be printed at startup.

Unzip in your home directory and adapt the path:
<table>
<tr><th>Matlab/Octave</th><th>Python</th><tr>
<tr><td>
<pre>
<code>
addpath('&lt;yourpath>/casadi-matlabR2014a-v3.5.5')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))
</code>
</pre>
</td><td>

<pre>
<code>
from sys import path
path.append(r"&lt;yourpath>/casadi-py27-v3.5.5")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))
</code>
</pre>
</td></tr>
</table>

Get started with the [example pack](https://github.com/casadi/casadi/releases/download/3.5.5/casadi-example_pack-v3.5.5.zip).

Troubleshooting


Release notes

CasADi Functions
* CasADi Functions can be serialized now ([308](https://github.com/casadi/casadi/issues/308)).


f.save('f.casadi') % Dump any CasADi Function to a file
f = Function.load('f.casadi') % Loads back in


This enables easy sharing of models/solver isntances beteen Matlab/Python/C++ cross-platform, and enables a form of [parallelization](https://web.casadi.org/blog/parfor/).


* You can now evaluate CasADi Functions from C [without requiring code-generation](https://github.com/casadi/casadi/blob/develop/docs/examples/cplusplus/c_api_usage.cpp). This makes it possible to embed CasADi computations in Fortran, Julia, FMI, ...
* All CasADi Functions support timing information now (`print_time`, default true for QP and NLP solvers). Use `record_time` to make timings available through `f.stats()` without printing them.
* `map` with reduce arguments now has an efficient implementation (no copying/repmat)
* Low-overhead Callback eval support was [changed](https://github.com/casadi/casadi/issues/2271) to `eval_buffer`
* `FunctionInternal::finalize` no longer takes options dict.
* Options `always_inline` and `never_inline` were added
* Options `is_diff_in` and `is_diff_out` were added
* (3.5.2) Ctrl-C interrupts are now disabled in multi-threaded Maps since they could result in crashes
* (3.5.2) Sparsity of Callbacks can be set with `has_jacobian_sparsity/get_jacobian_sparsity`
* (3.5.2) Jitted functions can now be serialized
* (3.5.2) BSpline constructor takes an inline option yielding a fully differentiable (but not very scalable) BSpline operation for MX
* (3.5.5) Fixed performance deficiency in inline BSline derivatives

CasADi expressions
* **breaking**: `IM` type is removed from public API (was used to represent integer sparse matrices). Use `DM` instead.
* **breaking**: `linspace(0,1,3)` and `linspace(0.0,1,3)` now both return `[0 0.5 1]` instead of `[0 0 1]` for the former
* `MX` supports slicing with `MX` now (symbolic indexing).
* Issue [2364](https://github.com/casadi/casadi/issues/2364):
- **breaking**: `veccat` of an empty list now returns `0-by-1` instead of `0-by-0`.
- `jtimes` output dimensions have changed when any of the arguments is empty.
- NLP function object's 'lam_p' is now `0-by-1` in case of missing parameters.
* (3.5.2) Fixed long-standing bug in `cosh` derivative
* (3.5.2) An MX operation `convexify` was added
* (3.5.2) An inefficiency in MX multiplication sparsity was detected and fixed by Mirko Hahn

Interpolation functionality
* Support for parametric (=changeable only, but not differentiable) grid and/or coefficients for linear/spline interpolation
* for `interpolant`, new constructors where added that takes dimensions instead of concrete vectors
* Support for symbolic (differentiable) grid and coefficients for linear interpolation (set `inline` option to true).

Python specific
* Overhead-less CasADi Function evaluation API [added](https://github.com/casadi/casadi/commit/3e9919e9195e8f057d09cd9bcc4f7fa59e6fc104#diff-ad1e1bf2c8d8bef2a0f3b3b85331ffd0R2491) through Python memoryviews
* Similar functionality in Callbacks
* (3.5.2) fix numpy compatibility (numpy 1.19)
* (3.5.3) fix the numpy fix

Matlab/Octave specific
* **breaking**: `a(:)=b` now behaves like Matlab builtin matrices when `a` is a CasADi matrix. Before, only the first column of `a` would be touched by this statement. ([2363](https://github.com/casadi/casadi/issues/2363))
* **breaking**: Fixed bug where `MX` constructor treated a numeric row vector as column vector. Now `size(MX(ones(1,4)))` returns `(1,4)` as expected. ([2366](https://github.com/casadi/casadi/issues/2366))
* Can now use spy directly on `DM`,`MX`,`SX`
* (3.5.2) Printing from a multi-threaded map context is disabled beause it could result in crashes. In linux, you may still see the output from a terminal used to start Matlab

Opti
* Opti supports conic problems now: `Opti('conic')`
* One can now easily obtain a parametric solution as a CasADi Function from an Opti instance:


opti = Opti()
x = opti.variable()
y = opti.variable()
p = opti.parameter()

opti.minimize(y**2+sin(x-y-p)**2)
opti.subject_to(x+y>=1)

opti.solver(nlpsolver,nlpsolver_options)

F = opti.to_function("F",[x,p,opti.lam_g],[x,y])

r = F(0,0.1,0)

(3.5.1) Improved support for vertcatted inputs to `to_function`
* Using Opti together with `max_iter` is more natural now: use `solve_limited()` to avoid exceptions to be raised when iterations or time runs out. No need to try/catch.

Code-generation
* **breaking**: `external` now looks for a `.dylib` file, not `.so` for mac
* **breaking**: Codegen API has changes related to thread-local memory:
* `void* mem` changed to `int mem`
* `alloc_mem`, `init_mem`, `free_mem` have been purged. `checkout` and `release` replace them.


int mem = checkout();
eval(arg, res, iw, w, mem);
release(mem);


* Codegen 'CODEGEN_PREFIX' has been renamed to 'CASADI_CODEGEN_PREFIX'
* QP solvers (QRQP, OSQP) and SqpMethod codegenerate now. This means that embedded MPC with CasADi is now more practical.
* Runge-Kutta and Collocation Integrator objects can be inlined into code-generatable MX Function with the 'simplify' option.
* (3.5.1) an important flaw was corrected that caused incorrect code for expression graphs with logical 'and' and 'or'.
* (3.5.1) fixed regression for expression graphs containing inf/nan
* (3.5.2) fixed bug of a division looking like a comment
* (3.5.2) fixed `mem.h` regression
* (3.5.2) Made `main` and mex-related functions `c89`-compliant

Solvers
* **breaking**: NLP solvers - `bound_consistency`, an option to post-process the primal and dual solution by projecting it on the bounds, introduced in 3.4, was changed to default `off`
* Sundials was patched to support multi-threading
* WORHP was bumped to v1.13
* SNOPT was bumped to v7.7
* SuperSCS (conic solver) was added
* OSQP (QP solver) was added
* CBC (LP solver) was added
* (3.5.3) AMPL was fixed to allow other solvers than IPOPT

* **breaking**: SQP Method
* `regularize_margin` option was added
* `regularize` (bool) option was removed. To get the effect of `regularize=true`, specify `convexify_strategy='regularize'`. Other strategies include clipping eigenvalues.
* line search was reverted from a custom designed thing, to standard textbook L1
* CPLEX and Gurobi got support for sos constraints
* Conic/qpsol interface extended for semidefinite programming and SOCP
* Solvers supporting SOCP: `Gurobi`, `SuperSCS`, `CPLEX`
* **breaking**: Newton Rootfinder now supports a `line_search` option (default true)
* Rootfinder now throws an exception by default ('error_on_fail' option true) when failing to converge
* (3.5.5) Implemented constraints in IDAS and step size limits in CVODES/IDAS integrators

Convenience tools
* Debugging facilities:
- Function options `print_in`/`print_in` print inputs/outputs when numerically evaluating a function
- Function option `dump_in`/`dump_out` dumps to the file system
- Function option `dump` dumps the function itself (loadable with `Function.load`)
* `DM.from_file` and `DM.to_file` with a `MatrixMarket` and `txt` support
* Helping interaction with codegen with `main=true`: `Function.generate_in`/`Function.nz_from_in`/`Function.nz_to_in` to help creating input text files.
* `Function.convert_in`/`Function.convert_out` to switch between list and dictionary arguments/results

Binaries
* (3.5.1) Mac binaries for Matlab was switched to a different build environment. The binaries now require High Sierra or above, and work on Catalina.
* (3.5.4) Mac binaries for Python and octave have been switched just like Matlab
* (3.5.4) Linux binaries for Matlab and Octave have been switched to the manylinux environment, with gfortran dependency now grafted in (included, with a unique alias to avoid name collision)

Third-party solver interfaces in binaries

Versions used in binaries ( see [FAQ](https://github.com/casadi/casadi/wiki/FAQ:-how-to-get-third-party-solvers-to-work%3F) ):

<table>
<tr><th>software</th><th>version</th> <th>library</th> <th>license env </th><th>build env </th></tr>
<tr><td> IPOPT </td><td> 3.12.3 </td><td> shipped </td><td> /</td><td> / </td></tr>
<tr><td> SNOPT </td><td> 7.7 </td><td> libsnopt7.so/snopt7.dll</td><td> SNOPT_LICENSE </td><td> SNOPT</td></tr>
<tr><td> WORHP </td><td> 1.13</td><td> libworhp.so/worhp.dll </td><td> WORHP_LICENSE_FILE</td><td> WORHP</td></tr>
<tr><td> KNITRO </td><td> 10.3 </td><td> libknitro1030.so/knitro1032.dll </td><td> / </td><td> KNITRO </td></tr>
<tr><td> CPLEX </td><td> windows/mac: 12.8.0, linux:12.6.3 </td><td> libcplex1263.so / libcplex1280.dll </td><td> ILOG_LICENSE_FILE </td><td> CPLEX </td></tr>
<tr><td> GUROBI </td><td> 6.5.0 </td><td> libgurobi65.so/gurobi65.dll </td><td> GRB_LICENSE_FILE </td><td> GUROBI_HOME</td></tr>
</table>

3.5.4

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):
<table>
<tr><th></th><th>Windows</th><th>Linux</th><th>Mac (High Sierra or above)</th></tr>
<tr>
<th>Matlab</th>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-matlabR2016a-v3.5.4.zip">R2016a</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-matlabR2014b-v3.5.4.zip">R2014b</a>,<br /> <a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-matlabR2014a-v3.5.4.zip">R2014a</a>,<br /> <a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-matlabR2013a-v3.5.4.zip">R2013a</a> or R2013b</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-linux-matlabR2014b-v3.5.4.tar.gz">R2014b</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-linux-matlabR2014a-v3.5.4.tar.gz">R2014a</a></td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-osx-matlabR2015a-v3.5.4.tar.gz">R2015a</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-osx-matlabR2014b-v3.5.4.tar.gz">R2014b</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-osx-matlabR2014a-v3.5.4.tar.gz">R2014a</a></td>
</tr>
<tr>
<th>Octave</th>
<td> 4.4.1 (<a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-octave-4.4.1-w32-v3.5.4.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-octave-4.4.1-w64-v3.5.4.zip">64bit</a>), <br /> 4.4.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-octave-4.4.0-w32-v3.5.4.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-octave-4.4.0-w64-v3.5.4.zip">64bit</a>),
<br /> 5.1.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-octave-5.1.0-w32-v3.5.4.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-octave-5.1.0-w64-v3.5.4.zip">64bit</a>),
<br /> 5.2.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-octave-5.2.0-w32-v3.5.4.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-octave-5.2.0-w64-v3.5.4.zip">64bit</a>)</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-linux-octave-4.4.1-v3.5.4.tar.gz">4.4.1</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-linux-octave-4.2.2-v3.5.4.tar.gz">4.2.2</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-linux-octave-5.1.0-v3.5.4.tar.gz">5.1.0</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-linux-octave-5.2.0-v3.5.4.tar.gz">5.2.0</a></td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-osx-octave-5.2.0-v3.5.4.tar.gz">5.2.0</a></td>
</tr>
<tr>
<th rowspan="2">Python</th>
<td>Py27 (<a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-py27-v3.5.4.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-py27-v3.5.4-64bit.zip">64bit</a><sup>*</sup>),<br /> Py35 (<a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-py35-v3.5.4.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-py35-v3.5.4-64bit.zip">64bit</a><sup>*</sup>),<br /> Py36 (<a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-py36-v3.5.4.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-py36-v3.5.4-64bit.zip">64bit</a><sup>*</sup>),<br /> Py37 (<a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-py37-v3.5.4.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-py37-v3.5.4-64bit.zip">64bit</a><sup>*</sup>),<br /> Py38 (<a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-py38-v3.5.4.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-windows-py38-v3.5.4-64bit.zip">64bit</a><sup>*</sup>)</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-linux-py27-v3.5.4-64bit.tar.gz">Py27</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-linux-py35-v3.5.4-64bit.tar.gz">Py35</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-linux-py36-v3.5.4-64bit.tar.gz">Py36</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-linux-py37-v3.5.4-64bit.tar.gz">Py37</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-linux-py38-v3.5.4-64bit.tar.gz">Py38</a></td>
<td> <a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-osx-py27-v3.5.4.tar.gz">Py27</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-osx-py35-v3.5.4.tar.gz">Py35</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-osx-py36-v3.5.4.tar.gz">Py36</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-osx-py37-v3.5.4.tar.gz">Py37</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.4/casadi-osx-py38-v3.5.4.tar.gz">Py38</a></td>
</tr>
<tr>
<td colspan="3">or just <code>pip install casadi</code> (needs <code>pip -V</code>>=8.1)</td>
</tr>
</table>

(<sup>*</sup>) Check your Python console if you need 32bit or 64bit - bitness should be printed at startup.

Unzip in your home directory and adapt the path:
<table>
<tr><th>Matlab/Octave</th><th>Python</th><tr>
<tr><td>
<pre>
<code>
addpath('&lt;yourpath>/casadi-matlabR2014a-v3.5.4')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))
</code>
</pre>
</td><td>

<pre>
<code>
from sys import path
path.append(r"&lt;yourpath>/casadi-py27-v3.5.4")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))
</code>
</pre>
</td></tr>
</table>

Get started with the [example pack](https://github.com/casadi/casadi/releases/download/3.5.4/casadi-example_pack-v3.5.4.zip).

Troubleshooting


Release notes

CasADi Functions
* CasADi Functions can be serialized now ([308](https://github.com/casadi/casadi/issues/308)).


f.save('f.casadi') % Dump any CasADi Function to a file
f = Function.load('f.casadi') % Loads back in


This enables easy sharing of models/solver isntances beteen Matlab/Python/C++ cross-platform, and enables a form of [parallelization](https://web.casadi.org/blog/parfor/).


* You can now evaluate CasADi Functions from C [without requiring code-generation](https://github.com/casadi/casadi/blob/develop/docs/examples/cplusplus/c_api_usage.cpp). This makes it possible to embed CasADi computations in Fortran, Julia, FMI, ...
* All CasADi Functions support timing information now (`print_time`, default true for QP and NLP solvers). Use `record_time` to make timings available through `f.stats()` without printing them.
* `map` with reduce arguments now has an efficient implementation (no copying/repmat)
* Low-overhead Callback eval support was [changed](https://github.com/casadi/casadi/issues/2271) to `eval_buffer`
* `FunctionInternal::finalize` no longer takes options dict.
* Options `always_inline` and `never_inline` were added
* Options `is_diff_in` and `is_diff_out` were added
* (3.5.2) Ctrl-C interrupts are now disabled in multi-threaded Maps since they could result in crashes
* (3.5.2) Sparsity of Callbacks can be set with `has_jacobian_sparsity/get_jacobian_sparsity`
* (3.5.2) Jitted functions can now be serialized
* (3.5.2) BSpline constructor takes an inline option yielding a fully differentiable (but not very scalable) BSpline operation for MX

CasADi expressions
* **breaking**: `IM` type is removed from public API (was used to represent integer sparse matrices). Use `DM` instead.
* **breaking**: `linspace(0,1,3)` and `linspace(0.0,1,3)` now both return `[0 0.5 1]` instead of `[0 0 1]` for the former
* `MX` supports slicing with `MX` now (symbolic indexing).
* Issue [2364](https://github.com/casadi/casadi/issues/2364):
- **breaking**: `veccat` of an empty list now returns `0-by-1` instead of `0-by-0`.
- `jtimes` output dimensions have changed when any of the arguments is empty.
- NLP function object's 'lam_p' is now `0-by-1` in case of missing parameters.
* (3.5.2) Fixed long-standing bug in `cosh` derivative
* (3.5.2) An MX operation `convexify` was added
* (3.5.2) An inefficiency in MX multiplication sparsity was detected and fixed by Mirko Hahn

Interpolation functionality
* Support for parametric (=changeable only, but not differentiable) grid and/or coefficients for linear/spline interpolation
* for `interpolant`, new constructors where added that takes dimensions instead of concrete vectors
* Support for symbolic (differentiable) grid and coefficients for linear interpolation (set `inline` option to true).

Python specific
* Overhead-less CasADi Function evaluation API [added](https://github.com/casadi/casadi/commit/3e9919e9195e8f057d09cd9bcc4f7fa59e6fc104#diff-ad1e1bf2c8d8bef2a0f3b3b85331ffd0R2491) through Python memoryviews
* Similar functionality in Callbacks
* (3.5.2) fix numpy compatibility (numpy 1.19)
* (3.5.3) fix the numpy fix

Matlab/Octave specific
* **breaking**: `a(:)=b` now behaves like Matlab builtin matrices when `a` is a CasADi matrix. Before, only the first column of `a` would be touched by this statement. ([2363](https://github.com/casadi/casadi/issues/2363))
* **breaking**: Fixed bug where `MX` constructor treated a numeric row vector as column vector. Now `size(MX(ones(1,4)))` returns `(1,4)` as expected. ([2366](https://github.com/casadi/casadi/issues/2366))
* Can now use spy directly on `DM`,`MX`,`SX`
* (3.5.2) Printing from a multi-threaded map context is disabled beause it could result in crashes. In linux, you may still see the output from a terminal used to start Matlab

Opti
* Opti supports conic problems now: `Opti('conic')`
* One can now easily obtain a parametric solution as a CasADi Function from an Opti instance:


opti = Opti()
x = opti.variable()
y = opti.variable()
p = opti.parameter()

opti.minimize(y**2+sin(x-y-p)**2)
opti.subject_to(x+y>=1)

opti.solver(nlpsolver,nlpsolver_options)

F = opti.to_function("F",[x,p,opti.lam_g],[x,y])

r = F(0,0.1,0)

(3.5.1) Improved support for vertcatted inputs to `to_function`
* Using Opti together with `max_iter` is more natural now: use `solve_limited()` to avoid exceptions to be raised when iterations or time runs out. No need to try/catch.

Code-generation
* **breaking**: `external` now looks for a `.dylib` file, not `.so` for mac
* **breaking**: Codegen API has changes related to thread-local memory:
* `void* mem` changed to `int mem`
* `alloc_mem`, `init_mem`, `free_mem` have been purged. `checkout` and `release` replace them.


int mem = checkout();
eval(arg, res, iw, w, mem);
release(mem);


* Codegen 'CODEGEN_PREFIX' has been renamed to 'CASADI_CODEGEN_PREFIX'
* QP solvers (QRQP, OSQP) and SqpMethod codegenerate now. This means that embedded MPC with CasADi is now more practical.
* Runge-Kutta and Collocation Integrator objects can be inlined into code-generatable MX Function with the 'simplify' option.
* (3.5.1) an important flaw was corrected that caused incorrect code for expression graphs with logical 'and' and 'or'.
* (3.5.1) fixed regression for expression graphs containing inf/nan
* (3.5.2) fixed bug of a division looking like a comment
* (3.5.2) fixed `mem.h` regression
* (3.5.2) Made `main` and mex-related functions `c89`-compliant

Solvers
* **breaking**: NLP solvers - `bound_consistency`, an option to post-process the primal and dual solution by projecting it on the bounds, introduced in 3.4, was changed to default `off`
* Sundials was patched to support multi-threading
* WORHP was bumped to v1.13
* SNOPT was bumped to v7.7
* SuperSCS (conic solver) was added
* OSQP (QP solver) was added
* CBC (LP solver) was added
* (3.5.3) AMPL was fixed to allow other solvers than IPOPT

* **breaking**: SQP Method
* `regularize_margin` option was added
* `regularize` (bool) option was removed. To get the effect of `regularize=true`, specify `convexify_strategy='regularize'`. Other strategies include clipping eigenvalues.
* line search was reverted from a custom designed thing, to standard textbook L1
* CPLEX and Gurobi got support for sos constraints
* Conic/qpsol interface extended for semidefinite programming and SOCP
* Solvers supporting SOCP: `Gurobi`, `SuperSCS`, `CPLEX`
* **breaking**: Newton Rootfinder now supports a `line_search` option (default true)
* Rootfinder now throws an exception by default ('error_on_fail' option true) when failing to converge

Convenience tools
* Debugging facilities:
- Function options `print_in`/`print_in` print inputs/outputs when numerically evaluating a function
- Function option `dump_in`/`dump_out` dumps to the file system
- Function option `dump` dumps the function itself (loadable with `Function.load`)
* `DM.from_file` and `DM.to_file` with a `MatrixMarket` and `txt` support
* Helping interaction with codegen with `main=true`: `Function.generate_in`/`Function.nz_from_in`/`Function.nz_to_in` to help creating input text files.
* `Function.convert_in`/`Function.convert_out` to switch between list and dictionary arguments/results

Binaries
* (3.5.1) Mac binaries for Matlab was switched to a different build environment. The binaries now require High Sierra or above, and work on Catalina.
* (3.5.4) Mac binaries for Python and octave have been switched just like Matlab
* (3.5.4) Linux binaries for Matlab and Octave have been switched to the manylinux environment, with gfortran dependency now grafted in (included, with a unique alias to avoid name collision)

3.5.3

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):
<table>
<tr><th></th><th>Windows</th><th>Linux</th><th>Mac</th></tr>
<tr>
<th>Matlab</th>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-matlabR2016a-v3.5.3.zip">R2016a</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-matlabR2014b-v3.5.3.zip">R2014b</a>,<br /> <a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-matlabR2014a-v3.5.3.zip">R2014a</a>,<br /> <a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-matlabR2013a-v3.5.3.zip">R2013a</a> or R2013b</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-linux-matlabR2014b-v3.5.3.tar.gz">R2014b</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-linux-matlabR2014a-v3.5.3.tar.gz">R2014a</a></td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-osx-matlabR2015a-v3.5.3.tar.gz">R2015a</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-osx-matlabR2014b-v3.5.3.tar.gz">R2014b</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-osx-matlabR2014a-v3.5.3.tar.gz">R2014a</a></td>
</tr>
<tr>
<th>Octave</th>
<td> 4.4.1 (<a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-octave-4.4.1-w32-v3.5.3.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-octave-4.4.1-w64-v3.5.3.zip">64bit</a>), <br /> 4.4.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-octave-4.4.0-w32-v3.5.3.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-octave-4.4.0-w64-v3.5.3.zip">64bit</a>),
<br /> 5.1.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-octave-5.1.0-w32-v3.5.3.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-octave-5.1.0-w64-v3.5.3.zip">64bit</a>),
<br /> 5.2.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-octave-5.2.0-w32-v3.5.3.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-octave-5.2.0-w64-v3.5.3.zip">64bit</a>)</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-linux-octave-4.4.1-v3.5.3.tar.gz">4.4.1</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-linux-octave-4.2.2-v3.5.3.tar.gz">4.2.2</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-linux-octave-5.1.0-v3.5.3.tar.gz">5.1.0</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-linux-octave-5.2.0-v3.5.3.tar.gz">5.2.0</a></td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-osx-octave-5.2.0-v3.5.3.tar.gz">5.2.0</a></td>
</tr>
<tr>
<th rowspan="2">Python</th>
<td>Py27 (<a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-py27-v3.5.3.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-py27-v3.5.3-64bit.zip">64bit</a><sup>*</sup>),<br /> Py35 (<a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-py35-v3.5.3.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-py35-v3.5.3-64bit.zip">64bit</a><sup>*</sup>),<br /> Py36 (<a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-py36-v3.5.3.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-py36-v3.5.3-64bit.zip">64bit</a><sup>*</sup>),<br /> Py37 (<a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-py37-v3.5.3.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-py37-v3.5.3-64bit.zip">64bit</a><sup>*</sup>),<br /> Py38 (<a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-py38-v3.5.3.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-windows-py38-v3.5.3-64bit.zip">64bit</a><sup>*</sup>)</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-linux-py27-v3.5.3-64bit.tar.gz">Py27</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-linux-py35-v3.5.3-64bit.tar.gz">Py35</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-linux-py36-v3.5.3-64bit.tar.gz">Py36</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-linux-py37-v3.5.3-64bit.tar.gz">Py37</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-linux-py38-v3.5.3-64bit.tar.gz">Py38</a></td>
<td> <a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-osx-py27-v3.5.3.tar.gz">Py27</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-osx-py35-v3.5.3.tar.gz">Py35</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-osx-py36-v3.5.3.tar.gz">Py36</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-osx-py37-v3.5.3.tar.gz">Py37</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.3/casadi-osx-py38-v3.5.3.tar.gz">Py38</a></td>
</tr>
<tr>
<td colspan="3">or just <code>pip install casadi</code> (needs <code>pip -V</code>>=8.1)</td>
</tr>
</table>

(<sup>*</sup>) Check your Python console if you need 32bit or 64bit - bitness should be printed at startup.

Unzip in your home directory and adapt the path:
<table>
<tr><th>Matlab/Octave</th><th>Python</th><tr>
<tr><td>
<pre>
<code>
addpath('&lt;yourpath>/casadi-matlabR2014a-v3.5.3')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))
</code>
</pre>
</td><td>

<pre>
<code>
from sys import path
path.append(r"&lt;yourpath>/casadi-py27-v3.5.3")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))
</code>
</pre>
</td></tr>
</table>

Get started with the [example pack](https://github.com/casadi/casadi/releases/download/3.5.3/casadi-example_pack-v3.5.3.zip).

Troubleshooting


Release notes

CasADi Functions
* CasADi Functions can be serialized now ([308](https://github.com/casadi/casadi/issues/308)).


f.save('f.casadi') % Dump any CasADi Function to a file
f = Function.load('f.casadi') % Loads back in


This enables easy sharing of models/solver isntances beteen Matlab/Python/C++ cross-platform, and enables a form of [parallelization](https://web.casadi.org/blog/parfor/).


* You can now evaluate CasADi Functions from C [without requiring code-generation](https://github.com/casadi/casadi/blob/develop/docs/examples/cplusplus/c_api_usage.cpp). This makes it possible to embed CasADi computations in Fortran, Julia, FMI, ...
* All CasADi Functions support timing information now (`print_time`, default true for QP and NLP solvers). Use `record_time` to make timings available through `f.stats()` without printing them.
* `map` with reduce arguments now has an efficient implementation (no copying/repmat)
* Low-overhead Callback eval support was [changed](https://github.com/casadi/casadi/issues/2271) to `eval_buffer`
* `FunctionInternal::finalize` no longer takes options dict.
* Options `always_inline` and `never_inline` were added
* Options `is_diff_in` and `is_diff_out` were added
* (3.5.2) Ctrl-C interrupts are now disabled in multi-threaded Maps since they could result in crashes
* (3.5.2) Sparsity of Callbacks can be set with `has_jacobian_sparsity/get_jacobian_sparsity`
* (3.5.2) Jitted functions can now be serialized
* (3.5.2) BSpline constructor takes an inline option yielding a fully differentiable (but not very scalable) BSpline operation for MX

CasADi expressions
* **breaking**: `IM` type is removed from public API (was used to represent integer sparse matrices). Use `DM` instead.
* **breaking**: `linspace(0,1,3)` and `linspace(0.0,1,3)` now both return `[0 0.5 1]` instead of `[0 0 1]` for the former
* `MX` supports slicing with `MX` now (symbolic indexing).
* Issue [2364](https://github.com/casadi/casadi/issues/2364):
- **breaking**: `veccat` of an empty list now returns `0-by-1` instead of `0-by-0`.
- `jtimes` output dimensions have changed when any of the arguments is empty.
- NLP function object's 'lam_p' is now `0-by-1` in case of missing parameters.
* (3.5.2) Fixed long-standing bug in `cosh` derivative
* (3.5.2) An MX operation `convexify` was added
* (3.5.2) An inefficiency in MX multiplication sparsity was detected and fixed by Mirko Hahn

Interpolation functionality
* Support for parametric (=changeable only, but not differentiable) grid and/or coefficients for linear/spline interpolation
* for `interpolant`, new constructors where added that takes dimensions instead of concrete vectors
* Support for symbolic (differentiable) grid and coefficients for linear interpolation (set `inline` option to true).

Python specific
* Overhead-less CasADi Function evaluation API [added](https://github.com/casadi/casadi/commit/3e9919e9195e8f057d09cd9bcc4f7fa59e6fc104#diff-ad1e1bf2c8d8bef2a0f3b3b85331ffd0R2491) through Python memoryviews
* Similar functionality in Callbacks
* (3.5.2) fix numpy compatibility (numpy 1.19)
* (3.5.3) fix the numpy fix

Matlab/Octave specific
* **breaking**: `a(:)=b` now behaves like Matlab builtin matrices when `a` is a CasADi matrix. Before, only the first column of `a` would be touched by this statement. ([2363](https://github.com/casadi/casadi/issues/2363))
* **breaking**: Fixed bug where `MX` constructor treated a numeric row vector as column vector. Now `size(MX(ones(1,4)))` returns `(1,4)` as expected. ([2366](https://github.com/casadi/casadi/issues/2366))
* Can now use spy directly on `DM`,`MX`,`SX`
* (3.5.2) Printing from a multi-threaded map context is disabled beause it could result in crashes. In linux, you may still see the output from a terminal used to start Matlab

Opti
* Opti supports conic problems now: `Opti('conic')`
* One can now easily obtain a parametric solution as a CasADi Function from an Opti instance:


opti = Opti()
x = opti.variable()
y = opti.variable()
p = opti.parameter()

opti.minimize(y**2+sin(x-y-p)**2)
opti.subject_to(x+y>=1)

opti.solver(nlpsolver,nlpsolver_options)

F = opti.to_function("F",[x,p,opti.lam_g],[x,y])

r = F(0,0.1,0)

(3.5.1) Improved support for vertcatted inputs to `to_function`
* Using Opti together with `max_iter` is more natural now: use `solve_limited()` to avoid exceptions to be raised when iterations or time runs out. No need to try/catch.

Code-generation
* **breaking**: `external` now looks for a `.dylib` file, not `.so`
* **breaking**: Codegen API has changes related to thread-local memory:
* `void* mem` changed to `int mem`
* `alloc_mem`, `init_mem`, `free_mem` have been purged. `checkout` and `release` replace them.


int mem = checkout();
eval(arg, res, iw, w, mem);
release(mem);


* Codegen 'CODEGEN_PREFIX' has been renamed to 'CASADI_CODEGEN_PREFIX'
* QP solvers (QRQP, OSQP) and SqpMethod codegenerate now. This means that embedded MPC with CasADi is now more practical.
* Runge-Kutta and Collocation Integrator objects can be inlined into code-generatable MX Function with the 'simplify' option.
* (3.5.1) an important flaw was corrected that caused incorrect code for expression graphs with logical 'and' and 'or'.
* (3.5.1) fixed regression for expression graphs containing inf/nan
* (3.5.2) fixed bug of a division looking like a comment
* (3.5.2) fixed `mem.h` regression
* (3.5.2) Made `main` and mex-related functions `c89`-compliant

Solvers
* **breaking**: NLP solvers - `bound_consistency`, an option to post-process the primal and dual solution by projecting it on the bounds, introduced in 3.4, was changed to default `off`
* Sundials was patched to support multi-threading
* WORHP was bumped to v1.13
* SNOPT was bumped to v7.7
* SuperSCS (conic solver) was added
* OSQP (QP solver) was added
* CBC (LP solver) was added
* (3.5.3) AMPL was fixed to allow other solvers than IPOPT

* **breaking**: SQP Method
* `regularize_margin` option was added
* `regularize` (bool) option was removed. To get the effect of `regularize=true`, specify `convexify_strategy='regularize'`. Other strategies include clipping eigenvalues.
* line search was reverted from a custom designed thing, to standard textbook L1
* CPLEX and Gurobi got support for sos constraints
* Conic/qpsol interface extended for semidefinite programming and SOCP
* Solvers supporting SOCP: `Gurobi`, `SuperSCS`, `CPLEX`
* **breaking**: Newton Rootfinder now supports a `line_search` option (default true)
* Rootfinder now throws an exception by default ('error_on_fail' option true) when failing to converge

Convenience tools
* Debugging facilities:
- Function options `print_in`/`print_in` print inputs/outputs when numerically evaluating a function
- Function option `dump_in`/`dump_out` dumps to the file system
- Function option `dump` dumps the function itself (loadable with `Function.load`)
* `DM.from_file` and `DM.to_file` with a `MatrixMarket` and `txt` support
* Helping interaction with codegen with `main=true`: `Function.generate_in`/`Function.nz_from_in`/`Function.nz_to_in` to help creating input text files.
* `Function.convert_in`/`Function.convert_out` to switch between list and dictionary arguments/results

Binaries
* (3.5.1) Mac binaries for Matlab was switched to a different build environment. The binaries now require High Sierra or above, and work on Catalina.

3.5.2

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):
<table>
<tr><th></th><th>Windows</th><th>Linux</th><th>Mac</th></tr>
<tr>
<th>Matlab</th>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-matlabR2016a-v3.5.2.zip">R2016a</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-matlabR2014b-v3.5.2.zip">R2014b</a>,<br /> <a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-matlabR2014a-v3.5.2.zip">R2014a</a>,<br /> <a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-matlabR2013a-v3.5.2.zip">R2013a</a> or R2013b</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-linux-matlabR2014b-v3.5.2.tar.gz">R2014b</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-linux-matlabR2014a-v3.5.2.tar.gz">R2014a</a></td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-osx-matlabR2015a-v3.5.2.tar.gz">R2015a</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-osx-matlabR2014b-v3.5.2.tar.gz">R2014b</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-osx-matlabR2014a-v3.5.2.tar.gz">R2014a</a></td>
</tr>
<tr>
<th>Octave</th>
<td> 4.4.1 (<a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-octave-4.4.1-w32-v3.5.2.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-octave-4.4.1-w64-v3.5.2.zip">64bit</a>), <br /> 4.4.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-octave-4.4.0-w32-v3.5.2.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-octave-4.4.0-w64-v3.5.2.zip">64bit</a>),
<br /> 5.1.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-octave-5.1.0-w32-v3.5.2.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-octave-5.1.0-w64-v3.5.2.zip">64bit</a>),
<br /> 5.2.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-octave-5.2.0-w32-v3.5.2.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-octave-5.2.0-w64-v3.5.2.zip">64bit</a>)</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-linux-octave-4.4.1-v3.5.2.tar.gz">4.4.1</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-linux-octave-4.2.2-v3.5.2.tar.gz">4.2.2</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-linux-octave-5.1.0-v3.5.2.tar.gz">5.1.0</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-linux-octave-5.2.0-v3.5.2.tar.gz">5.2.0</a></td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-osx-octave-5.2.0-v3.5.2.tar.gz">5.2.0</a></td>
</tr>
<tr>
<th rowspan="2">Python</th>
<td>Py27 (<a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-py27-v3.5.2.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-py27-v3.5.2-64bit.zip">64bit</a><sup>*</sup>),<br /> Py35 (<a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-py35-v3.5.2.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-py35-v3.5.2-64bit.zip">64bit</a><sup>*</sup>),<br /> Py36 (<a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-py36-v3.5.2.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-py36-v3.5.2-64bit.zip">64bit</a><sup>*</sup>),<br /> Py37 (<a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-py37-v3.5.2.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-py37-v3.5.2-64bit.zip">64bit</a><sup>*</sup>),<br /> Py38 (<a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-py38-v3.5.2.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-windows-py38-v3.5.2-64bit.zip">64bit</a><sup>*</sup>)</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-linux-py27-v3.5.2-64bit.tar.gz">Py27</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-linux-py35-v3.5.2-64bit.tar.gz">Py35</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-linux-py36-v3.5.2-64bit.tar.gz">Py36</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-linux-py37-v3.5.2-64bit.tar.gz">Py37</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-linux-py38-v3.5.2-64bit.tar.gz">Py38</a></td>
<td> <a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-osx-py27-v3.5.2.tar.gz">Py27</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-osx-py35-v3.5.2.tar.gz">Py35</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-osx-py36-v3.5.2.tar.gz">Py36</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-osx-py37-v3.5.2.tar.gz">Py37</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.2/casadi-osx-py38-v3.5.2.tar.gz">Py38</a></td>
</tr>
<tr>
<td colspan="3">or just <code>pip install casadi</code> (needs <code>pip -V</code>>=8.1)</td>
</tr>
</table>

(<sup>*</sup>) Check your Python console if you need 32bit or 64bit - bitness should be printed at startup.

Unzip in your home directory and adapt the path:
<table>
<tr><th>Matlab/Octave</th><th>Python</th><tr>
<tr><td>
<pre>
<code>
addpath('&lt;yourpath>/casadi-matlabR2014a-v3.5.2')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))
</code>
</pre>
</td><td>

<pre>
<code>
from sys import path
path.append(r"&lt;yourpath>/casadi-py27-v3.5.2")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))
</code>
</pre>
</td></tr>
</table>

Get started with the [example pack](https://github.com/casadi/casadi/releases/download/3.5.2/casadi-example_pack-v3.5.2.zip).

Troubleshooting


Release notes

CasADi Functions
* CasADi Functions can be serialized now ([308](https://github.com/casadi/casadi/issues/308)).


f.save('f.casadi') % Dump any CasADi Function to a file
f = Function.load('f.casadi') % Loads back in


This enables easy sharing of models/solver isntances beteen Matlab/Python/C++ cross-platform, and enables a form of [parallelization](https://web.casadi.org/blog/parfor/).


* You can now evaluate CasADi Functions from C [without requiring code-generation](https://github.com/casadi/casadi/blob/develop/docs/examples/cplusplus/c_api_usage.cpp). This makes it possible to embed CasADi computations in Fortran, Julia, FMI, ...
* All CasADi Functions support timing information now (`print_time`, default true for QP and NLP solvers). Use `record_time` to make timings available through `f.stats()` without printing them.
* `map` with reduce arguments now has an efficient implementation (no copying/repmat)
* Low-overhead Callback eval support was [changed](https://github.com/casadi/casadi/issues/2271) to `eval_buffer`
* `FunctionInternal::finalize` no longer takes options dict.
* Options `always_inline` and `never_inline` were added
* Options `is_diff_in` and `is_diff_out` were added
* (3.5.2) Ctrl-C interrupts are now disabled in multi-threaded Maps since they could result in crashes
* (3.5.2) Sparsity of Callbacks can be set with `has_jacobian_sparsity/get_jacobian_sparsity`
* (3.5.2) Jitted functions can now be serialized
* (3.5.2) BSpline constructor takes an inline option yielding a fully differentiable (but not very scalable) BSpline operation for MX

CasADi expressions
* **breaking**: `IM` type is removed from public API (was used to represent integer sparse matrices). Use `DM` instead.
* **breaking**: `linspace(0,1,3)` and `linspace(0.0,1,3)` now both return `[0 0.5 1]` instead of `[0 0 1]` for the former
* `MX` supports slicing with `MX` now (symbolic indexing).
* Issue [2364](https://github.com/casadi/casadi/issues/2364):
- **breaking**: `veccat` of an empty list now returns `0-by-1` instead of `0-by-0`.
- `jtimes` output dimensions have changed when any of the arguments is empty.
- NLP function object's 'lam_p' is now `0-by-1` in case of missing parameters.
* (3.5.2) Fixed long-standing bug in `cosh` derivative
* (3.5.2) An MX operation `convexify` was added
* (3.5.2) An inefficiency in MX multiplication sparsity was detected and fixed by Mirko Hahn

Interpolation functionality
* Support for parametric (=changeable only, but not differentiable) grid and/or coefficients for linear/spline interpolation
* for `interpolant`, new constructors where added that takes dimensions instead of concrete vectors
* Support for symbolic (differentiable) grid and coefficients for linear interpolation (set `inline` option to true).

Python specific
* Overhead-less CasADi Function evaluation API [added](https://github.com/casadi/casadi/commit/3e9919e9195e8f057d09cd9bcc4f7fa59e6fc104#diff-ad1e1bf2c8d8bef2a0f3b3b85331ffd0R2491) through Python memoryviews
* Similar functionality in Callbacks
* (3.5.2) fix numpy compatibility (numpy 1.19)

Matlab/Octave specific
* **breaking**: `a(:)=b` now behaves like Matlab builtin matrices when `a` is a CasADi matrix. Before, only the first column of `a` would be touched by this statement. ([2363](https://github.com/casadi/casadi/issues/2363))
* **breaking**: Fixed bug where `MX` constructor treated a numeric row vector as column vector. Now `size(MX(ones(1,4)))` returns `(1,4)` as expected. ([2366](https://github.com/casadi/casadi/issues/2366))
* Can now use spy directly on `DM`,`MX`,`SX`
* (3.5.2) Printing from a multi-threaded map context is disabled beause it could result in crashes. In linux, you may still see the output from a terminal used to start Matlab

Opti
* Opti supports conic problems now: `Opti('conic')`
* One can now easily obtain a parametric solution as a CasADi Function from an Opti instance:


opti = Opti()
x = opti.variable()
y = opti.variable()
p = opti.parameter()

opti.minimize(y**2+sin(x-y-p)**2)
opti.subject_to(x+y>=1)

opti.solver(nlpsolver,nlpsolver_options)

F = opti.to_function("F",[x,p,opti.lam_g],[x,y])

r = F(0,0.1,0)

(3.5.1) Improved support for vertcatted inputs to `to_function`
* Using Opti together with `max_iter` is more natural now: use `solve_limited()` to avoid exceptions to be raised when iterations or time runs out. No need to try/catch.

Code-generation
* **breaking**: `external` now looks for a `.dylib` file, not `.so`
* **breaking**: Codegen API has changes related to thread-local memory:
* `void* mem` changed to `int mem`
* `alloc_mem`, `init_mem`, `free_mem` have been purged. `checkout` and `release` replace them.


int mem = checkout();
eval(arg, res, iw, w, mem);
release(mem);


* Codegen 'CODEGEN_PREFIX' has been renamed to 'CASADI_CODEGEN_PREFIX'
* QP solvers (QRQP, OSQP) and SqpMethod codegenerate now. This means that embedded MPC with CasADi is now more practical.
* Runge-Kutta and Collocation Integrator objects can be inlined into code-generatable MX Function with the 'simplify' option.
* (3.5.1) an important flaw was corrected that caused incorrect code for expression graphs with logical 'and' and 'or'.
* (3.5.1) fixed regression for expression graphs containing inf/nan
* (3.5.2) fixed bug of a division looking like a comment
* (3.5.2) fixed `mem.h` regression
* (3.5.2) Made `main` and mex-related functions `c89`-compliant

Solvers
* **breaking**: NLP solvers - `bound_consistency`, an option to post-process the primal and dual solution by projecting it on the bounds, introduced in 3.4, was changed to default `off`
* Sundials was patched to support multi-threading
* WORHP was bumped to v1.13
* SNOPT was bumped to v7.7
* SuperSCS (conic solver) was added
* OSQP (QP solver) was added
* CBC (LP solver) was added
* (3.5.2) AMPL was fixed to allow other solvers than IPOPT

* **breaking**: SQP Method
* `regularize_margin` option was added
* `regularize` (bool) option was removed. To get the effect of `regularize=true`, specify `convexify_strategy='regularize'`. Other strategies include clipping eigenvalues.
* line search was reverted from a custom designed thing, to standard textbook L1
* CPLEX and Gurobi got support for sos constraints
* Conic/qpsol interface extended for semidefinite programming and SOCP
* Solvers supporting SOCP: `Gurobi`, `SuperSCS`, `CPLEX`
* **breaking**: Newton Rootfinder now supports a `line_search` option (default true)
* Rootfinder now throws an exception by default ('error_on_fail' option true) when failing to converge

Convenience tools
* Debugging facilities:
- Function options `print_in`/`print_in` print inputs/outputs when numerically evaluating a function
- Function option `dump_in`/`dump_out` dumps to the file system
- Function option `dump` dumps the function itself (loadable with `Function.load`)
* `DM.from_file` and `DM.to_file` with a `MatrixMarket` and `txt` support
* Helping interaction with codegen with `main=true`: `Function.generate_in`/`Function.nz_from_in`/`Function.nz_to_in` to help creating input text files.
* `Function.convert_in`/`Function.convert_out` to switch between list and dictionary arguments/results

Binaries
* (3.5.1) Mac binaries for Matlab was switched to a different build environemnt. The binaries now require High Sierra or above, and work on Catalina.

3.5.1

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):
<table>
<tr><th></th><th>Windows</th><th>Linux</th><th>Mac</th></tr>
<tr>
<th>Matlab</th>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-matlabR2016a-v3.5.1.zip">R2016a</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-matlabR2014b-v3.5.1.zip">R2014b</a>,<br /> <a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-matlabR2014a-v3.5.1.zip">R2014a</a>,<br /> <a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-matlabR2013a-v3.5.1.zip">R2013a</a> or R2013b</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-linux-matlabR2014b-v3.5.1.tar.gz">R2014b</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-linux-matlabR2014a-v3.5.1.tar.gz">R2014a</a></td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-osx-matlabR2015a-v3.5.1.tar.gz">R2015a</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-osx-matlabR2014b-v3.5.1.tar.gz">R2014b</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-osx-matlabR2014a-v3.5.1.tar.gz">R2014a</a></td>
</tr>
<tr>
<th>Octave</th>
<td> 4.4.1 (<a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-octave-4.4.1-w32-v3.5.1.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-octave-4.4.1-w64-v3.5.1.zip">64bit</a>), <br /> 4.4.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-octave-4.4.0-w32-v3.5.1.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-octave-4.4.0-w64-v3.5.1.zip">64bit</a>),
<br /> 5.1.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-octave-5.1.0-w32-v3.5.1.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-octave-5.1.0-w64-v3.5.1.zip">64bit</a>)</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-linux-octave-4.4.1-v3.5.1.tar.gz">4.4.1</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-linux-octave-4.2.2-v3.5.1.tar.gz">4.2.2</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-linux-octave-5.1.0-v3.5.1.tar.gz">5.1.0</a></td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-osx-octave-5.1.0-v3.5.1.tar.gz">5.1.0</a></td>
</tr>
<tr>
<th rowspan="2">Python</th>
<td>Py27 (<a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-py27-v3.5.1.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-py27-v3.5.1-64bit.zip">64bit</a><sup>*</sup>),<br /> Py35 (<a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-py35-v3.5.1.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-py35-v3.5.1-64bit.zip">64bit</a><sup>*</sup>),<br /> Py36 (<a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-py36-v3.5.1.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-py36-v3.5.1-64bit.zip">64bit</a><sup>*</sup>),<br /> Py37 (<a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-py37-v3.5.1.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-windows-py37-v3.5.1-64bit.zip">64bit</a><sup>*</sup>) </td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-linux-py27-v3.5.1-64bit.tar.gz">Py27</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-linux-py35-v3.5.1-64bit.tar.gz">Py35</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-linux-py36-v3.5.1-64bit.tar.gz">Py36</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-linux-py37-v3.5.1-64bit.tar.gz">Py37</a></td>
<td> <a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-osx-py27-v3.5.1.tar.gz">Py27</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-osx-py35-v3.5.1.tar.gz">Py35</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-osx-py36-v3.5.1.tar.gz">Py36</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.1/casadi-osx-py37-v3.5.1.tar.gz">Py37</a></td>
</tr>
<tr>
<td colspan="3">or just <code>pip install casadi</code> (needs <code>pip -V</code>>=8.1)</td>
</tr>
</table>

(<sup>*</sup>) Check your Python console if you need 32bit or 64bit - bitness should be printed at startup.

Unzip in your home directory and adapt the path:
<table>
<tr><th>Matlab/Octave</th><th>Python</th><tr>
<tr><td>
<pre>
<code>
addpath('&lt;yourpath>/casadi-matlabR2014a-v3.5.1')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))
</code>
</pre>
</td><td>

<pre>
<code>
from sys import path
path.append(r"&lt;yourpath>/casadi-py27-v3.5.1")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))
</code>
</pre>
</td></tr>
</table>

Get started with the [example pack](https://github.com/casadi/casadi/releases/download/3.5.1/casadi-example_pack-v3.5.1.zip).

Troubleshooting


Release notes

CasADi Functions
* CasADi Functions can be serialized now ([308](https://github.com/casadi/casadi/issues/308)).


f.save('f.casadi') % Dump any CasADi Function to a file
f = Function.load('f.casadi') % Loads back in


This enables easy sharing of models/solver isntances beteen Matlab/Python/C++ cross-platform, and enables a form of [parallelization](https://web.casadi.org/blog/parfor/).


* You can now evaluate CasADi Functions from C [without requiring code-generation](https://github.com/casadi/casadi/blob/develop/docs/examples/cplusplus/c_api_usage.cpp). This makes it possible to embed CasADi computations in Fortran, Julia, FMI, ...
* All CasADi Functions support timing information now (`print_time`, default true for QP and NLP solvers). Use `record_time` to make timings available through `f.stats()` without printing them.
* `map` with reduce arguments now has an efficient implementation (no copying/repmat)
* Low-overhead Callback eval support was [changed](https://github.com/casadi/casadi/issues/2271) to `eval_buffer`
* `FunctionInternal::finalize` no longer takes options dict.
* Options `always_inline` and `never_inline` were added
* Options `is_diff_in` and `is_diff_out` were added

CasADi expressions
* **breaking**: `IM` type is removed from public API (was used to represent integer sparse matrices). Use `DM` instead.
* **breaking**: `linspace(0,1,3)` and `linspace(0.0,1,3)` now both return `[0 0.5 1]` instead of `[0 0 1]` for the former
* `MX` supports slicing with `MX` now (symbolic indexing).
* Issue [2364](https://github.com/casadi/casadi/issues/2364):
- **breaking**: `veccat` of an empty list now returns `0-by-1` instead of `0-by-0`.
- `jtimes` output dimensions have changed when any of the arguments is empty.
- NLP function object's 'lam_p' is now `0-by-1` in case of missing parameters.

Interpolation functionality
* Support for parametric (=changeable only, but not differentiable) grid and/or coefficients for linear/spline interpolation
* for `interpolant`, new constructors where added that takes dimensions instead of concrete vectors
* Support for symbolic (differentiable) grid and coefficients for linear interpolation (set `inline` option to true).

Python specific
* Overhead-less CasADi Function evaluation API [added](https://github.com/casadi/casadi/commit/3e9919e9195e8f057d09cd9bcc4f7fa59e6fc104#diff-ad1e1bf2c8d8bef2a0f3b3b85331ffd0R2491) through Python memoryviews
* Similar functionality in Callbacks

Matlab/Octave specific
* **breaking**: `a(:)=b` now behaves like Matlab builtin matrices when `a` is a CasADi matrix. Before, only the first column of `a` would be touched by this statement. ([2363](https://github.com/casadi/casadi/issues/2363))
* **breaking**: Fixed bug where `MX` constructor treated a numeric row vector as column vector. Now `size(MX(ones(1,4)))` returns `(1,4)` as expected. ([2366](https://github.com/casadi/casadi/issues/2366))
* Can now use spy directly on `DM`,`MX`,`SX`

Opti
* Opti supports conic problems now: `Opti('conic')`
* One can now easily obtain a parametric solution as a CasADi Function from an Opti instance:


opti = Opti()
x = opti.variable()
y = opti.variable()
p = opti.parameter()

opti.minimize(y**2+sin(x-y-p)**2)
opti.subject_to(x+y>=1)

opti.solver(nlpsolver,nlpsolver_options)

F = opti.to_function("F",[x,p,opti.lam_g],[x,y])

r = F(0,0.1,0)

(3.5.1) Improved support for vertcatted inputs to `to_function`
* Using Opti together with `max_iter` is more natural now: use `solve_limited()` to avoid exceptions to be raised when iterations or time runs out. No need to try/catch.

Code-generation
* **breaking**: `external` now looks for a `.dylib` file, not `.so`
* **breaking**: Codegen API has changes related to thread-local memory:
* `void* mem` changed to `int mem`
* `alloc_mem`, `init_mem`, `free_mem` have been purged. `checkout` and `release` replace them.


int mem = checkout();
eval(arg, res, iw, w, mem);
release(mem);


* Codegen 'CODEGEN_PREFIX' has been renamed to 'CASADI_CODEGEN_PREFIX'
* QP solvers (QRQP, OSQP) and SqpMethod codegenerate now. This means that embedded MPC with CasADi is now more practical.
* Runge-Kutta and Collocation Integrator objects can be inlined into code-generatable MX Function with the 'simplify' option.
* (3.5.1) an important flaw was corrected that caused incorrect code for expression graphs with logical 'and' and 'or'.
* (3.5.1) fixed regression for expression graphs containing inf/nan

Solvers
* **breaking**: NLP solvers - `bound_consistency`, an option to post-process the primal and dual solution by projecting it on the bounds, introduced in 3.4, was changed to default `off`
* Sundials was patched to support multi-threading
* WORHP was bumped to v1.13
* SNOPT was bumped to v7.7
* SuperSCS (conic solver) was added
* OSQP (QP solver) was added
* CBC (LP solver) was added

* **breaking**: SQP Method
* `regularize_margin` option was added
* `regularize` (bool) option was removed. To get the effect of `regularize=true`, specify `convexify_strategy='regularize'`. Other strategies include clipping eigenvalues.
* line search was reverted from a custom designed thing, to standard textbook L1
* CPLEX and Gurobi got support for sos constraints
* Conic/qpsol interface extended for semidefinite programming and SOCP
* Solvers supporting SOCP: `Gurobi`, `SuperSCS`, `CPLEX`
* **breaking**: Newton Rootfinder now supports a `line_search` option (default true)
* Rootfinder now throws an exception by default ('error_on_fail' option true) when failing to converge

Convenience tools
* Debugging facilities:
- Function options `print_in`/`print_in` print inputs/outputs when numerically evaluating a function
- Function option `dump_in`/`dump_out` dumps to the file system
- Function option `dump` dumps the function itself (loadable with `Function.load`)
* `DM.from_file` and `DM.to_file` with a `MatrixMarket` and `txt` support
* Helping interaction with codegen with `main=true`: `Function.generate_in`/`Function.nz_from_in`/`Function.nz_to_in` to help creating input text files.
* `Function.convert_in`/`Function.convert_out` to switch between list and dictionary arguments/results

Binaries
* (3.5.1) Mac binaries for Matlab was switched to a different build environemnt. The binaries now require High Sierra or above, and work on Catalina.

3.5.0

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):
<table>
<tr><th></th><th>Windows</th><th>Linux</th><th>Mac</th></tr>
<tr>
<th>Matlab</th>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-matlabR2016a-v3.5.0.zip">R2016a</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-matlabR2014b-v3.5.0.zip">R2014b</a>,<br /> <a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-matlabR2014a-v3.5.0.zip">R2014a</a>,<br /> <a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-matlabR2013a-v3.5.0.zip">R2013a</a> or R2013b</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-linux-matlabR2014b-v3.5.0.tar.gz">R2014b</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-linux-matlabR2014a-v3.5.0.tar.gz">R2014a</a></td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-osx-matlabR2015a-v3.5.0.tar.gz">R2015a</a> or later,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-osx-matlabR2014b-v3.5.0.tar.gz">R2014b</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-osx-matlabR2014a-v3.5.0.tar.gz">R2014a</a></td>
</tr>
<tr>
<th>Octave</th>
<td> 4.4.1 (<a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-octave-4.4.1-w32-v3.5.0.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-octave-4.4.1-w64-v3.5.0.zip">64bit</a>), <br /> 4.4.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-octave-4.4.0-w32-v3.5.0.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-octave-4.4.0-w64-v3.5.0.zip">64bit</a>),
<br /> 5.1.0 (<a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-octave-5.1.0-w32-v3.5.0.zip">32bit</a> / <a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-octave-5.1.0-w64-v3.5.0.zip">64bit</a>)</td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-linux-octave-4.4.1-v3.5.0.tar.gz">4.4.1</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-linux-octave-4.2.2-v3.5.0.tar.gz">4.2.2</a>, <br/><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-linux-octave-5.1.0-v3.5.0.tar.gz">5.1.0</a></td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-osx-octave-5.1.0-v3.5.0.tar.gz">5.1.0</a></td>
</tr>
<tr>
<th rowspan="2">Python</th>
<td>Py27 (<a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-py27-v3.5.0.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-py27-v3.5.0-64bit.zip">64bit</a><sup>*</sup>),<br /> Py35 (<a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-py35-v3.5.0.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-py35-v3.5.0-64bit.zip">64bit</a><sup>*</sup>),<br /> Py36 (<a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-py36-v3.5.0.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-py36-v3.5.0-64bit.zip">64bit</a><sup>*</sup>),<br /> Py37 (<a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-py37-v3.5.0.zip">32bit</a><sup>*</sup> / <a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-windows-py37-v3.5.0-64bit.zip">64bit</a><sup>*</sup>) </td>
<td><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-linux-py27-v3.5.0-64bit.tar.gz">Py27</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-linux-py35-v3.5.0-64bit.tar.gz">Py35</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-linux-py36-v3.5.0-64bit.tar.gz">Py36</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-linux-py37-v3.5.0-64bit.tar.gz">Py37</a></td>
<td> <a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-osx-py27-v3.5.0.tar.gz">Py27</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-osx-py35-v3.5.0.tar.gz">Py35</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-osx-py36-v3.5.0.tar.gz">Py36</a>,<br /><a href="https://github.com/casadi/casadi/releases/download/3.5.0/casadi-osx-py37-v3.5.0.tar.gz">Py37</a></td>
</tr>
<tr>
<td colspan="3">or just <code>pip install casadi</code> (needs <code>pip -V</code>>=8.1)</td>
</tr>
</table>

(<sup>*</sup>) Check your Python console if you need 32bit or 64bit - bitness should be printed at startup.

Unzip in your home directory and adapt the path:
<table>
<tr><th>Matlab/Octave</th><th>Python</th><tr>
<tr><td>
<pre>
<code>
addpath('&lt;yourpath>/casadi-matlabR2014a-v3.4.5')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))
</code>
</pre>
</td><td>

<pre>
<code>
from sys import path
path.append(r"&lt;yourpath>/casadi-py27-v3.4.5")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))
</code>
</pre>
</td></tr>
</table>

Get started with the [example pack](https://github.com/casadi/casadi/releases/download/3.5.0/casadi-example_pack-v3.5.0.zip).

Troubleshooting


Release notes

CasADi Functions
* CasADi Functions can be serialized now ([308](https://github.com/casadi/casadi/issues/308)).


f.save('f.casadi') % Dump any CasADi Function to a file
f = Function.load('f.casadi') % Loads back in


This enables easy sharing of models/solver isntances beteen Matlab/Python/C++ cross-platform, and enables a form of [parallelization](https://web.casadi.org/blog/parfor/).


* You can now evaluate CasADi Functions from C [without requiring code-generation](https://github.com/casadi/casadi/blob/develop/docs/examples/cplusplus/c_api_usage.cpp). This makes it possible to embed CasADi computations in Fortran, Julia, FMI, ...
* All CasADi Functions support timing information now (`print_time`, default true for QP and NLP solvers). Use `record_time` to make timings available through `f.stats()` without printing them.
* `map` with reduce arguments now has an efficient implementation (no copying/repmat)
* Low-overhead Callback eval support was [changed](https://github.com/casadi/casadi/issues/2271) to `eval_buffer`
* `FunctionInternal::finalize` no longer takes options dict.
* Options `always_inline` and `never_inline` were added
* Options `is_diff_in` and `is_diff_out` were added

CasADi expressions
* **breaking**: `IM` type is removed from public API (was used to represent integer sparse matrices). Use `DM` instead.
* **breaking**: `linspace(0,1,3)` and `linspace(0.0,1,3)` now both return `[0 0.5 1]` instead of `[0 0 1]` for the former
* `MX` supports slicing with `MX` now (symbolic indexing).
* Issue [2364](https://github.com/casadi/casadi/issues/2364):
- **breaking**: `veccat` of an empty list now returns `0-by-1` instead of `0-by-0`.
- `jtimes` output dimensions have changed when any of the arguments is empty.
- NLP function object's 'lam_p' is now `0-by-1` in case of missing parameters.

Interpolation functionality
* Support for parametric (=changeable only, but not differentiable) grid and/or coefficients for linear/spline interpolation
* for `interpolant`, new constructors where added that takes dimensions instead of concrete vectors
* Support for symbolic (differentiable) grid and coefficients for linear interpolation (set `inline` option to true).

Python specific
* Overhead-less CasADi Function evaluation API [added](https://github.com/casadi/casadi/commit/3e9919e9195e8f057d09cd9bcc4f7fa59e6fc104#diff-ad1e1bf2c8d8bef2a0f3b3b85331ffd0R2491) through Python memoryviews
* Similar functionality in Callbacks

Matlab/Octave specific
* **breaking**: `a(:)=b` now behaves like Matlab builtin matrices when `a` is a CasADi matrix. Before, only the first column of `a` would be touched by this statement. ([2363](https://github.com/casadi/casadi/issues/2363))
* **breaking**: Fixed bug where `MX` constructor treated a numeric row vector as column vector. Now `size(MX(ones(1,4)))` returns `(1,4)` as expected. ([2366](https://github.com/casadi/casadi/issues/2366))
* Can now use spy directly on `DM`,`MX`,`SX`

Opti
* Opti supports conic problems now: `Opti('conic')`
* One can now easily obtain a parametric solution as a CasADi Function from an Opti instance:


opti = Opti()
x = opti.variable()
y = opti.variable()
p = opti.parameter()

opti.minimize(y**2+sin(x-y-p)**2)
opti.subject_to(x+y>=1)

opti.solver(nlpsolver,nlpsolver_options)

F = opti.to_function("F",[x,p,opti.lam_g],[x,y])

r = F(0,0.1,0)


* Using Opti together with `max_iter` is more natural now: use `solve_limited()` to avoid exceptions to be raised when iterations or time runs out. No need to try/catch.

Code-generation
* **breaking**: `external` now looks for a `.dylib` file, not `.so`
* **breaking**: Codegen API has changes related to thread-local memory:
* `void* mem` changed to `int mem`
* `alloc_mem`, `init_mem`, `free_mem` have been purged. `checkout` and `release` replace them.


int mem = checkout();
eval(arg, res, iw, w, mem);
release(mem);


* Codegen 'CODEGEN_PREFIX' has been renamed to 'CASADI_CODEGEN_PREFIX'
* QP solvers (QRQP, OSQP) and SqpMethod codegenerate now. This means that embedded MPC with CasADi is now more practical.
* Runge-Kutta and Collocation Integrator objects can be inlined into code-generatable MX Function with the 'simplify' option.

Solvers
* **breaking**: NLP solvers - `bound_consistency`, an option to post-process the primal and dual solution by projecting it on the bounds, introduced in 3.4, was changed to default `off`
* Sundials was patched to support multi-threading
* WORHP was bumped to v1.13
* SNOPT was bumped to v7.7
* SuperSCS (conic solver) was added
* OSQP (QP solver) was added
* CBC (LP solver) was added

* **breaking**: SQP Method
* `regularize_margin` option was added
* `regularize` (bool) option was removed. To get the effect of `regularize=true`, specify `convexify_strategy='regularize'`. Other strategies include clipping eigenvalues.
* line search was reverted from a custom designed thing, to standard textbook L1
* CPLEX and Gurobi got support for sos constraints
* Conic/qpsol interface extended for semidefinite programming and SOCP
* Solvers supporting SOCP: `Gurobi`, `SuperSCS`, `CPLEX`
* **breaking**: Newton Rootfinder now supports a `line_search` option (default true)
* Rootfinder now throws an exception by default ('error_on_fail' option true) when failing to converge

Convenience tools
* Debugging facilities:
- Function options `print_in`/`print_in` print inputs/outputs when numerically evaluating a function
- Function option `dump_in`/`dump_out` dumps to the file system
- Function option `dump` dumps the function itself (loadable with `Function.load`)
* `DM.from_file` and `DM.to_file` with a `MatrixMarket` and `txt` support
* Helping interaction with codegen with `main=true`: `Function.generate_in`/`Function.nz_from_in`/`Function.nz_to_in` to help creating input text files.
* `Function.convert_in`/`Function.convert_out` to switch between list and dictionary arguments/results

ge

Page 2 of 16

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.