- Add
relax_integer
option 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_model
base class to handle commonopt_model
functionality, such as handling solutions, for the individual field object subclasses. - Refactor
opt_model
to move lots of functionality into newmp.set_manager_opt_model
subclasses: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_model
methods in favor of methods of the individualmp.set_manager
objects contained by theopt_model
object: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
soln
property ofopt_model
object tosoln
property of individual childmp.set_manager_opt_model
objects. 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_manager
class to encapsulatemp_idx_manager
functionality into an individual field object representing a specific set type, rather than in the container class. - Refactor
mp_idx_manager
to use newmp.set_manager
class.
- 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_model
an optionalstash
input 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_soln
is true. - Add new method
has_parsed_soln()
toopt_model
to 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.m
wrapper 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.m
entirely.
- 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.alg
to'<MY_SOLVER>'
to allow for handling custom MILP/MIQP solvers.
- Add support to
nlps_master()
for callingnlps_<my_solver>()
by settingopt.alg
to'<MY_SOLVER>'
to allow for handling custom NLP solvers.
- Add to
opt_model.add_lin_constraint()
the option to provide/store the transpose of theA
matrix 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
x0
as 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
Method
option to be set to 5, for deterministic concurrent simplex.
- Add
runtime
field tooutput
argument ofqps_glpk()
andqps_mosek()
. - Add support to
qps_master()
for callingqps_<my_solver>()
by settingopt.alg
to'<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
fmincon
tests 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_name
input 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_types
property as headers foropt_model.display()
to simplify things and facilitate use by subclasses.
- Move
init_set_types()
call out ofopt_model
constructor 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.thresh
option. If the absolute value of any element of the solution vector exceeds the threshold,exitflag
is 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 emptyidx
no 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
, andvu
inputs toopt_model.add_var()
method, andl
andu
inputs toopt_model.add_lin_constraint()
to be scalars that get expanded automatically to the appropriate vector dimension.
- Add
get_soln()
method toopt_model
for 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 thesoln
field 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.x0
is 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_model
can 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
output
return value fromnleqs_newton()
, changed thenormF
field ofoutput.hist
tonormf
, for consistency in using lowercasef
everywhere.
- 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 forfsolve
and 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_model
class 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_model
class, 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_model
and 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_model
methods and code related to legacy user-defined OPF costs fromopt_model
toopf_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_model
instead 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_model
class: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 usingfmincon
options.
- 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_model
class 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.