-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalcBqi2.m
More file actions
56 lines (56 loc) · 1.95 KB
/
CalcBqi2.m
File metadata and controls
56 lines (56 loc) · 1.95 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
function Aqi=CalcBqi2(x,Xi,nn,qq)
%This function evaluates the second derivativs
% of B(x) function at all nodes
%x = x-position
%Xi = coordinates of all nodes
%nn = number of nodes
%qq = elemenet continuity
Aqi=zeros(nn,1);
for ii=1:nn
Temp1=0;
for ll=1:nn
if ll!=ii
Temp0=1;
for jj=1:nn
if and(jj!=ii,jj!=ll)
Temp0=Temp0*((x-Xi(jj))^(qq+1)) ...
/((Xi(ii)-Xi(jj))^(qq+1));
endif
endfor
if qq!=0
Temp1=Temp1+Temp0*(qq+1)*qq*((x-Xi(ll))^(qq-1))/ ...
((Xi(ii)-Xi(ll))^(qq+1));
endif
endif
endfor
Temp2=0;
for ll=1:nn
if ll!=ii
Temp21=0;
for mm=1:nn
if and(mm!=ii,mm!=ll)
Temp0=1;
for jj=1:nn
if and(jj!=mm,and(jj!=ii,jj!=ll))
Temp0=Temp0*((x-Xi(jj))^(qq+1)) ...
/((Xi(ii)-Xi(jj))^(qq+1));
endif
endfor
Temp21=Temp21+Temp0*(qq+1)*((x-Xi(mm))^qq)/ ...
((Xi(ii)-Xi(mm))^(qq+1));
endif
endfor
Temp2=Temp2+Temp21*(qq+1)*((x-Xi(ll))^qq)/ ...
((Xi(ii)-Xi(ll))^(qq+1));
endif
endfor
Aqi(ii)=Temp1+Temp2;
endfor
endfunction
%Function will work on Octave, FreeMat, and Matlab
%Create by Mohammad Tawfik
%mohammad.tawfik@gmail.com
%In assotiation with research paper published on
%ResearchGate.Net
%Title: In Search for the Super Element: Algorithms to Generate Higher-Order Elements
%DOI: 10.13140/RG.2.2.24039.75682