Skip to content

Releases: FilippoAiraldi/casadi-nlp

1.6.4

15 Jan 12:48
Compare
Choose a tag to compare

Changes

  • improved csnlp.core.solutions.def subsevalf: now should be faster, especially when substituting variables from dictionaries or iterables
  • fixing an issue in csnlp.util.io.save for blosc2
  • extended testing to Python 3.12 and 3.13

1.6.3

15 Nov 20:06
Compare
Choose a tag to compare

Changes

Major

  • implemented Solution.infeasible property that tries to understand whether the solver returned an infeasible status
  • implemented csnlp.util.math.norm_1 and norm_inf for easier conversion of these norms to linear programmes
  • converted Mpc.set_linear_dynamics to the more general set_affine_dynamics
  • added single and multiple shooting affine time-varying dynamics in PwaMpc, allowing users to specify a switching sequence and solving a simpler quadratic programme, instead of optimizing also over the sequence of regions

Minor

  • added solver_plugin property to Solution, so that one can retrieve the solver used to compute a solution to an optimization problem
  • fixed bug with optimization problems with a single scalar discrete variable
  • fixed bug in ScenarioMpc where single slack variables were not properly substituted
  • better docstrings
  • updated CI

1.6.2

23 Oct 12:18
Compare
Choose a tag to compare

Changes

Major

  • implemented support for discrete variables (see argument discrete in csnlp.Nlp.variable)
  • implemented new wrapper csnlp.wrappers.PwaMpc for creating model predictive control (MPC) controllers for piecewise affine (PWA) systems. The class takes care of automatically converting the PWA dynamics to a big-M mixed-logic relaxation
  • renamed csnlp.wrappers.Mpc.set_dynamics to the more informative name csnlp.wrappers.Mpc.set_nonlinear_dynamics
  • implemented csnlp.wrappers.Mpc.set_linear_dynamics
  • all dynamics constraints are now generated via casadi.Function.map (in multiple shooting) and casadi.Function.mapaccum (in single shooting) for faster construction time

Minor

  • implemented new examples for mixed-integer optimization problems and optimal control problems
  • better docstrings and error messages
  • dynamics functions are no longer saved, after setting them, in the csnlp.wrappers.Mpc class and subclasses

1.6.1

04 Oct 12:08
Compare
Choose a tag to compare

Changes

Major

  • Implemented a lazy version of csnlp.Solution that will postpone computations of various quantities pertaining to a primal-dual optimal point until necessary
  • Removed the need to specify n_in and n_out in csnlp.wrappers.Mpc.set_dynamics
  • Refined the dependency on NumPy

Minor

  • In csnlp.wrappers.NlpSensitivity, the computation of Jacobians and Hessians was streamlined: now only those sensitivities that are needed by the user are computed
  • Bug fixed in csnlp.Nlp.init_solver where the solver options were not properly saved for later re-initalizations
  • Improvements and fixes to documentation

v1.6.0

17 Jul 13:26
Compare
Choose a tag to compare

Changes

  • Now documentation is available online here
  • Updated dependency to numpy < 2.0.0, as the newest release of numpy breaks casadi
  • Updated dependency to joblib >= 1.4.0
  • Updated multistart.ParallelMultistartNlp.__init__ to accept a generic parallel_kwargs dict to instantiate the joblib.Parallel backend

v1.5.10

11 Apr 08:43
Compare
Choose a tag to compare

Changes

Major

  • added support for NumPy's .npz saving format to the I/O utils in csnlp.util.io
  • implemented new multistart NLP paradigm, the MappedMultistartNlp class, which leverages the casadi.Function.map API

Minor

  • improvements to ParallelMultistartNlp: now the solutions are ranked first by feasibility, then by success, and only at the end by optimality
  • improvements to RandomStartPoints: now supports two new arguments, biases and scales
  • improved internal logics and type hints

v1.5.9

29 Dec 16:07
Compare
Choose a tag to compare

Changes

Major

  • fixed error on bounds on initial and terminal states in ScenarioBasedMpc

Minor

  • improvements to internal files
  • switched to pre-hooks
  • fixes to tests
  • better type hinting for seed

v1.5.8

26 Oct 06:02
Compare
Choose a tag to compare

Changes

Major

  • removed support for Python 3.8
  • implemented the ScenarioBasedMpc wrapper to create MPC controllers based on the Scenario Approach
  • added extra args in Mpc and ScenarioBasedMpc to allow to include or exclude lower and upper bounds on initial and terminal state upon creation
  • removed quad_form in favour of casadi.bilin (which is built in in the library)
  • added support for all solvers (previously, only IPOPT, sqpmethod, and a small other few could be instantiated)

Minor

  • updates to config files
  • updated plotting utilities
  • moved from full to toarray, which appears to be faster
  • moved to relative imports

v1.5.7

29 Aug 13:56
Compare
Choose a tag to compare

Changes

Major

  • method licq in NlpSensitivity wrapper now includes also the jacobians of the upper and lower bound inequalities
  • added methods in Nlp to remove bounds on variables and constraints AFTER their creation (still, it is recommended to avoid doing so it not necessary)
  • in Mpc, added possibility to automatically remove upper and lower bounds on initial states to avoid overconstraining (disabled by default)
  • Solution object now hosts also the values of the dual variables at the optimal point

Minor

  • improved cache handling
  • removed usage of slots due to bugs in pickling and deepcopying
  • removed some unused methods

v1.5.6

20 Jun 15:28
Compare
Choose a tag to compare

Changes

  • improved lower and upper bound broadcasting during variable creation
  • removed util/random.py in favour of np.random.default_rng