Xmin=0; Xmax=0.110; tmin=23; tmax=26; Ymin=-0.005; Ymax=0.005; % Ymin=-0.004; % Ymax=0.004; Zmax=-0.002; Zmin=0; dz=3; dx=330; dy=101; dt=60; Xstep=((Xmax-Xmin)/dx); X=(Xmin:Xstep:Xmax); tstep=((tmax-tmin)/dt); t=(tmin:tstep:tmax); Ystep=((Ymax-Ymin)/dy); Y=(Ymin:Ystep:Ymax); Zstep=((Zmax-Zmin)/dz); Z=(Zmin:Zstep:Zmax); %% v=0.0035; T0=293; q=754.28; l=13; a=13e-6; disp('constants set') disp('start calc1') disp(datestr(now)) for i=1:length(t) for j=1:length(X) ksi(i,j)=X(j)-v*t(i); end end disp('end calc1') disp(datestr(now)) disp('start calc2') ksisq=ksi.^2; Ysq=Y.^2; Zsq=Z.^2; Cntr=1; TOT=length(t)*length(X)*length(Y)*length(Z) for i=1:length(t) for j=1:length(X) for k= 1:length(Y) for f= 1:length(Z) Rsq(i,j,k,f)=(ksisq(i,j)+Ysq(k)+Zsq(f)); prog=(Cntr/TOT)*100 Cntr=Cntr+1; end end end end R=Rsq.^0.5; disp('end calc2') disp(datestr(now)) % for i=1:length(ksi(:,1)) % for j=1:length(ksi(1,:)) % for k= 1:length(Y) % for f= 1:length(Z) % R(i,j,k,f)= sqrt(ksi(i,j)^2+Y(k)^2+Z(f)^2); % end % end % end % end %% con1=q/(2*pi*l); con2=(-v/(2*a)); disp('start calc3') disp(datestr(now)) con4=con2*ksi; disp('start calc4') disp(datestr(now)) for i=1:length(t) for j=1:length(ksi(1,:)) for k= 1:length(Y) for f= 1:length(Z) % T(i,j,k,f)=(T0+(q/(2*pi*l*R(i,j,k,f)))*exp((-v/(2*a))*(ksi(i,j)+R(i,j,k,f))))-273; con5(i,j,k,f)=(con4(i,j)+R(i,j,k,f)); end end end end disp('start calc5') disp(datestr(now)) Rd=R.^-1; con3=con1*Rd; for i=1:length(t) for j=1:length(ksi(1,:)) for k= 1:length(Y) for f= 1:length(Z) % T(i,j,k,f)=(T0+(q/(2*pi*l*R(i,j,k,f)))*exp((-v/(2*a))*(ksi(i,j)+R(i,j,k,f))))-273; Timp(i,j,k,f)=(T0+(con3(i,j,k,f)*exp(con5(i,j,k,f))))-273; end end end end disp('end calc5') disp(datestr(now)) %% Figure close all figure() clear Tc; n=1; F=struct('cdata',[],'colormap',[]); while n<=length(Timp(:,1,1,1)) clf; w=t(n); % Create textbox annotation('textbox',... [0.669327067669171 0.934372533543802 0.1115 0.052380952380953],... 'String',{w},... 'FitBoxToText','off'); plot(X(:),Tc(n,:,(length(Y)/2),4),'.r') ylim([20,3000]); xlim([-0.020,0.200]); H=n; F(H)= getframe(gcf); n=n+1; % pause(0.0001); end %% close all figure() clear Tc; n=1; F=struct('cdata',[],'colormap',[]); while n<=length(Timp(:,1,1,1)) clf; w=t(n); % Create textbox annotation('textbox',... [0.669327067669171 0.934372533543802 0.1115 0.052380952380953],... 'String',{w},... 'FitBoxToText','off'); plot(X(:),Timp(n,:,(length(Y)/2),4),'.r') ylim([20,3000]); xlim([0,0.110]); H=n; F(H)= getframe(gcf); n=n+1; % pause(0.0001); end %% close all figure() clear Tc; F=struct('cdata',[],'colormap',[]); n=1; while n<=length(t) clf; for j=1:length(ksi(1,:)) for k= 1:length(Y) Tc(k,j)= Timp(n,j,k,length(Z)); end end w=t(n); % Create textbox annotation('textbox',... [0.669327067669171 0.934372533543802 0.1115 0.052380952380953],... 'String',{w},... 'FitBoxToText','off'); %zlevs = [1521 1500 1000 691 856 100 35]; zlevs = [1521 1500]; contour(X(:),Y(:),Tc(:,:),zlevs,'ShowText','on'); colorbar('eastoutside'); ylim([-0.010 0.010]) H=n; F(H)= getframe(gcf); n=n+1; pause(10e-10); end %% close all figure() clear Tc; F=struct('cdata',[],'colormap',[]); n=1; while n<=length(Timp(:,1,1,1)) clf; for j=1:length(ksi(1,:)) for k= 1:length(Y) Tc(k,j)= Timp(n,j,k,length(Z)); end end w=t(n); % Create textbox annotation('textbox',... [0.669327067669171 0.934372533543802 0.1115 0.052380952380953],... 'String',{w},... 'FitBoxToText','off'); zlevs = [1521 691 100 35]; contour(X(:),Y(:),Tc(:,:),zlevs,'ShowText','on'); colorbar('eastoutside'); % ylim([-0.01 0.01]) H=n; F(H)= getframe(gcf); n=n+1; pause(10e-10); end %% close all figure() clear Tc; F=struct('cdata',[],'colormap',[]); n=1; while n<=length(Timp(:,1,1,1)) clf; for j=1:length(ksi(1,:)) for k= 1:length(Y) for f= 1:length(Z) Tc(f,k)= Timp(n,(length(X)/2)+(0.5),k,f); end end end w=t(n); % Create textbox annotation('textbox',... [0.669327067669171 0.934372533543802 0.1115 0.052380952380953],... 'String',{w},... 'FitBoxToText','off'); zlevs = [1521 1500 691 856 35]; xlim([-0.005 0.005]) contour(Y(:),Z(:),Tc(:,:),zlevs,'ShowText','on'); contourcmap('jet',50); colorbar('eastoutside'); % ylim([0 75]) % xlim([75 250]) H=n; F(H)= getframe(gcf); n=n+1; pause(10e-10); end %% close all figure() clear Tc; n=1; F=struct('cdata',[],'colormap',[]); while n<=length(T(:,1,1,1)) clf; for j=1:length(ksi(1,:)) for k= 1:length(Y) Tc(k,j)= T(n,j,k,length(Z)-4); end end w=t(n); % Create textbox annotation('textbox',... [0.669327067669171 0.934372533543802 0.1115 0.052380952380953],... 'String',{w},... 'FitBoxToText','off'); mesh(X(:),Y(:),Tc(:,:)); % caxis([250 3000]) zlim([20 3000]) contourcmap('jet',50); colorbar('eastoutside'); H=n; F(H)= getframe(gcf); n=n+1; pause(0.001); end %% %% O=find(T(:,(length(X)/2+(0.5)),(length(Y)/2+(0.5)),end)>=670,1,'first') O2=find(T(:,(length(X)/2+(0.5)),(length(Y)/2+(0.5)),end)>=670,1,'last') %% close all figure() clear Tc; n=O; F=struct('cdata',[],'colormap',[]); while n<=O2+4 clf; for j=1:length(ksi(:,1)) for k= 1:length(Y) for f= 1:length(Z) Tc(f,k)= T(n,(length(X)/2+(0.5)),k,f); end end end w=t(n); % Create textbox annotation('textbox',... [0.669327067669171 0.934372533543802 0.1115 0.052380952380953],... 'String',{w},... 'FitBoxToText','off'); % zlevs = [1795 1773 1129 964] zlevs = [1521 1000 670]; contour(Y(:),Z(:),Tc(:,:),zlevs,'ShowText','on'); xlim([-0.004 0.004]) ylim([-0.0125 -0.002]) contourcmap('jet',2); colorbar('eastoutside'); pause(0.0001); H=n-O+1; F(H)= getframe(gcf); n=n+1; end %% upologismos ugrou O=find(T(:,(length(X)/2+(0.5)),(length(Y)/2+(0.5)),end)>=1521,1,'first') O2=find(T(:,(length(X)/2+(0.5)),(length(Y)/2+(0.5)),end)>=1521,1,'last') n=O; p=1; while n<=O2 for j=1:length(ksi(:,1)) for k= 1:length(Y) for f= 1:length(Z) Tc(f,k)= T(n,(length(X)/2+(0.5)),k,f); end end end xpos1=find(Tc(end,:)>=1500,1,'first'); xpos2=find(Tc(end,:)>=1500,1,'last'); xpos=xpos2-xpos1+1; ypos=0; for i=xpos1:xpos2 ypos1=find(Tc(:,i)>=1500,1,'first'); ypos2=find(Tc(:,i)>=1500,1,'last'); ypos=ypos+(ypos2-ypos1+1); end pos(p)=ypos+xpos; for i=1:length(pos(:)) per(i)=(((pos(i))/max(pos(:)))*100); end p=p+1; n=n+1; end %% close all figure() clear Tc; F=struct('cdata',[],'colormap',[]); n=1; while n<=length(T(:,1,1,1)) clf; for i= 1:length(X) for j= 1:length(Z) Tc(j,i)=T(n,i,(length(Y)/2)+(0.5),j); end end w=t(n); % Create textbox annotation('textbox',... [0.669327067669171 0.934372533543802 0.1115 0.052380952380953],... 'String',{w},... 'FitBoxToText','off'); zlevs = [1521 1500 1300 800 600 35]; % zlevs = [1773 1129 964 400 350 340] contour(X(:),Z(:),Tc(:,:),zlevs,'ShowText','on'); % xlim([0.055 0.062]) ylim([-0.01 -0.002]) contourcmap('jet',2); colorbar('eastoutside'); pause(0.0001); H=n; F(H)= getframe(gcf); n=n+1; end %% fig = figure movie(fig,F,1) movie2avi(F,'strain.avi','compression','none') %% save('temps.mat','T','-v7.3'); %% T2=load('temps.mat'); T=T2.T; %% % true strain calculation thick=Zmax-Zmin; dthick=24; stepthick=thick/dthick; pthick=(Zmin+0.002:stepthick:Zmax+0.002); for i=1:length(pthick) pthick(i)=abs(pthick(i)); pthick(i)=pthick(i)-0.012; end bendrate=0.08; sttot=0.075; totaltime=sttot/bendrate; tstepb=tstep/100; btime=(0.1:tstepb:totaltime+0.1); for i=1:length(btime) posit(i)=btime(i)*bendrate; percbend(i)=posit(i)/sttot; end RAD=0.120; for i=1:length(percbend) currad(i)=RAD*percbend(i); end for i=1:length(currad) for j=1:length(pthick) eaug(i,j)=(pthick(j)/(RAD))*percbend(i); eeng(i,j)= eaug(i,j)/(eaug(i,j)+1); etrue(i,j)=log(eeng(i,j)+1); end end %% %figures strain close all figure() plot(btime(:)-0.1,etrue(:,1),btime(:)-0.1,etrue(:,3)); figure() n=1; while n=0.031,1,'first'); for i=1:length(Xnew); for j=1:length(pthick) pthick2(j)=pthick(j)-0.014; eeq1(j,i)=eaug(59,j); % eeq2(j,i)=eaug(70,j); % eeq3(j,i)=eaug(75,j); end end Xnew=(0:Xmax/(length(etrue(:,1))-1):Xmax); zlevs = [1521 0.031 0.030 0.029 0.028 0.027]; contour(X(:),Z(:),Tc(:,:),zlevs,'ShowText','on'); hold on contour(X(:),Z(:),Tc2(:,:),zlevs,'ShowText','on'); contour(X(:),Z(:),Tc3(:,:),zlevs,'ShowText','on'); contour(X(:),Z(:),Tc4(:,:),zlevs,'ShowText','on'); contour(Xnew(:),pthick2(:),eeq1(:,:),zlevs,'ShowText','on'); % contour(Xnew(:),pthick2(:),eeq2(:,:),zlevs,'ShowText','on'); % contour(Xnew(:),pthick2(:),eeq3(:,:),zlevs,'ShowText','on'); xlim([0.08 0.1]) ylim([-0.004 -0.002])