Bocop 2.2.1 is out! The packages for linux, windows and macos are available at the Download page.


– [examples] added sample python script in goddard example
– [gui] moved GUI executable to package root folder (instead of qtgui/)
– [core] force flag -std=gnu++11 (c++11 caused problems on windows for CppAD)
– [core] squashed a few remaining compilation warnings (also build with clang)
– [core] replaced shared-ptr from boost with std one (requires c++11); removed boost

Bocop 2.2.0

Bocop 2.2.0 is out! The linux package is available at the Download page. MacOs and Windows packages are on their way.


– [bugfix] fixed name of function ‘readCSVtoMatrix’ in publictools
– [bugfix] batch optimization can now properly use an initialization file other than ‘problem.sol’ (continuation)
– [bugfix] in example jackson_id_3, function criterion now returns 0 as intended
– [examples] added example microgrid (deterministic version)
– [examples] added example health insurance (audit and non audit versions)
– [examples] added van der pol example
– [examples] added first and second order integrator examples
– [python] added a set of python utilities in
– [core/problem] added number of time steps as argument to function dynamics
– [core/problem] restored check for missing return values in dynamics. Added similar check for criterion.
– [core/problem] enabled past controls interpolation in function pathcond (already done for dynamics).
– [core] several internal arrays replaced with vectors for easier handling.
– [core] some code cleanup and reorganization (.sol save, constraint evaluation)
– [core] Ipopt status after optimization is now saved in .sol file instead of cpu time (which is still in result.out)
– [core] For parameter identification, the sum of errors to observation is now divided by the number of observations.
– [thirdparty] computation of derivatives now uses CppAD by default instead of Adolc/Colpack. This should give better performance overall. In particular the windows version should be more robust.
– [thirdparty] IPOPT updated to 3.12.12. This should prevent Windows build to hang when detecting Matlab.
– [thirdparty] CPPAD updated to 20190200.3 version.

For Windows users

Two small notes for windows users:

  • Bocop 2.1.0 uses an updated MinGW version that may cause incompatibilities with previous Bocop packages. We advise windows users to uninstall previous Bocop/MinGW before installing Bocop 2.1.0 (renaming the MinGW folder should be enough, so that your old C:\MinGW does not conflict with the new Bocop-2.1.0/MinGW).
  • Windows package uses a slightly older version of AdolC (2.5.2 vs 2.6.3 for linux/mac packages) that may perform worse on some examples, namely bioreactor, leukemia and swimmer. If you encounter troubles running these examples, please switch to CppAD by editing line 47 in the file Bocop-2.1.0/CMakeLists.txt and set the option from OFF to ON. Then clean and rebuild the problem before running it again.

option(USE_CPPAD “Use CppAD instead of Adol-C/Colpack for Automatic Differentiation” ON)


Ps. One final little thing: it seems that example fuller is missing its file problem.constants, leading to an error. This will be fixed in the next update, in the meanwhile you can simply copy the problem.constants from example default.

Several new examples

The Examples page was updated, with three new categories: energy systems (Microgrid), delay systems (Harvest, Leukemia) and process law (1D Integrator, 2D Integrator, MouseS & Maze: Extended Edition). These new examples are included in the latest Bocop and BocopHJB packages.

Bocop 2.1.0

Bocop 2.1.0 is out! The packages are available in Download page.

In this version, we provide the latest MinGW and CMake(3.10) for Windows users (now c++11 compliant).

Changelog info:

2017/10/17: bocop-2.1.0

– dynamics function now has access to past state and control variables,
in order to solve delay problems; pathcond has access to past states.
Restricted to fixed final time case. New examples: harvest, leukemia.
– problem dimensions are now passed to preProcessing function.
– functions for Heaviside and 2Dinterpolation added to publicTools
– [gui] visualization now show bounds for state variables (optional).
– [gui] bugfix for GUI unable to locate obervations files in parameter
identification problems. See jackson example.
– [gui] bugfix for GUI sometimes resetting problem discretization to
default (Midpoint with 100 time steps).
– [core] ADOL-C options for sparse hessian computation have been adjusted
and should give better performance in most cases.
– [core] time discretizations are now hardcoded (BocopDefinition.cpp)
instead of reading .disc files at runtime. Bocop executables therefore
do not need access to Bocop root package anymore at runtime.
Available methods: Euler (explicit), Euler (implicit), Midpoint (imp.),
Gauss II and Lobatto IIIC.
– [core] L2 norm of constraint violation is now correctly saved in .sol file.
– [core] some .tpp files were merged with their repective .hpp files.
– [core] a few minor memory leaks were fixed.
– [thirdparty, linux, mac] update to latest ADOL-C 2.6.3 and COLPACK.
Should give reduced memory usage as well as faster computation of derivatives.
– [thirdparty] build process should be faster, quieter and more foolproof.
– [thirdparty] Experimental: support for CppAD instead of AdolC/Colpack to
compute derivatives. Enabled with CMake option USE_CPPAD.
– [scripts] benchmark scripts were updated.
– [windows] Updated Cmake and MinGW to latest versions (now c++11 compliant).

BocopHJB 1.1.0

BocopHJB 1.1.0 is out, introducing a new Qt GUI similar to the one for Bocop.

Besides the user interface, this version also includes several new extensions and examples. A summary of the updates is given in the changelog below, and more information can be found in the user guide and examples catalog.
Packages for Linux and MacOS are available on the Download page, the windows version is in progress.

Changelog info:

2017/09/01: bocophjb-1.1.0
– [gui] BocopHJB now has a Qt GUI ! Gui allows for problem definition
(except the C++ code), executable build and run, and visualization.
– [core] added specific function for constraints on final state.
– [core] for switched systems, added function for possible state jumps at
transitions. Also added option to restrict the set of admissible
transitions (see maze example), defined by file or function.
– [core] optional computation of state probability distribution (see maze
example). Distribution is an output only, cannot be used in functions.
Probability of state transitions and mode switchings are also recorded.
– [core] input file .def was reorganized and expanded, all blocks must be
present in the correct order. Control discretization options were revamped.
State discretization is now in .def file instead of stateDisc/ folder.
Starting point/mode for simulated trajectory is also in .def file instead
of the C/C++ file simulation.cpp, which is removed.
Parameter timestep.output.frequency is now hardcoded to 10%.
– [core] new checks for cost functions when building in Debug mode.
– [core] some new info added in output file;
matlab reading script was updated accordingly.
– [core] new optional functions: preProcessing.cpp, postProcessing.cpp, and
dependencies.hpp/cpp. Dummy files are used if not present in problem folder.
Function preProcessing can modify the starting point (initial conditions)
as well as the number of modes (if they depend on some problem constants).
– [core] added checks for initial point in the interior of the state grid,
as well as for the starting mode of the trajectory simulation.
– [core] splitted IO functions in separate source files (core/sources/IO).
– [core] improved handling of infeasible case during trajectory simulation.
– [core] added recomputation of the objective during trajectory simulation,
with separate terms for the running, final and switching cost.
– [core] minor changes to value function and simulated trajectory log files.
– [core] improved control discretization info in log files.
– [core] several internal improvements (hjb constructor)