Home > matpower4.0 > @opf_model > display.m

display

PURPOSE ^

DISPLAY Displays the object.

SYNOPSIS ^

function display(om)

DESCRIPTION ^

DISPLAY  Displays the object.
   Called when semicolon is omitted at the command-line. Displays the details
   of the variables, constraints, costs included in the model.

   See also OPF_MODEL.

CROSS-REFERENCE INFORMATION ^

This function calls: This function is called by:

SOURCE CODE ^

0001 function display(om)
0002 %DISPLAY  Displays the object.
0003 %   Called when semicolon is omitted at the command-line. Displays the details
0004 %   of the variables, constraints, costs included in the model.
0005 %
0006 %   See also OPF_MODEL.
0007 
0008 %   MATPOWER
0009 %   $Id: display.m,v 1.9 2010/04/26 19:45:25 ray Exp $
0010 %   by Ray Zimmerman, PSERC Cornell
0011 %   Copyright (c) 2008-2010 by Power System Engineering Research Center (PSERC)
0012 %
0013 %   This file is part of MATPOWER.
0014 %   See http://www.pserc.cornell.edu/matpower/ for more info.
0015 %
0016 %   MATPOWER is free software: you can redistribute it and/or modify
0017 %   it under the terms of the GNU General Public License as published
0018 %   by the Free Software Foundation, either version 3 of the License,
0019 %   or (at your option) any later version.
0020 %
0021 %   MATPOWER is distributed in the hope that it will be useful,
0022 %   but WITHOUT ANY WARRANTY; without even the implied warranty of
0023 %   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0024 %   GNU General Public License for more details.
0025 %
0026 %   You should have received a copy of the GNU General Public License
0027 %   along with MATPOWER. If not, see <http://www.gnu.org/licenses/>.
0028 %
0029 %   Additional permission under GNU GPL version 3 section 7
0030 %
0031 %   If you modify MATPOWER, or any covered work, to interface with
0032 %   other modules (such as MATLAB code and MEX-files) available in a
0033 %   MATLAB(R) or comparable environment containing parts covered
0034 %   under other licensing terms, the licensors of MATPOWER grant
0035 %   you additional permission to convey the resulting work.
0036 
0037 if om.var.NS
0038     fprintf('\n%-22s %5s %8s %8s %8s\n', 'VARIABLES', 'name', 'i1', 'iN', 'N');
0039     fprintf('%-22s %5s %8s %8s %8s\n', '=========', '------', '-----', '-----', '------');
0040     for k = 1:om.var.NS
0041         name = om.var.order{k};
0042         idx = om.var.idx;
0043         fprintf('%15d:%12s %8d %8d %8d\n', k, name, idx.i1.(name), idx.iN.(name), idx.N.(name));
0044     end
0045     fprintf('%15s%31s\n', sprintf('var.NS = %d', om.var.NS), sprintf('var.N = %d', om.var.N));
0046     fprintf('\n');
0047 else
0048     fprintf('%s  :  <none>\n', 'VARIABLES');
0049 end
0050 if om.nln.NS
0051     fprintf('\n%-22s %5s %8s %8s %8s\n', 'NON-LINEAR CONSTRAINTS', 'name', 'i1', 'iN', 'N');
0052     fprintf('%-22s %5s %8s %8s %8s\n', '======================', '------', '-----', '-----', '------');
0053     for k = 1:om.nln.NS
0054         name = om.nln.order{k};
0055         idx = om.nln.idx;
0056         fprintf('%15d:%12s %8d %8d %8d\n', k, name, idx.i1.(name), idx.iN.(name), idx.N.(name));
0057     end
0058     fprintf('%15s%31s\n', sprintf('nln.NS = %d', om.nln.NS), sprintf('nln.N = %d', om.nln.N));
0059     fprintf('\n');
0060 else
0061     fprintf('%s  :  <none>\n', 'NON-LINEAR CONSTRAINTS');
0062 end
0063 if om.lin.NS
0064     fprintf('\n%-22s %5s %8s %8s %8s\n', 'LINEAR CONSTRAINTS', 'name', 'i1', 'iN', 'N');
0065     fprintf('%-22s %5s %8s %8s %8s\n', '==================', '------', '-----', '-----', '------');
0066     for k = 1:om.lin.NS
0067         name = om.lin.order{k};
0068         idx = om.lin.idx;
0069         fprintf('%15d:%12s %8d %8d %8d\n', k, name, idx.i1.(name), idx.iN.(name), idx.N.(name));
0070     end
0071     fprintf('%15s%31s\n', sprintf('lin.NS = %d', om.lin.NS), sprintf('lin.N = %d', om.lin.N));
0072     fprintf('\n');
0073 else
0074     fprintf('%s  :  <none>\n', 'LINEAR CONSTRAINTS');
0075 end
0076 if om.cost.NS
0077     fprintf('\n%-22s %5s %8s %8s %8s\n', 'COSTS', 'name', 'i1', 'iN', 'N');
0078     fprintf('%-22s %5s %8s %8s %8s\n', '=====', '------', '-----', '-----', '------');
0079     for k = 1:om.cost.NS
0080         name = om.cost.order{k};
0081         idx = om.cost.idx;
0082         fprintf('%15d:%12s %8d %8d %8d\n', k, name, idx.i1.(name), idx.iN.(name), idx.N.(name));
0083     end
0084     fprintf('%15s%31s\n', sprintf('cost.NS = %d', om.cost.NS), sprintf('cost.N = %d', om.cost.N));
0085     fprintf('\n');
0086 else
0087     fprintf('%s  :  <none>\n', 'COSTS');
0088 end
0089 
0090 fprintf('  mpc = ');
0091 if ~isempty(fieldnames(om.mpc))
0092     fprintf('\n');
0093 end
0094 display(om.mpc);
0095 
0096 fprintf('  userdata = ');
0097 if ~isempty(fieldnames(om.userdata))
0098     fprintf('\n');
0099 end
0100 display(om.userdata);

Generated on Mon 26-Jan-2015 14:56:45 by m2html © 2005