Skip to content

@jgillis jgillis released this Sep 5, 2020

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):

WindowsLinuxMac (High Sierra or above)
Matlab R2016a or later,
R2014b,
R2014a,
R2013a or R2013b
R2014b or later,
R2014a
R2015a or later,
R2014b,
R2014a
Octave 4.4.1 (32bit / 64bit),
4.4.0 (32bit / 64bit),
5.1.0 (32bit / 64bit),
5.2.0 (32bit / 64bit),
6.1.0 (32bit / 64bit)
4.4.1,
5.1.0,
5.2.0,
6.1.0
5.2.0,
6.1.0(Mojave or higher)
Python Py27 (32bit* / 64bit*),
Py35 (32bit* / 64bit*),
Py36 (32bit* / 64bit*),
Py37 (32bit* / 64bit*),
Py38 (32bit* / 64bit*)
Py39 (32bit* / 64bit*)
Py27,
Py35,
Py36,
Py37,
Py38,
Py39
Py27,
Py35,
Py36,
Py37,
Py38,
Py39
or just pip install casadi (needs pip -V>=8.1)

(*) 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:

Matlab/OctavePython

addpath('<yourpath>/casadi-matlabR2014a-v3.5.5')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))


from sys import path
path.append(r"<yourpath>/casadi-py27-v3.5.5")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))

Get started with the example pack.

Troubleshooting

Release notes

CasADi Functions

  • CasADi Functions can be serialized now (#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.

  • You can now evaluate CasADi Functions from C without requiring code-generation. 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 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:
    • 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 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)
  • 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)
  • 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 ):

softwareversion library license env build env
IPOPT 3.12.3 shipped / /
SNOPT 7.7 libsnopt7.so/snopt7.dll SNOPT_LICENSE SNOPT
WORHP 1.13 libworhp.so/worhp.dll WORHP_LICENSE_FILE WORHP
KNITRO 10.3 libknitro1030.so/knitro1032.dll / KNITRO
CPLEX windows/mac: 12.8.0, linux:12.6.3 libcplex1263.so / libcplex1280.dll ILOG_LICENSE_FILE CPLEX
GUROBI 6.5.0 libgurobi65.so/gurobi65.dll GRB_LICENSE_FILE GUROBI_HOME
Assets 78
README.md 81 Bytes

@jgillis jgillis released this Sep 3, 2020

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):

WindowsLinuxMac (High Sierra or above)
Matlab R2016a or later,
R2014b,
R2014a,
R2013a or R2013b
R2014b or later,
R2014a
R2015a or later,
R2014b,
R2014a
Octave 4.4.1 (32bit / 64bit),
4.4.0 (32bit / 64bit),
5.1.0 (32bit / 64bit),
5.2.0 (32bit / 64bit)
4.4.1,
4.2.2,
5.1.0,
5.2.0
5.2.0
Python Py27 (32bit* / 64bit*),
Py35 (32bit* / 64bit*),
Py36 (32bit* / 64bit*),
Py37 (32bit* / 64bit*),
Py38 (32bit* / 64bit*)
Py27,
Py35,
Py36,
Py37,
Py38
Py27,
Py35,
Py36,
Py37,
Py38
or just pip install casadi (needs pip -V>=8.1)

(*) 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:

Matlab/OctavePython

addpath('<yourpath>/casadi-matlabR2014a-v3.5.4')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))


from sys import path
path.append(r"<yourpath>/casadi-py27-v3.5.4")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))

Get started with the example pack.

Troubleshooting

Release notes

CasADi Functions

  • CasADi Functions can be serialized now (#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.

  • You can now evaluate CasADi Functions from C without requiring code-generation. 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 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:
    • 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 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)
  • 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)
  • 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)
Assets 56
README.md 81 Bytes

@jgillis jgillis released this Aug 5, 2020

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):

WindowsLinuxMac
Matlab R2016a or later,
R2014b,
R2014a,
R2013a or R2013b
R2014b or later,
R2014a
R2015a or later,
R2014b,
R2014a
Octave 4.4.1 (32bit / 64bit),
4.4.0 (32bit / 64bit),
5.1.0 (32bit / 64bit),
5.2.0 (32bit / 64bit)
4.4.1,
4.2.2,
5.1.0,
5.2.0
5.2.0
Python Py27 (32bit* / 64bit*),
Py35 (32bit* / 64bit*),
Py36 (32bit* / 64bit*),
Py37 (32bit* / 64bit*),
Py38 (32bit* / 64bit*)
Py27,
Py35,
Py36,
Py37,
Py38
Py27,
Py35,
Py36,
Py37,
Py38
or just pip install casadi (needs pip -V>=8.1)

(*) 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:

Matlab/OctavePython

addpath('<yourpath>/casadi-matlabR2014a-v3.5.3')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))


from sys import path
path.append(r"<yourpath>/casadi-py27-v3.5.3")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))

Get started with the example pack.

Troubleshooting

Release notes

CasADi Functions

  • CasADi Functions can be serialized now (#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.

  • You can now evaluate CasADi Functions from C without requiring code-generation. 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 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:
    • 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 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)
  • 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)
  • 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.
Assets 57
README.md 81 Bytes

@jgillis jgillis released this Jul 18, 2020

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):

WindowsLinuxMac
Matlab R2016a or later,
R2014b,
R2014a,
R2013a or R2013b
R2014b or later,
R2014a
R2015a or later,
R2014b,
R2014a
Octave 4.4.1 (32bit / 64bit),
4.4.0 (32bit / 64bit),
5.1.0 (32bit / 64bit),
5.2.0 (32bit / 64bit)
4.4.1,
4.2.2,
5.1.0,
5.2.0
5.2.0
Python Py27 (32bit* / 64bit*),
Py35 (32bit* / 64bit*),
Py36 (32bit* / 64bit*),
Py37 (32bit* / 64bit*),
Py38 (32bit* / 64bit*)
Py27,
Py35,
Py36,
Py37,
Py38
Py27,
Py35,
Py36,
Py37,
Py38
or just pip install casadi (needs pip -V>=8.1)

(*) 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:

Matlab/OctavePython

addpath('<yourpath>/casadi-matlabR2014a-v3.5.2')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))


from sys import path
path.append(r"<yourpath>/casadi-py27-v3.5.2")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))

Get started with the example pack.

Troubleshooting

Release notes

CasADi Functions

  • CasADi Functions can be serialized now (#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.

  • You can now evaluate CasADi Functions from C without requiring code-generation. 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 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:
    • 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 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)
  • 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)
  • 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.
Assets 57
README.md 81 Bytes

@jgillis jgillis released this Oct 17, 2019

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):

WindowsLinuxMac
Matlab R2016a or later,
R2014b,
R2014a,
R2013a or R2013b
R2014b or later,
R2014a
R2015a or later,
R2014b,
R2014a
Octave 4.4.1 (32bit / 64bit),
4.4.0 (32bit / 64bit),
5.1.0 (32bit / 64bit)
4.4.1,
4.2.2,
5.1.0
5.1.0
Python Py27 (32bit* / 64bit*),
Py35 (32bit* / 64bit*),
Py36 (32bit* / 64bit*),
Py37 (32bit* / 64bit*)
Py27,
Py35,
Py36,
Py37
Py27,
Py35,
Py36,
Py37
or just pip install casadi (needs pip -V>=8.1)

(*) 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:

Matlab/OctavePython

addpath('<yourpath>/casadi-matlabR2014a-v3.5.1')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))


from sys import path
path.append(r"<yourpath>/casadi-py27-v3.5.1")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))

Get started with the example pack.

Troubleshooting

Release notes

CasADi Functions

  • CasADi Functions can be serialized now (#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.

  • You can now evaluate CasADi Functions from C without requiring code-generation. 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 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:
    • 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 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)
  • 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)
  • 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.
Assets 49
README.md 81 Bytes

@jgillis jgillis released this Oct 3, 2019

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):

WindowsLinuxMac
Matlab R2016a or later,
R2014b,
R2014a,
R2013a or R2013b
R2014b or later,
R2014a
R2015a or later,
R2014b,
R2014a
Octave 4.4.1 (32bit / 64bit),
4.4.0 (32bit / 64bit),
5.1.0 (32bit / 64bit)
4.4.1,
4.2.2,
5.1.0
5.1.0
Python Py27 (32bit* / 64bit*),
Py35 (32bit* / 64bit*),
Py36 (32bit* / 64bit*),
Py37 (32bit* / 64bit*)
Py27,
Py35,
Py36,
Py37
Py27,
Py35,
Py36,
Py37
or just pip install casadi (needs pip -V>=8.1)

(*) 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:

Matlab/OctavePython

addpath('<yourpath>/casadi-matlabR2014a-v3.4.5')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))


from sys import path
path.append(r"<yourpath>/casadi-py27-v3.4.5")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))

Get started with the example pack.

Troubleshooting

Release notes

CasADi Functions

  • CasADi Functions can be serialized now (#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.

  • You can now evaluate CasADi Functions from C without requiring code-generation. 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 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:
    • 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 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)
  • 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)
  • 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
Assets 47
README.md 81 Bytes
Apr 4, 2019

ge2

py3 fix
ge

@jgillis jgillis released this Mar 28, 2019

automatic documentation update
Assets 2
Mar 14, 2019
fix to_function
  • 3.4.5
  • 58aa427
  • Compare
    Choose a tag to compare
    Search for a tag
  • 3.4.5
  • 58aa427
  • Compare
    Choose a tag to compare
    Search for a tag

@jgillis jgillis released this Aug 8, 2018

Install

Grab a binary from the table (for MATLAB, use the newest compatible version below):

WindowsLinuxMac
Matlab R2016a or later,
R2014b,
R2014a,
R2013a or R2013b
R2014b or later,
R2014a
R2015a or later,
R2014b,
R2014a
Octave 4.4.1 (32bit / 64bit),
4.4.0 (32bit / 64bit)
4.4.1,
4.2.2
4.4.0
Python Py27 (32bit* / 64bit*),
Py35 (32bit* / 64bit*),
Py36 (32bit* / 64bit*),
Py37 (32bit* / 64bit*)
Py27,
Py35,
Py36,
Py37
Py27,
Py35,
Py36,
Py37
or just pip install casadi (needs pip -V>=8.1)

(*) 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:

Matlab/OctavePython

addpath('<yourpath>/casadi-matlabR2014a-v3.4.5')
import casadi.*
x = MX.sym('x')
disp(jacobian(sin(x),x))


from sys import path
path.append(r"<yourpath>/casadi-py27-v3.4.5")
from casadi import *
x = MX.sym("x")
print(jacobian(sin(x),x))

Get started with the example pack.

Troubleshooting

Getting error "CasADi is not running from its package context." in Python? Check that you have casadi-py27-v3.4.5/casadi/casadi.py. If you have casadi-py27-v3.4.5/casadi.py instead, that's not good; add an extra casadi folder.

Got stuck while installing? You may also try out CasADi without installing, right in your browser (pick Python or Octave/Matlab).

Release notes

Credit where credit is due: Proper attribution of linear solver routines, reimplementation of code generation for linear solvers #2158, #2134

CasADi 3.3 introduced support for two sparse direct linear solvers relying based on sparse direct QR factorization and sparse direct LDL factorization, respectively. In the release notes and in the code, it was not made clear enough that part of these routines could be considered derivative works of CSparse and LDL, respectively, both under copyright of Tim Davis. In the current release, routines derived from CSparse and LDL are clearly marked as such and to be considered derivative work under LGPL. All these routines reside inside the casadi::Sparsity class.
Since CasADi, CSparse and LDL all have the same open-source license (LGPL), this will not introduce any additional restrictions for users.

Since C code generated from CasADi is not LGPL (allowing CasADi users to use the generated code freely), all CSparse and LDL derived routines have been removed or replaced in CasADi's C runtime. This means that code generation for CasADi's 'qr' and 'ldl' is now possible without any additional license restrictions. A number of bugs have also been resolved.

Parametric sensitivity for NLP solvers #724

CasADi 3.4 introduces differentiability for NLP solver instances in CasADi. Derivatives can be calculated efficiently with either forward or reverse mode algorithmic differentiation. We will detail this functionality in future publications, but in the meantime, feel free to reach out to Joel if you have questions about the functionality. The implementation is based on using derivative propagation rules to the implicit function theorem, applied to the nonlinear KKT system. It is part of the NLP solver base class and should in principle work with any NLP solver, although the factorization and solution of the KKT system (based on the sparse QR above) is likely to be a speed bottle neck in applications. The derivative calculations also depend on accurate Lagrange multipliers to be available, in particular with the correct signs for all multipliers. Functions for calculating parametric sensitivities for a particular system can be C code generated.

A primal-dual active set method for quadratic programming

The parametric sensitivity analysis for NLP solvers, detailed above, is only as good as the multipliers you provide to it. Multipliers from an interior point method such as IPOPT are usually not accurate enough to be used for the parametric sensitivity analysis, which in particular relies on knowledge of the active set. For this reason, we have started work on a primal-dual active set method for quadratic programming. The method relies on the same factorization of the linearized KKT system as the parametric sensitivity analysis and will support C code generation. The solver is available as the "activeset" plugin in CasADi. The method is still work-in-progress and in particular performs poorly if the Hessian matrix is not strictly positive definite.

Changes in Opti

  • describe methods in Matlab now follows index-1 based convention.
  • Added show_infeasibilities to help debugging infeasible problems.
  • Added opti.lbg,opti.ubg

Changes in existing functionality

  • Some CasADi operations failed when the product of rows and columns of a matrix was larger then 2^31-1.
    This limit has been raised to 2^63-1 by changing CasADi integer types to casadi_int (long long).
    The change is hidden for Python/Octave/Matlab users, but C++ users may be affected.
  • Fixed various bottlenecks in large scale MX Function initialization
  • Non-zero location reports for NaN/Inf now follow index-1 based convention in Matlab interface.

Added functionality

  • SX Functions can be serialized/pickled/saved now.
  • Added for-loop equivalents to the users guide
  • New backend for parallel maps: "thread" target, shipped in the binaries.
  • Uniform 'success' flag in solver.stats() for nlpsol/conic
  • Added evalf function to numerically evaluate an SX/MX matrix that does not depend on any symbols
  • Added diff and cumsum (follows the Matlab convention)
  • Added a rootfinder plugin ('fast_newton') that can code-generate
  • Added binary search for Linear/BSpline Interpolant. Used by default for grid dimensions (>=100)

Binaries

  • Binaries now come with a large set of plugins enabled
  • Binaries ship with "thread" parallelization
  • Binaries are hosted on Github instead of Sourceforge

Misc

  • Default build mode is Release mode once again (as was always intended)
  • CasADi passes with -Werror for gcc-6 and gcc-7
Assets 46
README.md 81 Bytes