nsw_conn_check
PURPOSE
suppose a topology, n nodes, m links, given:
SYNOPSIS
function [lambda2,L,Lad,connected,eigs]=nsw_conn_check(link_ids,n)
DESCRIPTION
CROSS-REFERENCE INFORMATION
This function calls:
This function is called by:
- sg_topology SG_TOPOLOGY Generate random power grid topology using RT-nestedSmallWorld
SOURCE CODE
0001 function [lambda2,L,Lad,connected,eigs]=nsw_conn_check(link_ids,n)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 m = length(link_ids);
0019 Lad = zeros(m,n);
0020 for k = 1:m
0021 nodei=link_ids(k,1); nodej=link_ids(k,2);
0022 Lad(k,nodei)=1;
0023 Lad(k,nodej)=-1;
0024 end
0025 L = Lad'*Lad;
0026 eigs = sort(eig(L));
0027 lambda2 = eigs(2);
0028
0029 if(lambda2 < 1e-6)
0030 connected = 0;
0031 else
0032 connected = 1;
0033 end
Generated on Fri 09-Oct-2020 11:21:31 by m2html © 2005