You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
872 B

11 months ago
function sample_V()
num_size=80;
h = 1.0/num_size;
xx = h/2:h:1-h/2;
[x,y,z]=meshgrid(xx,xx,xx);
k=1e6;
num_a = 15;num_b=15;num_c=60;
ha = (2-0.5)/num_a;hb = (2-0.5)/num_b;hc = (1+5)/num_c;
aa = 0.5+ha/2:ha:2-ha/2;
bb = 0.5+hb/2:hb:2-hb/2;
cc = -5+hc/2:hc:1-hc/2;
V=zeros(num_a,num_b,num_c);
for ia=1:num_a
disp(['========================',num2str(ia)])
a=aa(ia);
for ib=1:num_b
b=bb(ib);
for ic=1:num_c
% disp(['========================',num2str(ia),',',num2str(ib),',',num2str(ic)])
c=cc(ic);
if 1+a+b+c<=0
V(ia,ib,ic) = 1;
else
Phi = cos(2*pi*x-pi)+a.*cos(2*pi*y-pi)+b.*cos(2*pi*z-pi)-c;
H = 1./(1+exp(-k.*Phi));
V(ia,ib,ic) = sum(H,'all')/num_size^3;
end
end
end
save ETPMS_Vsample_abc.mat
end
end