-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathModifiedMasterStiffness.m
More file actions
30 lines (27 loc) · 929 Bytes
/
ModifiedMasterStiffness.m
File metadata and controls
30 lines (27 loc) · 929 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
%------------------------------------------------------------------
% ModifiedMasterStiffness calculate the Kmod, which is the stiffness matrix
% after the BC
% nodetag = [ nodetag_x1, nodetag_y1; nodetag_x2, nodetag_y2;...., nodetag_xn, nodetag_yn;]
% It is 1 when the displacement is specified and 0 otherwise.
function Kmodified = ModifiedMasterStiffness(nodetag,K)
Kmodified = K;
nnode = length(K);
for i = 1:nnode
%gets the ceiling number and the remainder, so it is not necessary to
%flat the vector nodetag
if rem(i,2) == 1
column = 1;
else
column =2;
end
if nodetag( ceil(i/2), column ) == 1
for j=1:nnode
if j == i
Kmodified(i, j) = 1;
else
Kmodified(i,j) = 0;
end
end
end
end
end