MP-Opt-Model-Release-Notes-5.0.md
July 12, 2025 · View on GitHub
What's New in MP-Opt-Model 5.0
Released Jul 12, 2025
Below is a summary of the changes since version 4.2 of MP-Opt-Model. See
the CHANGES.md file for all the gory details. For release notes
for previous versions, see Appendix C of the MP-Opt-Model User's
Manual.
New Features:
- Support for quadratic constraints in
opt_modeland quadratically-constrained quadratic programming (QCQP) problems, including functionsqcqps_master(),qcqps_gurobi(),qcqps_knitro(),qcqps_nlps(), and more. Thanks to Wilson González Vanegas. - Support for the open-source HiGHS solver for LP, QP and MILP problems, including functions
miqps_highs(),qps_highs(),have_feature_highs(),highsver(), andhighs_options(). Uses the HiGHSMEX interface for HiGHS. - New
relax_integeroption foropt_model.solve(). Set totrueto easily solve the LP or QP relaxation of a mixed integer LP or QP. - Support for Artelys Knitro solver for LP and QP problems, including functions
qps_knitro(),knitrover(), andartelys_knitro_options(). Thanks to Wilson González Vanegas. - Support for Artelys Knitro 15.x, which required changes to the prior options handling.
- Support for conversion between objects and structs to facilitate workarounds for Octave's inability to save and load classdef objects.
- New classes:
mp.opt_modelreplaces legacyopt_modelandmp_idx_managerclasses with a new modeling API. The legacy classes are retained for backward compatibility.mp.set_managerencapsulatesmp_idx_managerfunctionality into an individual field object representing a specific set type, rather than in the container class.mp.set_manager_opt_modelis a subclass ofmp.set_managerthat handles common functionality, e.g. related to handling solution data, for all of the set manager subclasses used byopt_model.mp.sm_lin_constraint- set manager class for linear constraintsmp.sm_quad_constraint- set manager class for quadratic constraintsmp.sm_nln_constraint- set manager class for nonlinear constraintsmp.sm_nln_cost- set manager class for general nonlinear costsmp.sm_quad_cost- set manager class for quadratic costsmp.sm_quad_cost_legacy- backward compatible set manager class for quadratic costsmp.sm_variable- set manager class for variables
- New functions:
artelys_knitro_options()sets options for Artelys Knitro.convert_constraint_multipliers()replacesconvert_lin_constraint_multipliers().convert_quad_constraint()converts bounded quadratic constraints to equality/inequality pairs.have_feature_highs()feature detection function for HiGHS solver.highsver()displays version of installed HiGHS.highs_options()sets options for HiGHS.knitrover()displays version of installed Artelys Knitro.miqps_highs()provides standardized interface for using HiGHS to solve MILP problems.mpopt2qcqpopt()creates/modifiesqcqps_masteroptions struct from MATPOWER options struct.mp.struct2object()converts a struct back to the object from which it was created.qcqps_gurobi()provides standardized interface for using Gurobi to solve QCQP problems.qcqps_knitro()provides standardized interface for using Artelys Knitro to solve QCQP problems.qcqps_nlps()provides standardized interface for usingnlps_masterto solve QCQP problems viafmincon, IPOPT, Artelys Knitro, or MIPS.qcqps_master()provides a single wrapper function for calling any of MP-Opt-Model's QCQP solvers.qps_highs()provides standardized interface for using HiGHS to solve LP/QP problems.qps_knitro()provides standardized interface for using Artelys Knitro to solve LP/QP problems.
New Documentation:
Two live scripts illustrate the use of new features.
milp_example1.mlx(inexamples) illustrates the use of MP-Opt-Model and the newmp.opt_modelclass to build and solve an optimization (MILP) model.qcqp_example1.mlx(inexamples) illustrates the new quadratic constraint features and two methods of building and solving a quadratically-constrained quadratic programming (QCQP) model.
Bugs Fixed:
- Using
miqps_master()with'DEFAULT'solver to solve an LP/QP problem without a MILP/MIQP solver available incorrectly threw a fatal error stating there was no solver available.
Other Changes:
- Major refactor of
mp_idx_managerto use newmp.set_managerclass. - Major refactor of
opt_modelto use newmp.set_manager_opt_modelsubclasses:mp.sm_lin_constraint- set manager class for linear constraintsmp.sm_quad_constraint- set manager class for quadratic constraintsmp.sm_nln_constraint- set manager class for nonlinear constraintsmp.sm_nln_cost- set manager class for general nonlinear costsmp.sm_quad_cost_legacy- backward compatible set manager class for quadratic costsmp.sm_variable- set manager class for variables
- Deprecate the following
opt_modelmethods in favor of methods of the individualmp.set_managerobjects contained by theopt_modelobject:add_named_set()-- usemp.set_manager.add()describe_idx()-- usemp.set_manager.describe_idx()getN()-- usemp.set_manager.get_N()init_indexed_name()-- usemp.set_manager.init_indexed_name()set_type_idx_map()-- usemp.set_manager.set_type_idx_map()add_lin_constraint()-- usemp.sm_lin_constraint.add()add_nln_constraint()-- usemp.sm_nln_constraint.add()add_nln_cost()-- usemp.sm_nln_cost.add()add_quad_cost()-- usemp.sm_quad_cost.add()add_var()-- usemp.sm_variable.add()eval_lin_constraint()-- usemp.sm_lin_constraint.eval()eval_nln_constraint()-- usemp.sm_nln_constraint.eval()eval_nln_constraint_hess()-- usemp.sm_nln_constraint.eval_hess()eval_nln_cost()-- usemp.sm_nln_cost.eval()eval_quad_cost()-- usemp.sm_quad_cost.eval()init_indexed_name()-- usemp.set_manager.init_indexed_name()params_lin_constraint()-- usemp.sm_lin_constraint.params()params_nln_constraint()-- usemp.sm_nln_constraint.params()params_nln_cost()-- usemp.sm_nln_cost.params()params_quad_cost()-- usemp.sm_quad_cost.params()params_var()-- usemp.sm_variable.params()set_params()-- usemp.set_manager.set_params()varsets_cell2struct()-- usemp.sm_variable.varsets_cell2struct()varsets_idx()-- usemp.sm_variable.varsets_idx()varsets_len()-- usemp.sm_variable.varsets_len()varsets_x()-- usemp.sm_variable.varsets_x()
- Update
mosek_options()for MOSEK 11.x compatibility. - Update
miqps_<solver>()functions to avoid changing MIP solution values in price computation stage. It was rounding integer variables, potentionally causing a small discrepancy between the objective value reported by the solver and the value obtained by computing directly from the returned solution x. - Deprecate the
convert_lin_constraint_multipliers()in favor ofconvert_constraint_multipliers().
Incompatible Changes:
- Parsed solution information was moved from the
solnproperty of theopt_modelobject to thesolnproperty of the individual childmp.set_manager_opt_modelobjects. Currently it is still available at the original location, but this is now deprecated. - The
knitro_optsfield of theoptinput tonlps_master()andnlps_knitro()and thesolve()method ofopt_modelhas been redesigned. It is now a raw Artelys Knitro options struct, so theopts,tol_xandtol_ffields are no longer valid. Fortol_xandtol_f, usextolandftol, and the contents ofoptsshould be placed directly in the top level of theknitro_optsfield. - Remove support for older versions of Artelys Knitro, including all references to
ktrlinkfor pre-v9 versions. Currently supports Artelys Knitro version 13.1 and later.