


REDUCEMATRIX [K_nn]= reducematrix( K_gg, G_mn, pv_m_set, pv_n_set, msize, flag )
Reduces K_gg to K_nn
K_nn^~ K_nm
K_gg = [ ]
K_mn K_mm
if flag == 1
K_nn = K_nn^~ + K_nm * G_mn
else
K_nn = K_nn^~ + K_nm * G_mn + G_mn^T * K_mn + G_mn^T * K_mm * G_mn
m dof to be condensed
n dof to be retained
g total dof g = m + n
Input: K_gg matrix (g x g)
G_mn Reduction matrix from constraints (m x n)
pv_m_set partitioning vector for the m dof wrt g
pv_n_set partitioning vector for the n dof wrt g
msize number of m-set dof
flag flag for type of condensation, see above
Output: K_nn reduced matrix (n x n)
Called by Reducematrixfromgtof (mf), Normalmodes (ms)
Calls none
where ms= m-script, mf= m-function, mex= executable function (c-code)
pv_m_set and pv_n_set index vectors are with respect to the g- set.
All input and output variables are assumed to be in the workspace.

0001 function [K_nn]= reducematrix( K_gg, G_mn, pv_m_set, pv_n_set, msize, flag ); 0002 % REDUCEMATRIX [K_nn]= reducematrix( K_gg, G_mn, pv_m_set, pv_n_set, msize, flag ) 0003 % Reduces K_gg to K_nn 0004 % 0005 % K_nn^~ K_nm 0006 % K_gg = [ ] 0007 % K_mn K_mm 0008 % 0009 % if flag == 1 0010 % K_nn = K_nn^~ + K_nm * G_mn 0011 % else 0012 % K_nn = K_nn^~ + K_nm * G_mn + G_mn^T * K_mn + G_mn^T * K_mm * G_mn 0013 % 0014 % m dof to be condensed 0015 % n dof to be retained 0016 % g total dof g = m + n 0017 % 0018 % Input: K_gg matrix (g x g) 0019 % G_mn Reduction matrix from constraints (m x n) 0020 % pv_m_set partitioning vector for the m dof wrt g 0021 % pv_n_set partitioning vector for the n dof wrt g 0022 % msize number of m-set dof 0023 % flag flag for type of condensation, see above 0024 % 0025 % Output: K_nn reduced matrix (n x n) 0026 % 0027 % Called by Reducematrixfromgtof (mf), Normalmodes (ms) 0028 % Calls none 0029 % where ms= m-script, mf= m-function, mex= executable function (c-code) 0030 % 0031 % pv_m_set and pv_n_set index vectors are with respect to the g- set. 0032 % 0033 % All input and output variables are assumed to be in the workspace. 0034 0035 if msize > 0 0036 0037 % Partition K_gg 0038 0039 K_mm = K_gg( pv_m_set, pv_m_set); 0040 K_mn = K_gg( pv_m_set, pv_n_set); 0041 K_nm = K_gg( pv_n_set, pv_m_set); 0042 K_nn = K_gg( pv_n_set, pv_n_set); 0043 0044 % Reduce K_gg to K_nn 0045 0046 K_nn = K_nn + K_nm * G_mn; 0047 0048 if flag ~= 1 0049 0050 K_mn = K_mn + K_mm * G_mn; 0051 K_nn = K_nn + G_mn' * K_mn; 0052 0053 end 0054 0055 else 0056 0057 % msize=0 just return input 0058 0059 K_nn = K_gg; 0060 0061 end