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.
78 lines
2.4 KiB
78 lines
2.4 KiB
function plot_convergence_str()
|
|
% load('ani_rmin1.5_cab173.mat','a_log','b_log','c_log')
|
|
% LOOP=[1,10,20,30,50,100,173];
|
|
% loop=1;
|
|
% aPhys=a_log{loop,2};bPhys=b_log{loop,2};cPhys=c_log{loop,2};
|
|
% loop = 0; disp(['loop = ',num2str(loop)])
|
|
% aPhys(:)=1;bPhys(:)=1;cPhys(:)=0;
|
|
% plot_str_smooth(aPhys,bPhys,cPhys);
|
|
% saveas(gcf,['ani_str',num2str(loop)],'png')
|
|
% LOOP=[1,10,20,30,50,200,347];
|
|
% LOOP=[200];
|
|
|
|
% load('ani_fittingALL_pnorm4.mat','a_log','b_log','c_log')
|
|
% LOOP=[1,2,3,5,10,15,20,40,68];
|
|
|
|
load('ani_rmin1.5_concurrent_fitting4.mat','a_log','b_log','c_log')
|
|
LOOP=[1,2,3,5,10,15,20,29];
|
|
|
|
for i=1:size(LOOP,2)
|
|
loop=LOOP(i);disp(['loop = ',num2str(loop)])
|
|
aPhys=a_log{loop,2};bPhys=b_log{loop,2};cPhys=c_log{loop,2};
|
|
% plot_str_smooth(aPhys,bPhys,cPhys);
|
|
plot_ani(aPhys,bPhys,cPhys)
|
|
saveas(gcf,['opt_path\ani_direct_str',num2str(loop)],'png')
|
|
|
|
figure(2)
|
|
plot_ellipse_new(aPhys,bPhys,cPhys);
|
|
saveas(gcf,['opt_path\ani_direct_dist',num2str(loop)],'png')
|
|
end
|
|
end
|
|
|
|
function plot_str_smooth(aPhys,bPhys,cPhys)
|
|
nz=size(aPhys,1);ny=size(aPhys,2);nx=size(aPhys,3);
|
|
l=0.49;
|
|
xx=-1:1:1;
|
|
[dx,dy,dz]=meshgrid(xx,xx,xx);
|
|
dX=[dx(:),dy(:),dz(:)].*l;
|
|
num_p=size(xx,2)^3;
|
|
|
|
count=1;
|
|
a_fun = zeros(nx*ny*nz*num_p,1);
|
|
b_fun = zeros(nx*ny*nz*num_p,1);
|
|
c_fun = zeros(nx*ny*nz*num_p,1);
|
|
in1=zeros(nx*ny*nz*num_p,3);
|
|
for i=1:nx
|
|
for j=1:ny
|
|
for k=1:nz
|
|
for tt=0:num_p-1
|
|
a_fun(count*num_p-tt,1) = aPhys(k,j,i);
|
|
b_fun(count*num_p-tt,1) = bPhys(k,j,i);
|
|
c_fun(count*num_p-tt,1) = cPhys(k,j,i);
|
|
in1(count*num_p-tt,:)=[i-1/2,j-1/2,k-1/2]+dX(tt+1,:);
|
|
end
|
|
count=count+1;
|
|
end
|
|
end
|
|
end
|
|
|
|
Fa=scatteredInterpolant(in1(:,1),in1(:,2),in1(:,3),a_fun,'natural','linear');
|
|
Fb=scatteredInterpolant(in1(:,1),in1(:,2),in1(:,3),b_fun,'natural','linear');
|
|
Fc=scatteredInterpolant(in1(:,1),in1(:,2),in1(:,3),c_fun,'natural','linear');
|
|
x2=0:0.1:nx; y2=0:0.1:ny; z2=0:0.1:nz;
|
|
[x,y,z]=meshgrid(x2,y2,z2);
|
|
a_sim = Fa(x,y,z);b_sim = Fb(x,y,z);c_sim = Fc(x,y,z);
|
|
% PLOT----------------------------------------
|
|
p=cos(2*pi*(x-1/2))+ a_sim.*cos(2*pi*(y-1/2))+ b_sim.*cos(2*pi*(z-1/2))- c_sim;
|
|
figure(1)
|
|
clf;
|
|
set(gcf,'position',[50 50 1600 700])
|
|
isosurface(x,y,z,p,0);
|
|
isocaps(x,y,z,p,0);
|
|
axis equal;axis off;
|
|
colormap([18 184 246]./256);
|
|
view(0,0); %�ӽǵĿ���
|
|
lighting phong; %����ģʽ
|
|
camlight right; %��Դλ��
|
|
material metal
|
|
end
|