-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathBengtHu3.m
executable file
·61 lines (46 loc) · 1.29 KB
/
BengtHu3.m
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
57
58
59
60
function [Xt, M]=BengtHu3(Ba, x, j)
%Bengt-Hu approach in axis determination 2D MVAB
x=x-x(length(x))/2;
Lp=x(length(x));
x=x/Lp;
switch j
case 1
fac=(x)/((x(length(x))));
Bt(:,1)=(Ba(:,1)./Ba(:,2)).*(fac');
%Bt(:,2)=zeros(size(Ba(:,2)));
Bt(:,2)=(Ba(:,3)./Ba(:,2)).*(fac');
[Xt, L12, M]=mvab2D(Bt, 1);
case 2
for k=1:800
kapa=pi/2*(k/800);
Bt(:,1)=(Ba(:,1)./Ba(:,2)).*sin(x'*sin(kapa))/(sin(kapa));
%Bt(:,2)=zeros(size(Ba(:,2)));
Bt(:,2)=(Ba(:,3)./Ba(:,2)).*sin(x'*sin(kapa))/(sin(kapa));
[Xt, L12, M]=mvab2D(Bt, 1);
LL0(k)=M(2);
end
K0=find(LL0==min(LL0));
kapa=pi/2*(K0(1)/800);
Bt(:,1)=(Ba(:,1)./Ba(:,2)).*sin(x'*sin(kapa))/(sin(kapa));
%Bt(:,2)=zeros(size(Ba(:,2)));
Bt(:,2)=(Ba(:,3)./Ba(:,2)).*sin(x'*sin(kapa))/(sin(kapa));
[Xt, L12, M]=mvab2D(Bt, 1);
case 3
for k=1:400
kapa=pi/2*(k/400);
Bt(:,1)=(Ba(:,1)./Ba(:,2)).*sinh((x')*sin(kapa))/(sin(kapa));
%Bt(:,2)=zeros(size(Ba(:,2)));
Bt(:,2)=(Ba(:,3)./Ba(:,2)).*sinh(x'*sin(kapa))/(sin(kapa));
[Xt, L12, M]=mvab2D(Bt, 1);
LL0(k)=M(2);
end
K0=find(LL0==min(LL0));
kapa=pi/2*(K0(1)/400);
Bt(:,1)=(Ba(:,1)./Ba(:,2)).*sinh((x')*sin(kapa))/(sin(kapa));
%Bt(:,2)=zeros(size(Ba(:,2)));
Bt(:,2)=(Ba(:,3)./Ba(:,2)).*sinh(x'*sin(kapa))/(sin(kapa));
[Xt, L12, M]=mvab2D(Bt, 1);
otherwise
disp('Undefined normalization function.');
end
M=[M; L12*180/pi];