- Move
mp.opt_model.is_mixed_integer()logic into neware_all_continuous()method ofmp.sm_variable, and make the former a simple wrapper. - Fix bug with parameter caching in
mp.sm_variable, where callingparams()without requesting the variable type would not cache it, so subsequent requests for the variable time incorrectly returned an empty string. Now the variable type is assembled and cached any time there is a non-continuous variable present.
- Add
clear_cached_params()method tomp.set_manager_opt_modelandmp.opt_model, to clear aggregated parameters cached by theparams()method.
- Add support for the Gurobi's new PDHG LP solver in
qps_gurobi().
- Add support for the new HiPO interior point LP solver in HiGHS, including
have_feature_highs_hipo()to detect availability.
- Add
fix_integerandrelax_integeroptions tomiqps_master()and move the implementations frommp.opt_model.solve()tomiqps_master(). Note: Since the implementation is inmiqps_master()it is not available directly in the individual solver-specificmiqps_<solver>()functions.
- Add
fix_integeroption formp.opt_model.solve(). Set to true to fix any integer variables to their initial values, as specified inx0oropt.x0. - Add MILP example from
examples/miqp_ex1.mto MILP tests. - Fix typo bug in dimension checking in
set_params()for quadratic costs.
- Avoid error displaying
mp.opt_modelobject when variable was added with a sparse dimension argument.
- Improve reliability of detection of CLP MEX file.
- Fix failing tests in
t_qcqps_masterwhen'DEFAULT'implies'FMINCON'(as in MATLAB Online).
- Release 5.0.
- Move examples from
lib/tto their ownexamplesdirectory.
- Add support for Artelys Knitro 15.x which required changes to the prior options handling.
- INCOMPATIBLE CHANGE: 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. - INCOMPATIBLE CHANGE: Remove support for older versions of Knitro,
including all references to
ktrlinkfor pre-v9 versions. Currently supports Artelys Knitro version 13.1 and later.
- Add new
mp.struct2object()function to convert a struct back to the object from which it was created. Helps with workarounds to the fact that Octave still (as of 10.x) does not support saving/loading of classdef objects. This function allows objects to implementto_struct()andfrom_struct()methods to facilitate the process. - Add
to_struct()andfrom_struct()methods tomp.opt_model,mp.set_manager, and legacyopt_modelclasses, to facilitate trivial conversion between objects, which Octave cannot save/load, and structs, which it can.
- Fix handling of scalar inputs for vector parameters when adding an empty set of variables or linear/quadratic constraints. Now properly "expands" them to an empty vector (issue #16).
- Update handling by
mp.sm_quad_costof constant term for quadratic costs (issue #15):- When
His empty, a scalarkwill no longer be expanded (implicitly) to a vector, rather it will result in a scalar cost set. - When
His a vector andkis a scalar,kwill be expanded explicitly to a vector. Themp.sm_quad_cost_legacyclass is unchanged, so this change affects onlymp.opt_model, not the legacyopt_model.
- When
- Add support to
qps_master()andmiqps_master()for the open-source HiGHS solver for LP, QP and MILP problems, including functionsmiqps_highs(),qps_highs(),have_feature_highs(),highsver(), andhighs_options(). Uses the HiGHSMEX interface for HiGHS. - Fix that 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.
- Fix crash in
mp.sm_quad_cost.display_soln()when linear coefficient is empty.
- Add support for quadratic constraint and QCQP (quadratically-
constrained quadratic programming) problems.
Thanks to Wilson Gonzalez Vanegas.
- Add new top-level wrapper function
qcqps_master()to provide a standard unified interface quadratically-constrained quadratic programming (QCQP) problems, with the ability to provide solver- specific input options. - Add
qcqps_gurobi(),qcqps_knitro(),qcqps_nlps()with interface that matchesqcqps_master()to handle implementation for Gurobi, Artelys Knitro,fmincon, IPOPT, and MIPS solvers. - Add
mpopt2qcqpopt()to set up an options struct forqcqps_master()based on a MATPOWER options struct. - Add
mp.sm_quad_constraintclass to handle quadratic constraints inopt_model. - Add
qcnproperty toopt_modelfor quadratic constraints and automatic detection of a newQCQPproblem type that is sent toqcqps_master()to solve.
- Add new top-level wrapper function
- 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.
- Update
mosek_options()for MOSEK 11.x compatibility.
- Add support to
qps_master()for Artelys Knitro solver for LP and QP problems, including functionsqps_knitro(),knitrover(), andartelys_knitro_options(). Thanks to Wilson Gonzalez Vanegas.
- Throw error if
opt_model.parse_soln()is called for an unsolved model.
- Add
relax_integeroption foropt_model.solve(). Set to true to easily solve the LP or QP relaxation of a mixed integer LP or QP.
- Add
mp.set_manager_opt_modelbase class to handle commonopt_modelfunctionality, such as handling solutions, for the individual field object subclasses. - Refactor
opt_modelto move lots of functionality into newmp.set_manager_opt_modelsubclasses:mp.sm_lin_constraint- set manager class for linear 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_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()
- INCOMPATIBLE CHANGE: Move parsed solution from
solnproperty ofopt_modelobject tosolnproperty of individual childmp.set_manager_opt_modelobjects. Currently it is still available at the original location, but this is now deprecated.
- Add option for
opt_model.display_soln()to print to a file.
- Add
mp.set_managerclass to encapsulatemp_idx_managerfunctionality into an individual field object representing a specific set type, rather than in the container class. - Refactor
mp_idx_managerto use newmp.set_managerclass.
- Release 4.2.
- Fix bug in test
t_opt_model()for MATLAB R2011b and earlier.
- Fix false positive in
have_feature_fsolve()in case where the file is present, but without a valid license.
- Fix bug in
miqps_mosek()where the lower and upper bounds of binary variables got overwritten with 0 and 1, respectively, effectively relaxing any potentially tighter bounds provided as input. - Clear cached parameters after updating linear constraints via
opt_model.set_params(). - Add caching of aggregate output parameters in
opt_model.params_var().
- Add Sphinx-based Reference documentation.
- Add to the
parse_soln()method ofopt_modelan optionalstashinput argument that, if present and true, causes the parsed solution to be stored back in the object, as thesolve()method was already doing whenopt.parse_solnis true. - Add new method
has_parsed_soln()toopt_modelto check for availability of a parsed solution in the model.
- Update
have_feature_ipopt()to recognize IPOPT MEX installations from Enrico Bertolazzi's mexIPOPT, which include MEX files that have been renamed to architecture-specific names along with anipopt.mwrapper function to call the appropriate one. Thanks to Carlos Murillo-Sánchez. Note: While MP-Opt-Model no longer requires this, my recommendation is still to simply rename the MEX file toipopt.<mexext>, with the appropriate architecture-specific extension, and delete the unnecessaryipopt.mentirely.
- Add
convert_lin_constraint()andconvert_lin_constraint_multipliers()functions to eliminate code duplication for common task of converting linear constraints and their multipliers between a single set of doubly-bounded inequality constraints and separate sets of equality and upper-bounded inequality constraints. - Change solver for CPLEX price computation stage in
miqps_cplex()from primal simplex to dual simplex (probably no impact, except it was a simple way to get a newly failing test in another project to pass again).
- Always skip price computation stage in
miqps_<solver>()functions for pure (as opposed to mixed) integer problems.
- Add support to
miqps_master()for callingmiqps_<my_solver>()by settingopt.algto'<MY_SOLVER>'to allow for handling custom MILP/MIQP solvers.
- Add support to
nlps_master()for callingnlps_<my_solver>()by settingopt.algto'<MY_SOLVER>'to allow for handling custom NLP solvers.
- Add to
opt_model.add_lin_constraint()the option to provide/store the transpose of theAmatrix instead of the original. This can potentially save significant memory for sparse matrices with many more columns than rows. E.g. storage constraints in MOST for 8760 hour planning horizon.
- Update
opt_model.display_soln()to avoid displaying an infinite average for quadratic costs when corresponding quantity is zero.
- Clear cached parameters after updating quadratic costs via
opt_model.set_params().
- Tweak some MI/QPS solver tests to make them more robust for
'DEFAULT'solver under different environments.
- Update for compatibility with MATLAB R2023a (Optimization Toolbox 9.5)
which removed
x0as a valid input tolinprog.
- Add
opt_model.is_solved()method to determine if the model has been solved and contains the solution. - Add
opt_model.display_soln()method to display the results of a solved model, including values, bounds and shadow prices for variables and linear constraints, values and shadow prices for nonlinear constraints, and individual cost components.
- Release 4.1.
- Allow for Gurobi's
Methodoption to be set to 5, for deterministic concurrent simplex.
- Add
runtimefield tooutputargument ofqps_glpk()andqps_mosek(). - Add support to
qps_master()for callingqps_<my_solver>()by settingopt.algto'<MY_SOLVER>'to allow for handling custom LP/QP solvers.
- Update for compatibility with Artelys Knitro 13.1 and later.
- Relax some test tolerances to prevent failure with Gurobi 9.5.
- Add elapsed time in seconds to results of the
solve()method ofopt_model, returned inom.soln.output.et.
- Skip some
fmincontests using interior point algorithm with finite difference Hessian that began failing in MATLAB R2021b.
- Release 4.0.
- Add several enhancements to
mp_idx_manager/set_type_idx_map().- Speed improvements
- Add idxs = [] option to specify "all"
- Add optional
group_by_nameinput argument.
-
Add support for new class of problems - parameterized nonlinear equations (PNE). Either create a model with only equality constraints (no inequalities or costs) and with number of variables equal to 1 more than number of constraints, or call
pnes_master()directly. See Section 4.5 of User's Manual for details.- Predictor/corrector numerical continuation method for tracing solution curves for PNE problems.
- Plotting of solution curves.
- User-defined event functions and callback functions.
- Warm-start capabilities.
Thanks to Shrirang Abhyankar and Alexander Flueck for contributions to this feature.
-
Add functions:
pnes_master()pne_callback_default()pne_callback_nose()pne_callback_target_lam()pne_detect_events()pne_detected_event()pne_event_nose()pne_event_target_lam()pne_pfcn_arc_length()pne_pfcn_natural()pne_pfcn_pseudo_arc_length()pne_register_callbacks()pne_register_events()mpopt2pneopt()
- Refactor
describe_idx()into a new method,set_type_idx_map(), that returns in information in a programmatically usable form, and an updateddescribe_idx()that calls the new method, then formats the results in the expected char array(s).
- Calling the
problem_type()oris_mixed_integer()method on an empty model no longer cause a fatal error.
- Update to use labels from
set_typesproperty as headers foropt_model.display()to simplify things and facilitate use by subclasses.
- Move
init_set_types()call out ofopt_modelconstructor to avoid complexity of other workarounds for bug in Octave 5.2 and earlier related to inheritance of methods called during construction. Nowinit_set_types()is called automatically as needed after object construction and before object use inadd_var(),display()andinit_indexed_name().
- Add optional threshold for detecting failure of LEQ solve, by setting
the
leq_opt.threshoption. If the absolute value of any element of the solution vector exceeds the threshold,exitflagis set to 0, indicating failure.
- Fix examples of
om.set_params()usage in manual and help text.
- Release 3.0.
- Move
have_feature()to MP-Test and respective feature detection functions to MP-Test, MIPS, and MATPOWER.- MP-Test
have_feature()have_feature_matlab()have_feature_octave()
- MIPS
have_feature_lu_vec()have_feature_pardiso_legacy()have_feature_pardiso_object()have_feature_pardiso()
- MATPOWER
have_feature_e4st()have_feature_minopf()have_feature_most()have_feature_pdipmopf()have_feature_regexp_split()have_feature_scpdipmopf()have_feature_sdp_pf()have_feature_smartmarket()have_feature_syngrid()have_feature_tralmopf()
- MP-Test
- Add
have_feature()as a modular, extensible alternative tohave_fcn(), where the detection of a feature named<tag>is implemented by the functionhave_feature_<tag>(). - Make
have_fcn()a simple wrapper around the newhave_feature().
- Add
set_params()method to modify parameters of existing variables, costs and constraints of an MP-Opt-Model object. - Calling
params_var()method with emptyidxno longer results in fatal error. - For
opt_model, fixed incorrect evaluation of constant term in vector valued quadratic costs with constant term supplied as a vector. - Simplified logic to determine whether a quadratic cost for an MP-Opt-Model object is vector vs. scalar valued. If the quadratic coefficient is supplied as a matrix, the cost is scalar varied, otherwise it is vector valued.
- Allow
v0,vl, andvuinputs toopt_model.add_var()method, andlanduinputs toopt_model.add_lin_constraint()to be scalars that get expanded automatically to the appropriate vector dimension.
- Add
get_soln()method toopt_modelfor extracting solved results for a given named set of variables, constraints or costs. - Add
parse_soln()method which returns a struct with a complete set of solution vector and shadow price values for a solved model.
- Add caching of problem_type() return value.
- Add support for OSQP solver from https://osqp.org for LP
and QP problems, including functions
qps_osqp(),osqpver(), andosqp_options().
- Save the results of
solve()method to thesolnfield of the MP-Opt-Model object.
- Add
eval_lin_constraint()method to evaluate the constraint values for the full set or an individual named subset of linear constraints.
- Starting point supplied to
solve()viaopt.x0is no longer ignored for nonlinear equations.
- Release 2.1.
- Add core NLEQ solver function
nleqs_core()with arbitrary, user-defined update function, used to implement Gauss-Seidel and Newton solvers,nleqs_gauss_seidel()andnleqs_newton().
- Add linear equation (
'LEQ') problem type for models with equal number of variables and linear equality constraints, no costs, and no inequality or nonlinear equality constraints. Solved viamplinsolve(). - The
solve()method ofopt_modelcan now automatically handle mixed systems of equations, with both linear and nonlinear equality constraints.
- Add fast-decoupled Newton's and Gauss-Seidel solvers for nonlinear
equations. Use
alg = 'FD'andalg = 'GS'withnleqs_master(). See alsonleqs_fd_newton()andnleqs_gauss_seidel().
- Allow
solve()method to pass along number of requested output arguments*_master()solver functions. - INCOMPATIBLE CHANGE: In
outputreturn value fromnleqs_newton(), changed thenormFfield ofoutput.histtonormf, for consistency in using lowercasefeverywhere.
- Release 2.0.
- Add to
eval_nln_constraint()method the ability to compute constraints for a single named set.
- Skip evaluation of gradient if
eval_nln_constraint()is called with a single output argument. - Add
params_nln_constraint()method, and add documentation to the manual for it andparams_nln_cost().
- Add
mpopt2nleqopt()to create or modify annleqs_master()options struct from a MATPOWER options struct. - Add table of valid
have_fcn()input tags to User's Manual.
- Add support for nonlinear equations (NLEQ) to
opt_model. For problems with only nonlinear equality constraints and no costs, theproblem_type()method returns'NLEQ'and thesolve()method callsnleqs_master()to solve the problem. - Add tests for solving LP/QP, MILP/MIQP, NLP and NLEQ problems via
opt_model.solve().
- Add
nleqs_master()function as unified interface for solving nonlinear equations, including implementations forfsolveand Newton's method in functionsnleqs_fsolve()andnleqs_newton(), respectively.
- Add new
'fsolve'tag tohave_fcn()to check for availability offsolve()function.
- Remove redundant MIPS tests from
test_mp_opt_model.
- Release 1.0.
- Add MP-Opt-Model User's Manual in
docs, with LaTeX source indocs/src. - Add usage examples to
README.md.
- Add
README.md,CHANGES.md,AUTHORS,CONTRIBUTING.md,LICENSE. - Refactor
opt_modelclass to inherit from new abstract base classmp_idx_manager, which can be used to manage the indexing of other sets of parameters, etc. in other contexts.
- Version 0.8.
- Add
mpomver()to define MP-Opt-Model version information. - INCOMPATIBLE CHANGE: Renamed the following functions and
modified the order of their input args so that the MP-Opt-Model
object appears first. Ideally, these would be defined as methods
of the
opt_modelclass, but Octave 4.2 and earlier is not able to find them via a function handle (as used in thesolve()method) if they are inherited by a subclass.opf_consfcn()-->nlp_consfcn()opf_costfcn()-->nlp_costfcn()opf_hessfcn()-->nlp_hessfcn()
- Add GitHub Actions CI workflow and Travis-CI configuration.
- Add
test_mp_opt_model()to run all tests. - Remove MATPOWER dependencies.
- Move code related to solver interfaces,
opt_modeland a few other functions likehave_fcn()andnested_struct_copy()from main MATPOWER repository to new MP-Opt-Model repository.
⬆ In MP-Opt-Model repository ⬆
⬇ In MATPOWER repository ⬇
- Move deprecated
opt_modelmethods and code related to legacy user-defined OPF costs fromopt_modeltoopf_model. - INCOMPATIBLE CHANGE: Modify order of default output arguments of
opt_model.get_idx()(again), removing the one related to legacy costs.
- Add
nlpopf_solver()based on the newsolver()method ofopt_model. This single function replacesmipsopf_solver(),fmincopf_solver(),ipoptopf_solver(), andktropf_solver(). - Convert
dcopf_solver()to use the newsolver()method ofopt_modelinstead of callingqps_matpower()manually. - Add new top-level wrapper function
nlps_matpower()to provide a standard interface for MATPOWER's nonlinear program (NLP) solvers (fmincon, IPOPT, Artelys Knitro, and MIPS), with calling syntax similar tomips(). It includes the ability to pass in solver-specific input options. - Add
nlps_fmincon(),nlps_ipopt()andnlps_knitro(), with interface that matchesnlps_matpower()to handle implementation forfmincon, IPOPT, and Artelys Knitro solvers, respectively. - Add
mpopt2nlpopt()to set up an options struct fornlps_matpower()based on a MATPOWER options struct. - Add three new methods to
opt_modelclass:is_mixed_integer()- returns true if the model includes any binary or integer variablesproblem_type()- returns one of the following strings, based on the characteristics of the variables, costs and constraints in the model:'NLP'- nonlinear program'LP'- linear program'QP'- quadratic program'MILP'- mixed-integer linear program'MIQP'- mixed-integer quadratic program
solve()- solves the model usingqps_matpower(),miqps_matpower(), ornlps_matpower(), depending on the problem type ('MINLP'problems are not yet implemented)
- Fix bug in
ktropf_solver()where Artelys Knitro was still usingfminconoptions.
- Fix issue with missing objective function value from
miqps_mosek()andqps_mosek()when return status is "Stalled at or near optimal solution."
- Remove unused input arguments from
opf_consfcn()andopf_hessfcn().
- Add
copy()method toopt_modelclass to get around issues with inheritance in constructors that was preventing copy constructor from working in Octave 5.2 and earlier (see also Octave bug 52614.
- Significant performance improvement for CPLEX on small problems by
eliminating call to
cplexoptimset(), which was a huge bottleneck. - Fix CPLEX 12.10 compatibility issue #90.
- Artelys Knitro 12.1 compatibility fix.
- Improve performance of
opt_model.add_named_set(). (See issue #79.) Thanks to Baraa Mohandes. - Refactor code in
opt_model.params_lin_constraint()andopt_model.params_quad_cost()to speed up sparse matrix construction when there are lots of constraint or cost sets. Results in significant speedups for some problems during problem setup in MOST. (See pull request #70.) Thanks to Daniel Muldrew.
- This change history begins with the code that was part of the MATPOWER 7.0 release, which is tagged as version 0.7.0 in the MP-Opt-Model repository.