T_CPF_CB1 User callback function 1 for continuation power flow testing.
0001 function [cb_state, results] = t_cpf_cb1(k, V_c, lam_c, V_p, lam_p, ... 0002 cb_data, cb_state, cb_args, results) 0003 %T_CPF_CB1 User callback function 1 for continuation power flow testing. 0004 0005 % MATPOWER 0006 % $Id: t_cpf_cb1.m 2235 2013-12-11 13:44:13Z ray $ 0007 % by Ray Zimmerman, PSERC Cornell 0008 % Copyright (c) 2013 by Power System Engineering Research Center (PSERC) 0009 % 0010 % This file is part of MATPOWER. 0011 % See http://www.pserc.cornell.edu/matpower/ for more info. 0012 % 0013 % MATPOWER is free software: you can redistribute it and/or modify 0014 % it under the terms of the GNU General Public License as published 0015 % by the Free Software Foundation, either version 3 of the License, 0016 % or (at your option) any later version. 0017 % 0018 % MATPOWER is distributed in the hope that it will be useful, 0019 % but WITHOUT ANY WARRANTY; without even the implied warranty of 0020 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 0021 % GNU General Public License for more details. 0022 % 0023 % You should have received a copy of the GNU General Public License 0024 % along with MATPOWER. If not, see <http://www.gnu.org/licenses/>. 0025 % 0026 % Additional permission under GNU GPL version 3 section 7 0027 % 0028 % If you modify MATPOWER, or any covered work, to interface with 0029 % other modules (such as MATLAB code and MEX-files) available in a 0030 % MATLAB(R) or comparable environment containing parts covered 0031 % under other licensing terms, the licensors of MATPOWER grant 0032 % you additional permission to convey the resulting work. 0033 0034 0035 %%----- INITIAL call ----- 0036 if k == 0 0037 cb_state.cb1.initial = 1; 0038 cb_state.cb1.iteration = 0; 0039 cb_state.cb1.final = 0; 0040 %%----- FINAL call ----- 0041 elseif nargout == 2 0042 results.cb1.final = 1; 0043 %%----- ITERATION call ----- 0044 else 0045 cb_state.cb1.iteration = cb_state.cb1.iteration + 1; 0046 end