Releases: MATPOWER/mp-opt-model
MP-Opt-Model 4.2
What's New in MP-Opt-Model 4.2
Released May 10, 2024
Below is a summary of the changes since version 4.1 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:
- Option for
opt_model.add_lin_constraint()
to provide/store the
transpose of the A 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. - Add support to
nlps_master()
for callingnlps_<my_solver>()
by
settingopt.alg
to'<MY_SOLVER>'
to allow for handling custom
NLP solvers. - Add support to
miqps_master()
for callingmiqps_<my_solver>()
by settingopt.alg
to'<MY_SOLVER>'
to allow for handling custom
MILP/MIQP solvers. - 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. - New Sphinx-based Reference documentation.
- New functions:
convert_lin_constraint()
converts linear constraints from a
single set of doubly-bounded inequality constraints to separate
sets of equality and upper-bounded inequality constraints.convert_lin_constraint_multipliers()
converts multipliers on
linear constraints from separate sets for equality and
upper-bounded inequality constraints to those for doubly-bounded
inequality constraints.
- New
opt_model
methods:is_solved()
indicates whether the model has been solved.has_parsed_soln()
indicates whether a parsed solution is
available in the model.display_soln()
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.
Bugs Fixed:
- Clear cached parameters after updating linear constraints or
quadratic costs viaopt_model.set_params()
. - In
miqps_mosek()
the lower and upper bounds of binary variables
got overwritten with 0 and 1, respectively, effectively relaxing
any potentially tighter bounds provided as input. - Fix false positive in
have_feature_fsolve
in case where the file
is present, but without a valid license.
Other Changes:
-
Update for compatibility with MATLAB R2023a (Optimization Toolbox
9.5) and later, which removedx0
as a valid input tolinprog
. -
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 an
ipopt.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 to
ipopt.<mexext>
, with the appropriate architecture-specific
extension, and delete the unnecessaryipopt.m
entirely. -
Always skip price computation stage in
miqps_<solver>()
functions
for pure (as opposed to mixed) integer problems. -
Add caching of aggregate output parameters in
opt_model.params_var()
.
MP-Opt-Model 4.1
What's New in MP-Opt-Model 4.1
Released December 13, 2022
Below is a summary of the changes since version 4.0 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
- Add support to
qps_master()
for callingqps_<my_solver>()
by
settingopt.alg
to'<MY_SOLVER>'
to allow for custom solvers.
Other Changes
- Update for compatibility with Artelys Knitro 13.1 and later.
- Add elapsed time in seconds to results of the
solve()
method of
opt_model
, returned inom.soln.output.et
. - Add
runtime
field tooutput
argument ofqps_glpk()
and
qps_mosek()
.
MP-Opt-Model 4.0
What's New in MP-Opt-Model 4.0
Released October 18, 2021
Below is a summary of the changes since version 3.0 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 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 callpnes_master()
directly. See Section 4.5
of User's Manual for details.
Thanks to Shrirang Abhyankar and Alexander Flueck for contributions to this
feature, which is based on the continuation power flow code in MATPOWER 7.1.- 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.
- Predictor/corrector numerical continuation method for tracing solution
- 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. - New functions:
pnes_master()
provides unified interface for parameterized nonlinear
equation (PNE) solvers.pne_callback_default()
collects PNE results and optionally plots
solution curve.pne_callback_nose()
handles event signaling a nose point or limit
has been reached.pne_callback_target_lam()
handles event signaling a target value
of parameter λ has been reached.pne_detect_events()
detects events from event function values.pne_detected_event()
returns detected event details for events
with a particular name.pne_event_nose()
detects the limit or nose point.pne_event_target_lam()
detects a target λ value.pne_pfcn_arc_length()
implements arc length parameterization.pne_pfcn_natural()
implements natural parameterization.pne_pfcn_pseudo_arc_length()
implements pseudo arc length
parameterization.pne_register_callbacks()
registers callback functions.pne_register_events()
registers event functions.mp_idx_manager/set_type_idx_map()
method returns information about
mapping of indices for a given set type back to the corresponding
named (and possibly indexed) sets.mpopt2pneopt()
creates or modifies an options struct for
pnes_master()
from a MATPOWER options struct.
Bugs Fixed:
- Calling the
problem_type()
oris_mixed_integer()
method on an empty
model no longer causes a fatal error.
Other Changes
- Labels from the
set_types
property are now used as headers for
opt_model/display()
to simplify things facilitate use by sub-classes. - Refactored
describe_idx
into a new method,set_type_idx_map
, that
returns in information in a programmatically usable form, and an updated
describe_idx
that calls the new method, then formats the results in
the expected char array(s).
MP-Opt-Model 3.0
What's New in MP-Opt-Model 3.0
Released October 8, 2020
Below is a summary of the changes since version 2.1 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 OSQP solver for LP and QP problems (https://osqp.org).
- Support for modifying parameters of an existing MP-Opt-Model object.
- Support for extracting specific named/indexed variables, costs, constraint
values and shadow prices, etc. from a solved MP-Opt-Model object. - Results of the
solve()
method saved to thesoln
field of the
MP-Opt-Model object. - Allow
v0
,vl
, andvu
inputs toopt_model/add_var()
method, and
l
andu
inputs toopt_model/add_lin_constraint()
to be scalars
that get expanded automatically to the appropriate vector dimension. - New functions:
opt_model/set_params()
method modifies parameters for a given named
set of existing variables, costs, or constraints of an MP-Opt-Model
object.opt_model/get_soln()
method extracts solved results for a given
named set of variables, constraints or costs.opt_model/parse_soln()
method returns a complete set of solution
vector and shadow price values for a solved model.opt_model/eval_lin_constraint()
method computes the constraint values
for the full set or an individual named subset of linear constraints.qps_osqp()
provides standardized interface for using OSQP to
solve LP/QP problemsosqp_options()
initializes options for OSQP solverosqpver()
returns/displays version information for OSQP- ... plus 29 individual feature detection functions for
have_feature()
, see Table A-7 in the MP-Opt-Model User's Manual
for details.
Bugs Fixed:
- Starting point supplied to
solve()
viaopt.x0
is no longer ignored
for nonlinear equations. - Calling
params_var()
method with emptyidx
no longer results in
fatal error. - For
opt_model
, incorrect evaluation of constant term has been fixed for
vector valued quadratic costs with constant term supplied as a vector.
Other Changes
- 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. - Deprecated
have_fcn()
and make it a simple wrapper around the new
modular and extensiblehave_feature()
, which has now been moved to
MP-Test (https://github.com/MATPOWER/mptest).
MP-Opt-Model 2.1
What's New in MP-Opt-Model 2.1
Released August 25, 2020
Below is a summary of the changes since version 2.0 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
- Fast-decoupled Newton's and Gauss-Seidel solvers for nonlinear equations.
- New 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. - New core nonlinear equation solver function with arbitrary, user-defined
update function, used to implement Gauss-Seidel and Newton solvers. - New functions:
nleqs_fd_newton()
solves a nonlinear set of equations via a
fast-decoupled Newton's method.nleqs_gauss_seidel()
solves a nonlinear set of equations via a
Gauss-Seidel method.nleqs_core()
implements core nonlinear equation solver with
arbitrary update function.
Incompatible Changes
- In
output
return value fromnleqs_newton()
, changed thenormF
field ofoutput.hist
tonormf
, for consistency in using lowercase
f
everywhere.
MP-Opt-Model 2.0
What's New in MP-Opt-Model 2.0
Released July 8, 2020
Below is a summary of the changes since version 1.0 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
- Add new
'fsolve'
tag tohave_fcn()
to check for availability of
fsolve()
function. - 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 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. - New functions:
mpopt2nleqopt()
creates or modifies an options struct for
nleqs_master()
from a MATPOWER options struct.nleqs_fsolve()
provides implementation of unified nonlinear
equation solver interface forfsolve
.nleqs_master()
provides a single wrapper function for calling
any of MP-Opt-Model's nonlinear equation solvers.nleqs_newton()
provides implementation of Newton's method solver
with a unified nonlinear equation solver interface.opt_model/params_nln_constraint()
method returns parameters for
a named (and optionally indexed) set of nonlinear constraints.opt_model/params_nln_cost()
method returns parameters for a
named (and optionally indexed) set of general nonlinear costs.
Other Changes
- 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. - Remove redundant MIPS tests from
test_mp_opt_model.m
. - Add tests for solving LP/QP, MILP/MIQP, NLP and NLEQ problems via
opt_model/solve()
. - Add Table 6-1 of valid
have_fcn()
input tags to User's Manual.
MP-Opt-Model 1.0
What's New in MP-Opt-Model 1.0
Released May 8, 2020
Below is a summary of the changes since version 0.8 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 Documentation:
- Add the MP-Opt-Model User's Manual with LaTeX source code included in
docs/src
.
Other Improvements:
- 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.