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)

Bocop 2.0.5

Well, it took a bit longer than expected, but Bocop 2.0.5 is out !
More precisely the linux version comes first, windows and mac will follow.

Note: when installing a new version of Bocop, the GUI will retain the settings from the previous version, such as the current problem loaded at startup. It will also point to the previous core package location, which may cause a version number warning. Just select the path to the new install when prompted. This message will occur only once.

Changelog info:

2017/02/06: bocop-2.0.5
– package: improved windows installer will automatically offer to install Cmake and MinGW.
It should also not require PATH edits or reboots anymore (the latter may depend on windows
– package: link to GUI added to desktop.
– package: root directory for Bocop package should now be properly set up after install.
– IO: float precision for .sol file set to 15 instead of 20 to avoid spurious digits.
– GUI: added red lines for bounds for state, control and algebraic variables in visualization tab.
– GUI: ‘Clean problem’ in Build&Run menu now checks for file existence, thus preventing
warnings for trying to remove missing files.
– GUI: ‘Save .sol as’ in visualization tab should now overwrite properly if confirmed.
– GUI: reverted bounds format (in .bounds file) for state variables from block (experimental)
to normal.
– GUI: fixed some mis-positionning between bounds and labels in .bounds file (this bug was
cosmetic only and had no impact).
– GUI: in starting point tab, Ymin and Ymax should now be updated according to the figure
(linear or spline interpolations).
– GUI: constants are now numbered from 0 to n-1 for consistency with c++ code.
– GUI: tab ‘Discretization’ was merged into ‘Definition’ (method and time steps).
– GUI: prompt for clean and rebuild if Cmake fails to build the executable.
– GUI: prompt for build if executable not present when launching the optimization.
– GUI: splitted some functions for better code clarity
– GUI: fixed bug in export function for algebraic variables (time stages).
– example/contrast added: contrast optimization in magnetic resonance imaging.
– example/swimmer added: optimal swimming for 3-link Purcell type micro-swimmer.
– example/jackson: reorganization of the different versions of the parameter identification.
– example/methane: renamed to bioreactor; fixed improper use of Tdouble variables
(initial_time, final_time) in call to function parametrizedcontrol (pathcond.tpp).
– example/stateconstraint3: removed some bounds that could make the problem unfeasible.
– core: option for iteration output was disabled for now for debugging.

Links are available on the Download page.