Skip to content

Commit

Permalink
Remove deprecated opf.init_from_mpc option.
Browse files Browse the repository at this point in the history
Use `opf.start`.
  • Loading branch information
rdzman committed Dec 22, 2022
1 parent 54cc812 commit a98a118
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 38 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Changes since 7.1

#### 12/21/22
- Add MP-Core tests to `test_matpower`.
- Remove deprecated `opf.init_from_mpc` option. Use `opf.start`.

#### 12/19/22
- Add option `exp.use_legacy_core` to bypass MP-Core and force use of
Expand Down
18 changes: 4 additions & 14 deletions docs/src/MATPOWER-manual/MATPOWER-manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2827,12 +2827,6 @@ \subsection{{\tt runopf}}
0 & do \emph{not} include softlims if not explicitly specified \\
1 & include softlims with default values if not explicitly specified \\
\end{tabular} \\
\code{opf.init\_from\_mpc}\tnote{*} & -1 & specify whether to use the current state in \matpower{} case to initialize OPF \\
&& \begin{tabular}{r @{ -- } l}
-1 & \matpower{} decides based on solver/algorithm \\
0 & ignore current state in \matpower{} case\tnote{\ddag} \\
1 & use current state in \matpower{} case \\
\end{tabular} \\
\code{opf.start} & 0 & strategy for initializing OPF starting point \\
&& \begin{tabular}{r @{ -- } p{0.5\textwidth}}
0 & default, \matpower{} decides based on solver, \emph{(currently identical to 1)} \\
Expand All @@ -2845,7 +2839,6 @@ \subsection{{\tt runopf}}
\end{tabular}
\begin{tablenotes}
\scriptsize
\item [*] Deprecated. Use \code{opf.start} instead.
\item [\dag] Using a value between 0 and 1 results in the limits being determined by the corresponding weighted average of the 2 options.
\item [\ddag] Only applies to \code{fmincon}, \ipopt{}, \knitro{} and \mips{} solvers, which use an interior point estimate; others use current state in \matpower{} case, as with \code{opf.start} = 2.
\end{tablenotes}
Expand Down Expand Up @@ -5185,12 +5178,6 @@ \section{\matpower{} Options}
0 & do \emph{not} include softlims if not explicitly specified \\
1 & include softlims with default values if not explicitly specified \\
\end{tabular} \\
\code{opf.init\_from\_mpc}\tnote{*} & -1 & specify whether to use the current state in \matpower{} case to initialize OPF \\
&& \begin{tabular}{r @{ -- } l}
-1 & \matpower{} decides based on solver/algorithm \\
0 & ignore current state in \matpower{} case\tnote{\ddag} \\
1 & use current state in \matpower{} case \\
\end{tabular} \\
\code{opf.start} & 0 & strategy for initializing OPF starting point \\
&& \begin{tabular}{r @{ -- } p{0.5\textwidth}}
0 & default, \matpower{} decides based on solver, \emph{(currently identical to 1)} \\
Expand All @@ -5203,7 +5190,6 @@ \section{\matpower{} Options}
\end{tabular}
\begin{tablenotes}
\scriptsize
\item [*] Deprecated. Use \code{opf.start} instead.
\item [\dag] Using a value between 0 and 1 results in the limits being determined by the corresponding weighted average of the 2 options.
\item [\ddag] Only applies to \code{fmincon}, \ipopt{}, \knitro{} and \mips{} solvers, which use an interior point estimate; others use current state in \matpower{} case, as with \code{opf.start} = 2.
\end{tablenotes}
Expand Down Expand Up @@ -8561,6 +8547,10 @@ \subsubsection*{Incompatible Changes}
\item \code{linear\_constraints()} -- use \code{params\_lin\_constraint()} instead.
\end{itemize}
\end{itemize}
\item Remove deprecated option:
\begin{itemize}
\item \codeq{opf.init\_from\_mpc} -- use \codeq{opf.start} instead.
\end{itemize}
\end{itemize}


Expand Down
21 changes: 5 additions & 16 deletions lib/mpoption.m
Original file line number Diff line number Diff line change
Expand Up @@ -242,17 +242,6 @@
% provided
% [ 0 - do not include softlims if not explicitly specified ]
% [ 1 - include softlims w/default values if not explicitly specified ]
% opf.init_from_mpc -1 (DEPRECATED: use opf.start instead)
% specify whether to use current state
% in MATPOWER case to initialize OPF
% (currently only supported by fmincon,
% Ipopt, Knitro and MIPS solvers,
% others always use mpc)
% [ -1 - MATPOWER decides, based on solver/algorithm ]
% [ 0 - ignore current state in MATPOWER case (only applies to ]
% [ fmincon, Ipopt, Knitro and MIPS, which use an interior pt ]
% [ estimate; others use current state as with opf.start = 2) ]
% [ 1 - use current state in MATPOWER case ]
% opf.start 0 strategy for initializing OPF start pt
% [ 0 - default, MATPOWER decides based on solver ]
% [ (currently identical to 1) ]
Expand Down Expand Up @@ -562,9 +551,9 @@
%if opt0.v <= 3 %% convert version 3 to 4
%% new mips options were all optional, no conversion needed
%end
if opt0.v <= 4 %% convert version 4 to 5
opt0.opf.init_from_mpc = opt_d.opf.init_from_mpc;
end
%if opt0.v <= 4 %% convert version 4 to 5
% opt0.opf.init_from_mpc = opt_d.opf.init_from_mpc;
%end
if opt0.v <= 5 %% convert version 5 to 6
if isfield(opt_d, 'clp')
opt0.clp = opt_d.clp;
Expand Down Expand Up @@ -1612,7 +1601,6 @@
'ignore_angle_lim', 0, ...
'softlims', struct(...
'default', 1 ), ...
'init_from_mpc', -1, ...
'start', 0, ...
'return_raw_der', 0 ), ...
'verbose', 1, ...
Expand Down Expand Up @@ -1676,7 +1664,7 @@
%% globals
%%-------------------------------------------------------------------
function v = mpoption_version
v = 23; %% version number of MATPOWER options struct
v = 24; %% version number of MATPOWER options struct
%% (must be incremented every time structure is updated)
%% v1 - first version based on struct (MATPOWER 5.0b1)
%% v2 - added 'linprog' and 'quadprog' fields
Expand Down Expand Up @@ -1713,6 +1701,7 @@
%% v23 - add option 'exp.use_legacy_core' to bypass MP-Core
%% and force use of legacy core code for runpf(),
%% runcpf(), runopf()
%% v24 - removed deprecated 'opf.init_from_mpc'

%%-------------------------------------------------------------------
function db_level = DEBUG
Expand Down
7 changes: 0 additions & 7 deletions lib/opf.m
Original file line number Diff line number Diff line change
Expand Up @@ -185,13 +185,6 @@
mpopt = mpoption(mpopt, 'opf.ac.solver', 'MIPS'); %% MIPS
end

%% handle deprecated 'opf.init_from_mpc' option
if mpopt.opf.start == 0 && mpopt.opf.init_from_mpc ~= -1
%% init_from_mpc = 0 --> start = 1 don't use mpc
%% init_from_mpc = 1 --> start = 2 do use mpc
mpopt.opf.start = mpopt.opf.init_from_mpc + 1;
end

%% initialize state with power flow solution, if requested
if mpopt.opf.start == 3
mpopt_pf = mpoption(mpopt, 'out.all', 0, 'verbose', max(0, mpopt.verbose-1));
Expand Down
2 changes: 1 addition & 1 deletion lib/t/t_mpoption.m
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function t_mpoption(quiet)
quiet = 0;
end

v = 23;
v = 24;

t_begin(152, quiet);

Expand Down

0 comments on commit a98a118

Please sign in to comment.