Date: Feb 2, 2013 1:48 PM
Author: Hugo
Subject: kk Matrix is singular and it should not be!

Hello, I am trying to obtain deflection results on a beam made with shell elements

I wrote a MATLAB code. The problem is that kk is a matrix with 3000*3000 full of zeros (it´s a singular matrix), and it is not supposed to be
The code runs well until I call the function feasmbl1.m, which is shown next


function [kk]=feasmbl1(kk,k,index)
%----------------------------------------------------------
% Purpose:
% Assembly of element matrices into the system matrix
%
% Synopsis:
% [kk]=feasmbl1(kk,k,index)
%
% Variable Description:
% kk - system matrix
% k - element matri
% index - d.o.f. vector associated with an element
%-----------------------------------------------------------


edof = length(index);
for i=1:edof
ii=index(i);
for j=1:edof
jj=index(j);
kk(ii,jj)=kk(ii,jj)+k(i,j);
end
end


The values of the scalars used in the function are:

edof=24
ii=192
jj=192

my index is calculated by a previous function, and has the following values:

index =

1
2
3
4
5
6
13
14
15
16
17
18
241
242
243
244
245
246
187
188
189
190
191
192


My k is a matrix and is equal to:


kt =

1.0e+09 *

Columns 1 through 9

0.0099 -0.0049 -0.0476 0.0012 -0.0063 0.0002 0.0310 -0.0006 -0.1653
0.0106 -0.0061 -0.0719 0.0017 -0.0092 0.0004 0.0414 -0.0008 -0.2408
0.0379 -0.0197 -0.1708 0.0042 -0.0227 0.0006 0.1160 -0.0025 -0.5958
-0.0011 0.0008 0.0036 -0.0001 0.0005 -0.0000 -0.0032 0.0001 0.0130
0.0051 -0.0026 -0.0229 0.0006 -0.0031 0.0001 0.0156 -0.0003 -0.0800
0.0013 -0.0024 0.0055 -0.0001 0.0006 -0.0000 0.0021 -0.0003 0.0168
0.0344 -0.0170 -0.1655 0.0041 -0.0219 0.0006 0.1073 -0.0021 -0.5748
-0.0262 0.0558 -0.1797 0.0040 -0.0214 0.0007 -0.0284 0.0070 -0.5619
0.1332 -0.0691 -0.6005 0.0149 -0.0800 0.0022 0.4076 -0.0086 -2.0945
-0.0011 0.0008 0.0036 -0.0001 0.0005 -0.0000 -0.0032 0.0001 0.0130
0.0051 -0.0026 -0.0229 0.0006 -0.0031 0.0001 0.0156 -0.0003 -0.0800
0.0013 -0.0024 0.0055 -0.0001 0.0006 -0.0000 0.0021 -0.0003 0.0168
-0.0099 0.0049 0.0476 -0.0012 0.0063 -0.0002 -0.0310 0.0006 0.1653
-0.0106 0.0061 0.0719 -0.0017 0.0092 -0.0004 -0.0414 0.0008 0.2408
-0.0379 0.0197 0.1708 -0.0042 0.0227 -0.0006 -0.1160 0.0025 0.5958
-0.0011 0.0008 0.0036 -0.0001 0.0005 -0.0000 -0.0032 0.0001 0.0130
0.0051 -0.0026 -0.0229 0.0006 -0.0031 0.0001 0.0156 -0.0003 -0.0800
0.0013 -0.0024 0.0055 -0.0001 0.0006 -0.0000 0.0021 -0.0003 0.0168
-0.0344 0.0170 0.1655 -0.0041 0.0219 -0.0006 -0.1073 0.0021 0.5748
0.0262 -0.0558 0.1797 -0.0040 0.0214 -0.0007 0.0284 -0.0070 0.5619
-0.1332 0.0691 0.6005 -0.0149 0.0800 -0.0022 -0.4076 0.0086 2.0945
-0.0011 0.0008 0.0036 -0.0001 0.0005 -0.0000 -0.0032 0.0001 0.0130
0.0051 -0.0026 -0.0229 0.0006 -0.0031 0.0001 0.0156 -0.0003 -0.0800
0.0013 -0.0024 0.0055 -0.0001 0.0006 -0.0000 0.0021 -0.0003 0.0168

Columns 10 through 18

0.0012 -0.0063 0.0002 -0.0099 0.0049 0.0476 0.0012 -0.0063 0.0002
0.0017 -0.0092 0.0004 -0.0106 0.0061 0.0719 0.0017 -0.0092 0.0004
0.0042 -0.0227 0.0006 -0.0379 0.0197 0.1708 0.0042 -0.0227 0.0006
-0.0001 0.0005 -0.0000 0.0011 -0.0008 -0.0036 -0.0001 0.0005 -0.0000
0.0006 -0.0031 0.0001 -0.0051 0.0026 0.0229 0.0006 -0.0031 0.0001
-0.0001 0.0006 -0.0000 -0.0013 0.0024 -0.0055 -0.0001 0.0006 -0.0000
0.0041 -0.0219 0.0006 -0.0344 0.0170 0.1655 0.0041 -0.0219 0.0006
0.0040 -0.0214 0.0007 0.0262 -0.0558 0.1797 0.0040 -0.0214 0.0007
0.0149 -0.0800 0.0022 -0.1332 0.0691 0.6005 0.0149 -0.0800 0.0022
-0.0001 0.0005 -0.0000 0.0011 -0.0008 -0.0036 -0.0001 0.0005 -0.0000
0.0006 -0.0031 0.0001 -0.0051 0.0026 0.0229 0.0006 -0.0031 0.0001
-0.0001 0.0006 -0.0000 -0.0013 0.0024 -0.0055 -0.0001 0.0006 -0.0000
-0.0012 0.0063 -0.0002 0.0099 -0.0049 -0.0476 -0.0012 0.0063 -0.0002
-0.0017 0.0092 -0.0004 0.0106 -0.0061 -0.0719 -0.0017 0.0092 -0.0004
-0.0042 0.0227 -0.0006 0.0379 -0.0197 -0.1708 -0.0042 0.0227 -0.0006
-0.0001 0.0005 -0.0000 0.0011 -0.0008 -0.0036 -0.0001 0.0005 -0.0000
0.0006 -0.0031 0.0001 -0.0051 0.0026 0.0229 0.0006 -0.0031 0.0001
-0.0001 0.0006 -0.0000 -0.0013 0.0024 -0.0055 -0.0001 0.0006 -0.0000
-0.0041 0.0219 -0.0006 0.0344 -0.0170 -0.1655 -0.0041 0.0219 -0.0006
-0.0040 0.0214 -0.0007 -0.0262 0.0558 -0.1797 -0.0040 0.0214 -0.0007
-0.0149 0.0800 -0.0022 0.1332 -0.0691 -0.6005 -0.0149 0.0800 -0.0022
-0.0001 0.0005 -0.0000 0.0011 -0.0008 -0.0036 -0.0001 0.0005 -0.0000
0.0006 -0.0031 0.0001 -0.0051 0.0026 0.0229 0.0006 -0.0031 0.0001
-0.0001 0.0006 -0.0000 -0.0013 0.0024 -0.0055 -0.0001 0.0006 -0.0000

Columns 19 through 24

-0.0310 0.0006 0.1653 0.0012 -0.0063 0.0002
-0.0414 0.0008 0.2408 0.0017 -0.0092 0.0004
-0.1160 0.0025 0.5958 0.0042 -0.0227 0.0006
0.0032 -0.0001 -0.0130 -0.0001 0.0005 -0.0000
-0.0156 0.0003 0.0800 0.0006 -0.0031 0.0001
-0.0021 0.0003 -0.0168 -0.0001 0.0006 -0.0000
-0.1073 0.0021 0.5748 0.0041 -0.0219 0.0006
0.0284 -0.0070 0.5619 0.0040 -0.0214 0.0007
-0.4076 0.0086 2.0945 0.0149 -0.0800 0.0022
0.0032 -0.0001 -0.0130 -0.0001 0.0005 -0.0000
-0.0156 0.0003 0.0800 0.0006 -0.0031 0.0001
-0.0021 0.0003 -0.0168 -0.0001 0.0006 -0.0000
0.0310 -0.0006 -0.1653 -0.0012 0.0063 -0.0002
0.0414 -0.0008 -0.2408 -0.0017 0.0092 -0.0004
0.1160 -0.0025 -0.5958 -0.0042 0.0227 -0.0006
0.0032 -0.0001 -0.0130 -0.0001 0.0005 -0.0000
-0.0156 0.0003 0.0800 0.0006 -0.0031 0.0001
-0.0021 0.0003 -0.0168 -0.0001 0.0006 -0.0000
0.1073 -0.0021 -0.5748 -0.0041 0.0219 -0.0006
-0.0284 0.0070 -0.5619 -0.0040 0.0214 -0.0007
0.4076 -0.0086 -2.0945 -0.0149 0.0800 -0.0022
0.0032 -0.0001 -0.0130 -0.0001 0.0005 -0.0000
-0.0156 0.0003 0.0800 0.0006 -0.0031 0.0001
-0.0021 0.0003 -0.0168 -0.0001 0.0006 -0.0000

K>>

Can anyone tell me what is wrong in the code? Why is the kk matrix singular?

regards,
Hugo